I call admin/2006 and routes.rb sends 2006 as param[:year] to admin/list
(controller/action). List then uses Day.find_by_year( params[:year] )
to find all Day records for that particular year. However, it is
passing find_by_year ‘2006’ instead of 2006 and sql is throwing an error
because it is getting,
WHERE (date >= ‘‘2006’-01-01’ AND date <= ‘‘2006’-12-31’)
instead of
WHERE (date >= ‘2006-01-01’ AND date <= ‘2006-12-31’)
.
How do I fix it so that the routing does not put ‘2006’ in
params[:year], but rather, just 2006?