select

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

You can use :selected => value.

See http://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html#M001749