# Obtain selected value from collection\_select

**URL:** <https://www.ruby-forum.com/t/obtain-selected-value-from-collection-select/125931>\
**Category:** Rails\
**Created:** [January 13, 2008, 10:53pm UTC](https://www.ruby-forum.com/t/obtain-selected-value-from-collection-select/125931 "2008-01-13T22:53:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![abraham](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/6a8cbe/32.png) [@abraham](https://www.ruby-forum.com/u/abraham)\
**Post date:** [January 13, 2008, 10:53pm UTC](https://www.ruby-forum.com/t/obtain-selected-value-from-collection-select/125931/1 "2008-01-13T22:53:57Z")

</div>

Hi

Im trying to change the layout of a view depending on the value selected  
in a collection\_select box dynamically. Iow the value selected must be  
passed to the controller without any submit buttons beings pressed.  
Ultimately I wanna know how to obtain the selected value from  
collection\_select and refresh this value if the collection is  
changed…

Any help would be appreciated!! thx
