ruby on rails - assign params value to text field tag -


how can assign params value(date params) text_field_tag search form

in form tag has text_field_tag follows:

<%= text_field_tag 'date_from', date.today.prev_month.at_beginning_of_month, :size => 10, :id => 'dis_date_from' %><%= calendar_for('dis_date_from') %> 

i have assigned default value tag

how possibly assign params value text_field_tag if value(date) not nil in params.

thanks in advance.

try

<%= text_field_tag 'date_from', params['date_form'] || date.today.prev_month.at_beginning_of_month, :size => 10, :id => 'dis_date_from' %><%= calendar_for('dis_date_from') %> 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -