ruby on rails - Check Select year parameter -


i have select year wanna check if year matches:

<%= select_year(date.today, {start_year: 2015, end_year: date.today.year} %> 

the default name date[year] , wanna compare value in query like:

where("year(date) = ?", x) 

where x year, can't work. i'm passing controller like:

@result = model.function(params[:date][:year]) 

but keep getting "undefined method `[]' nil:nilclass" though see passing "parameters: {"utf8"=>"✓", "date"=>{"year"=>"2015"}}"


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -