Hello I have a controller which executes a "render :partial" to actualise part of my web page (a <DIV> object). When I do that I would like to call a javascript function to complete my process. How can I do that? Anyone could help me? Thanks Regards -- 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 -~----------~----~----~----~------~----~------~--~---
Hello Paulo, I''m new to RoR, but it seems to me that remote_function() from ActionView::Helpers::PrototypeHelper will help you. http://rails.rubyonrails.com/classes/ActionView/Helpers/PrototypeHelper.html#M000540 -- 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 -~----------~----~----~----~------~----~------~--~---
On 10/16/07, Paulo Carvalho <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hello > > I have a controller which executes a "render :partial" to actualise part > of my web page (a <DIV> object). When I do that I would like to call a > javascript function to complete my process. > How can I do that?Well, if you want to insert some javascript in your partial, you can write out a <script>...</script> tag, or (better), use the javascript_tag() helper: <%= javascript_tag "some_js_func();" %> That will insert a <script> tag to call the function. Is that what you want, or are you looking for something else? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---