RJS Trying to use Javascript variables

I’m having problem.
I have music CD, which can have many tracks.

When adding new CD, there are 5 empty track rows to write in, but there
is button MORE TRACKS, which adds more tracks where to write.

page.insert_html :bottom, ‘music_tracks’, :partial => “track_lines”,
:locals => { :id => @tracknr }
page << “tracknr++”


<%= select_minute 0, :field_name => 'minute'+id %>: <%= select_second 0, :field_name => 'second'+id %> <%= text_field 'track'+id, 'artist_name' %> <%= text_field 'track'+id, 'name' %>

I want to have javascript variable that has track count.
How can I retrieve javascript variable, I tried:
x) @tracknr
x) page << “tracknr”
and some more, but I can’t figure out…

Maybe there is better solution?


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs