Hi,
I have a dropdown menu which shows the categories available. When a user
selects one I want the browser to redirect to the selected category.
I now have this code I found on stackoverflow;

<%form_for :cat_form, :url => {:action => :viewflokkur_selected} do
|f|%>
    <%= f.select :cat, @cats_for_mt, {:include_blank => "Flokkar
mælitækis"}, :onchange =>
            'window.location.href = "viewflokkur/" +
this.getAttribute("value")'%>
<%end%>

However, "value" appears to be null everytime, so I get thrown to
http://localhost:3000/categories/viewflokkur/null. Is there something I
need to do for this to work, or should I be doing something else? I
don't really understand how to use observer_fields either, but that
seems to be something I should be looking into, is it not?

Best regards,
Sindri
-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to