Am 28.04.2010 um 20:55 schrieb Guido Pesch:

Hallo Guido...

Ist mir ja nicht ganz klar warum du das highlighten willst..
Denke das ist ein Suchformular wo man nach bestimmten Komponenten sucht und 
dann entweder Ergebnisse bekommt oder nicht. Oder sehe ich das verkehrt?

Evt . wäre dann eine Lösung die gewählte Option in einer session zu speichern 
und abzufragen..?


Gruß


> Hallo Liste,
>  
> Habe dieses Form hier.
> Wie bekomme ich Rails dazu, das das ausgewählte Element (bei mir component) 
> nach dem Commit als selected markiert ist.
> Geht das mit collection_select überhaut?
> Muss man vielleicht einen anderen Helper nutzen?
>  
> <% form_tag search_products_path do %>
>  
>   <p>
>     <%= collection_select(:component, :nr1, Component.all, :nr, :nr, options 
> ={:prompt => "-Select a component"})%><br/>
>     <%= collection_select(:component, :nr2, Component.all, :nr, :nr, options 
> ={:prompt => "-Select a component"})%><br/>
>     <%= submit_tag "Suchen", :name => nil %>
>   </p>
> <% end %>
> Danke und Gruß
> Guido
>  
> _______________________________________________
> rubyonrails-ug mailing list
> rubyonrails-ug@headflash.com
> http://mailman.headflash.com/listinfo/rubyonrails-ug

Werner Laude
newsgr...@wernerlaude.de



_______________________________________________
rubyonrails-ug mailing list
rubyonrails-ug@headflash.com
http://mailman.headflash.com/listinfo/rubyonrails-ug

Antwort per Email an