Ruby on Rails Tuesday, December 1, 2015

On 30 November 2015 at 23:58, fugee ohu <fugee279@gmail.com> wrote:
> this snippet which follows another code block under
> $(document).ready(function () { isn't working, the previous block works,
> but not this one
>
> $('#listing_free_shipping').change(function(e)
> {
> if (e.listing_free_shipping.attr('checked'))
> {
> $("#listing_shipping_cost").toggle( "blind" );
> }
> else
> {
> $("#listing_shipping_cost").show();
> }
> })

Just a couple of notes. The likely reason you have not had any offers
of help with these questions is that it is absolutely nothing to do
with Ruby or Rails, except for the fact that if you are finding that
document ready works sometimes but not others then this is likely due
to the fact that document ready is not compatible with turbolinks (if
you are using that). Google will explain what to do about it.

The other point I would make is that javascript should not normally be
included in the page, it should be in separate assets files.

Colin

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtbHmut4Nd7yhKwJ7w1uL2Rh-h8qnZk%2BPjw03vzk_gMFg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment