im working on the code in this link…
PullMonkey Blog » Blog Archive » Dynamic Select Boxes – Ruby on Rails…
i cant able to dynamically select values in second and third dropdown
using onchange event … any suggestions pls…
im working on the code in this link…
PullMonkey Blog » Blog Archive » Dynamic Select Boxes – Ruby on Rails…
i cant able to dynamically select values in second and third dropdown
using onchange event … any suggestions pls…
index.rhtml is…
<%= javascript_include_tag :defaults %>
<%= collection_select(nil, :genre_id, @genres, :id, :name,
{:prompt => “Select a Genre”},
{:onchange =>" alert(‘sd’);"}) %>
controller is…
def update_artists
# updates artists and songs based on genre selected
@genre = Genre.find(params[:genre_id])
@artists = @genre.artists
@songs = @genre.songs
render :update do |page|
page.replace_html'artists', :partial => 'artists'
page.replace_html 'songs', :partial => 'songs', :object =>
songs
end
end
if i select values in first drop down i cant get corresponding values
for second as well as for third… pls help
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs