James Smith
2006-Nov-19 19:51 UTC
How do i call a controller action and just return to my temp
Could someone please tell me how i can call an action method in my controller, but just complete the action and return to the current template without reloading the current template? is it worth puting the method in my controllers helper? how do you call a method that is in the helper using link_to_remote(''save'', :url => {:action => my_method}) any pointers would be great Thanks -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
Cayce Balara
2006-Nov-20 00:16 UTC
Re: How do i call a controller action and just return to my
James Smith wrote:> Could someone please tell me how i can call an action method in my > controller, but just complete the action and return to the current > template without reloading the current template? > > is it worth puting the method in my controllers helper? how do you call > a method that is in the helper using link_to_remote(''save'', :url => > {:action => my_method}) > > any pointers would be great > ThanksJames I think you can use link_to_remote and just have a blank rjs template. You''ll call an action with the link_to_remote. However, one of the gotchas of ajax is that there''s no feedback to the user that anything has happened when the call is successful. You might want to consider putting in a visual effect or some cue on the page (via that rjs template) to let the user know the action has occurred. c. -- 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?hl=en -~----------~----~----~----~------~----~------~--~---