On Dec 5, 9:55 pm, Craig White <[email protected]> wrote:
> Just starting out with a beginner book on jquery and the very first thing I 
> am trying fails (has to be me)
>
> Rails 3.1 - other jquery things working including a poor example of drag & 
> drop that is my ultimate target here but just simply trying to get every 
> alternating row in a table to have a different css class
>
> So I'm using...
>
> app/assets/javascripts/people.js.coffee and put in...
>
> $(document).ready(function() {
>   $('tr:nth-child(odd)').addClass('odd');
>
> });

A .coffees file should contain coffeescript, whereas  you appear to
have put javascript in your people.js.coffee

Fred
>
> and I get the error -
> word is not defined
>   (in 
> /home/users/cwhite/tti_framework/app/assets/javascripts/people.js.coffee)
>
> So I tried variations including
> $(document).ready(function() {
>   $('tr:odd').addClass('odd');
>
> });
>
> but still the same problem and my css does indeed have tr.odd defined and 
> works fine if I do odd_even in the view code which I removed for the benefit 
> of this test.
>
> --
> Craig White ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [email protected]
> 1.800.869.6908 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~www.ttiassessments.com
>
> Need help communicating between generations at work to achieve your desired 
> success? Let us help!

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to