You can use :selected => value.
See
http://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html#M001749
On 25 Jun., 09:42, Sijo Kg
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> Hi
> I have a select as below.This select is replaced to a div when I
> call observer_field update
> <%= select( "sd_ticket",
"service_desk_sub_category_id",
> ServiceDeskSubCategory.find(:all, :conditions =>
> ["service_desk_category_id =?", @category_id] ).collect {|p| [
p.name,
> p.id ] }) %>
>
> Here in above code how can I forcefully set the html option
> selected..For example say select last record as selected
>
> Thanks in advance
> Sijo
> --
> Posted viahttp://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@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---