Ruwan Budha
2006-Aug-29 20:55 UTC
newbie:: When Item selected in a drop down selecting menu
Hi, How could I refresh a a page when selected and iteam from a drop down selecting menu? Please help. Thanks -- 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 -~----------~----~----~----~------~----~------~--~---
Ruwan Budha
2006-Aug-30 13:29 UTC
Re: newbie:: When Item selected in a drop down selecting men
Ruwan Budha wrote:> Hi, > > How could I refresh a a page when selected and iteam from a drop down > selecting menu? > > Please help. > > ThanksAny help pls? -- 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 -~----------~----~----~----~------~----~------~--~---
Hi what you could do is something like this <p> Drop down </p> <select name="drop_down" id="drop_down" onchange="<%= remote_function( :url => { :action => :refresh_page }, :with => "''drop_down_selection=''+this.value" ) %>"> <% @options_for_drop_down.each do |drop| %> <option value="<%= drop.id %>"> <%= drop.name %> </option> <% end %> </select> then either use an action in your controller to set stuff up and then render an rjs template or just render the rjs template directly with something like page.replace_html ''rest_of_page_container'', :partial => ''rest_of_page'' i.e. use ajax to refresh content. Also if you go down this route i suggest that you keep an eye on your logs and install firebug which is a javascript debbugging plugin for firefox. Don''t worry tho , you can do alot of ajax only using the rails helpers. This is how i do something similar although i''m very new to rails so i''m sure there are better ways. cheers c Ruwan Budha wrote:> Ruwan Budha wrote: >> Hi, >> >> How could I refresh a a page when selected and iteam from a drop down >> selecting menu? >> >> Please help. >> >> Thanks > > > > Any help pls?-- 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 -~----------~----~----~----~------~----~------~--~---