Seledted option for select_tag

Hi iam using select_tag i want selected_option. i have made select
_tag like this

<%=select_tag(‘name’, options_for_select({ :Relevance
=>‘Relevant’,:Date=>‘Recent’}),:selected=>params[:name].to_s) %>

The generated html look like this

Date

Relevance

How to make the selected option inside option tag

On 2 Sep 2008, at 09:36, Lost W. wrote:

value=“Recent”>Date

Relevance

How to make the selected option inside option tag

Well since selectedness is a property of an option not the select tag
as a whole it makes sense for it to be an argument to
options_for_select. Check the api for options_for_select

Fred/