index.rhtml is...
<%= javascript_include_tag :defaults %>
<%= collection_select(nil, :genre_id, @genres, :id, :name,
{:prompt => "Select a Genre"},
{:onchange =>"
alert(''sd'');"}) %>
<br/>
<div id="artists"><%= render :partial =>
''artists'', :object => @artists
%></div>
<div id="songs"><%= render :partial =>
''songs'', :object => @songs
%></div>
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
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---