Accepted answer

not exactly sure what you're trying to do, but it appears like you just need to change this

this.category == <%= @show_me %>;

to this

this.category = "<%= @show_me %>";

although you should be aware that anything with the <%= %> tags is prerendered before the page is loaded.


looks like what you're trying to do might involve some ajax. you might consider looking through this tutorial since this is a semi-complicated topic, and can be confusing if you have no experience with it.

Related Query

More Query from same tag