Here is my code,
can u check once,
<% @class.each do |f| %>
<% if f.role == "class_teacher" %>
<li>
<label><%= f.role.titleize %></label>
<%= select :name => "class[people]
[teacher]", :collection => @current_school.staff.find(:all), :selected
=> f.person_id.to_s, :value_method => :id, :text_method
=> :name, :prompt => "Select Faculty" %>
</li>
<% elsif f.role == "Athletic Director" %>
<li>
<label><%= f.role.titleize %></label>
<%= select :name => "class[people]
[teacher]", :collection => @current_school.staff.find(:all), :selected
=> f.person_id.to_s, :value_method => :id, :text_method
=> :name, :prompt => "Select Faculty" %>
</li>
<% else %>
<li>
<%= text_field :name => 'class[people][roles]
[]', :id =>'class_class_people', :value => "#{f.role}", :class =>
"short" %>
<%= select :name => "class[people][ids]
[]", :collection => @current_school.staff.find(:all), :selected =>
f.person_id.to_s, :value_method => :id, :text_method => :name, :prompt
=> "Select Faculty" %>
<%= link_to "Remove", url(:delete_classroom,
f, :label => "remove") %>
</li>
<% end %>
<% end %>
can u check once. plz
On Feb 13, 3:40 pm, Rupert Voelcker <[email protected]> wrote:
> 2009/2/13 cool <[email protected]>:
>
>
>
> > Guys,
>
> > i Have select tag from this article..
>
> >http://calamitylane.com/articles/programming/select-tag-funkyness-wit...
>
> > It's not working properly in Ruby 1.8.6(in production server) and its
> > not showing the selected value in that.
>
> > Its working fine Ruby 1.8.7(my local machine) and it is showing
> > selected value also…
>
> > can u help me guys….in this issue
>
> I'm using 1.8.6 and my select tags are working OK and they seem to
> follow the guidance in the article - here's one from my code:
>
> select :skipper_id, :collection => boat_booking.potential_skippers,
> :text_method => :full_name,
> :value_method => :id,
> :selected =>
> boat_booking.skipper_id.to_s
>
> I went through the same 'pain' as Eric in having to work out how to
> get this to work and arrived at the same answer so I can't see way it
> wouldn't be working for you. The best I can suggest is that you do
> what I did which is to put a debugger statement in your view just
> before the select and step through the merb code to see why it's not
> showing the selected value.
>
> Sorry I can't be of more help.
>
> Rupert
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"merb" 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/merb?hl=en
-~----------~----~----~----~------~----~------~--~---