--Thanks.
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5085892d-7cd6-4a65-9b1e-1fc0221101d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi,
I have this simple function inside a js file:$('input:button').click(function() {$('#panel').removeClass('hidden');});When I render a partial with a button inside:<input type="button" value="Save">The click function inside js.file is not executed.I think it's because the js file is "included" in the main page, and inside the partial that js is not available.
--
On Wednesday, April 22, 2015 at 9:10:49 AM UTC-3, Walter Lee Davis wrote:Hi,I have a lot of javascript functions that can't be executed when I render a partial.I mean. There are functions that area described inside a js file and when a partial that calls some functions from that file is rendered, nothing occurs.How can I execute a javascript function when a partial is rendered ?Can you say a little more about how you are rendering these partials? Are you using remote: true to inject them into the page with JavaScript views, or are you rendering the whole page? If the latter, are you using Turbolinks? You may need to wrap your JavaScript in an event listener for the page:change event.Walter--Thanks.
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5085892d-7cd6-4a65-9b1e-1fc0221101d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/4161aa32-06a0-446d-ac21-567b3699322b%40googlegroups.com.