# Search dates by params

**URL:** <https://www.ruby-forum.com/t/search-dates-by-params/153905>\
**Category:** Rails\
**Created:** [November 22, 2008, 7:06pm UTC](https://www.ruby-forum.com/t/search-dates-by-params/153905 "2008-11-22T19:06:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lucy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e47774/32.png) [@lucy](https://www.ruby-forum.com/u/lucy)\
**Post date:** [November 22, 2008, 7:06pm UTC](https://www.ruby-forum.com/t/search-dates-by-params/153905/1 "2008-11-22T19:06:30Z")

</div>

Hi, all

Now I am doing “Hotel” website where users can select room and arrival  
and leave dates,  
and I can put into shopping cart.  
So I want to create a search form where users can select dates  
such like:

Checkin date  
\<%= date\_select 'checkin\_date', params[:checkin\_date] %\>

But it doesn’t wok…  
Could you tell me how to do it?  
Thank you!!!

---

<div class="post-metadata">

**Author:** ![lucy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e47774/32.png) [@lucy](https://www.ruby-forum.com/u/lucy)\
**Post date:** [November 22, 2008, 11:08pm UTC](https://www.ruby-forum.com/t/search-dates-by-params/153905/2 "2008-11-22T23:08:30Z")

</div>

Lucy wrote:

> But it doesn’t wok…  
> Could you tell me how to do it?  
> Thank you!!!

The first parameter to date\_select should be the ‘object’ or variable  
according to the framework documentation. The second is the attribute  
or member (probably checkin\_date in this case).

Norm
