I have a new/create method that only has one field, and I''d rather use a js prompt() to get the data instead of a form. The trigger for this is not a link, it''s a span. Using "onclick" in the span, how can I call a prompt(), return the single param to the contoller "create" method, and then call the controller "list" method to update the page? -- Posted via http://www.ruby-forum.com/.
I am thinking it is actually impossible to pass a client side javascript variable into the server side rails without hiding a form somewhere... -- Posted via http://www.ruby-forum.com/.
Rick DeNatale
2009-May-29 00:58 UTC
Re: using js prompt() instead of a form with create method
On Thu, May 28, 2009 at 8:32 PM, Mk 27 <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I am thinking it is actually impossible to pass a client side javascript > variable into the server side rails without hiding a form somewhere...Well you can make an Ajax request, and pass the value of the javascript variable in a query parameter in the url. -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale