randyinla / link_to_remote_with_prompt Goto Github PK
View Code? Open in Web Editor NEWRails plugin: link_to_remote helper now accepts a :prompt option.
License: MIT License
Rails plugin: link_to_remote helper now accepts a :prompt option.
License: MIT License
LinkToRemoteWithPrompt ====================== Inspired by Russ Sherman's work on link_to_with_prompt. (Russ Sherman "code-ronin" - original author of link_to_with_prompt [http://acts-as-coder.blogspot.com/]) link_to_remote now accepts a :prompt option canceled prompt = no AJAX call 'ok' with blank text field = no AJAX call 'ok' with something in text field = AJAX call, along with your_var_name assigned whatever was typed in the text field. * text field is named prompt_reply, but the value will show up as params[:your_var_name] View Example ============ <%= link_to_remote "link_name", { :url => { :controller => 'your_controller', :action => 'your_ajax_action', :id => whatever_object_here, :some_other_param => "whatever" }, :method => :put, :prompt => "Message to user here with #{some_instance_variable_if_you_please_in_here}\nWith another line of text here.", :with => "'your_var_name=' + (prompt_reply)", :html => { :class => "some_class_here" }} %> Don't forget to add the AJAX action to your restful routes: ====================================================== map resources :plural_model_name, :member => { :your_ajax_action => :put } Copyright (c) 2009 [Randy Walker], released under the MIT license
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.