On Dec 5, 2011, at 4:55 PM, Craig White wrote:

>  $('tr:nth-child(odd)').addClass('odd');


What happens when you just run  $('tr:nth-child(odd)').addClass('odd'); on the 
web console? Does it correctly select the elements you are looking for ?


> and I get the error - 
> word is not defined
>  (in /home/users/cwhite/tti_framework/app/assets/javascripts/people.js.coffee)



"word is not defined" is a little vague, do you think that's happening in 
jQuery, coffeescript, or your code? (these are rhetorical questions to point 
you in the right direction).  Also, is that a Rails exception (I'd assume not) 
or a Javascript error you see in the console (or an error during coffeescript's 
compile?)


> 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.



So... it's a little hard to follow you're debugging steps, are you saying that 
the code you are executing is actually working to add the class to the selected 
elements?

If that's the case, remove your code altogether and see if the problems is 
still happening. If it is, you have a different problem unrelated to the 
$('tr:nth-child(odd)') selector

-- 
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