Is there any way to trigger a Rails action from Javascript? The one way I can think of is use some sort of Rails listener on a hidden form field, then update that field with Javascript. But that seems like it''s going to put a huge load on my server, so it''s probably not a great option. Anything more direct? Thanks, Chris -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On 10/6/06, Chris <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Is there any way to trigger a Rails action from Javascript? > > The one way I can think of is use some sort of Rails listener on a > hidden form field, then update that field with Javascript. But that > seems like it''s going to put a huge load on my server, so it''s probably > not a great option. Anything more direct? > > Thanks, > Chris >This is kinda what ajax is used for. -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Chris wrote:> Is there any way to trigger a Rails action from Javascript? > > The one way I can think of is use some sort of Rails listener on a > hidden form field, then update that field with Javascript. But that > seems like it''s going to put a huge load on my server, so it''s probably > not a great option. Anything more direct? > > Thanks, > Chris<%= javascript_tag remote_function( :url => {:action => ''foo''} ) %> -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---