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
Post a Comment