# Select\_tag question

**URL:** <https://www.ruby-forum.com/t/select-tag-question/141097>\
**Category:** Rails\
**Created:** [June 22, 2008, 12:41am UTC](https://www.ruby-forum.com/t/select-tag-question/141097 "2008-06-22T00:41:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![AJAJAJ](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/43a26b/32.png) [@AJAJAJ](https://www.ruby-forum.com/u/AJAJAJ)\
**Post date:** [June 22, 2008, 12:41am UTC](https://www.ruby-forum.com/t/select-tag-question/141097/1 "2008-06-22T00:41:36Z")

</div>

How can I use select\_tag to

1. Have a prompt like “Select a Value” ( selected by default )

I tried this but did not work:

\<%= select\_tag :current\_course,  
options\_for\_select( Course.find(:all).map {|p|  
[p.title,p.id]} ),  
{ :prompt =\> “Select a Value” }  
%\>

1. Generate a ‘selected’ event so that some action can be done like  
submit the form or refresh the page?

Thanks in advance

- AJ
