Hi
how can i define a preselct value for the Select Tag?
<%= select(:bla, :bla_id, @blaa.collect {|c| [c.name, c.id]}, {
:selected => ‘2’ } ) %>
Where is the mistake?
greetings, chaos
Hi
how can i define a preselct value for the Select Tag?
<%= select(:bla, :bla_id, @blaa.collect {|c| [c.name, c.id]}, {
:selected => ‘2’ } ) %>
Where is the mistake?
greetings, chaos
On 13 Jul 2008, at 19:40, Andi G. wrote:
Hi
how can i define a preselct value for the Select Tag?
<%= select(:bla, :bla_id, @blaa.collect {|c| [c.name, c.id]}, {
:selected => ‘2’ } ) %>Where is the mistake?
:selected => 2
Fred
Andi G. wrote:
Hi
how can i define a preselct value for the Select Tag?
<%= select(:bla, :bla_id, @blaa.collect {|c| [c.name, c.id]}, {
:selected => ‘2’ } ) %>Where is the mistake?
greetings, chaos
have you tried putting the :selected value as an integer?
I imagine it needs to match the exact value of c.id to work.
<%= select(:bla, :bla_id, @blaa.collect {|c| [c.name, c.id]},
{:selected => 2 } ) %>
Frederick C. wrote:
On 13 Jul 2008, at 19:40, Andi G. wrote:
Hi
how can i define a preselct value for the Select Tag?
<%= select(:bla, :bla_id, @blaa.collect {|c| [c.name, c.id]}, {
:selected => ‘2’ } ) %>Where is the mistake?
:selected => 2
Fred
Yeah! This was my first post and i got so many responses, i am enthused!
I could swear i tried this, but integer was the right point!
Thanks a lot, cu next time!
greetings chaos
Frederick C. wrote:
:selected => 2
Fred
Dang…
should have answered quicker.
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