passing get parameters through named route and then to controller model; stringify_keys!
- by user368937
Hey, I'm just learning ruby on rails and I've been stumped on this for awhile now.
Here's my url request:
http://192.168.2.20:8080/Location/new/123.123,-123.123/
Here's my routes.rb:
map.connect '/Location/new/:coords/', :controller => 'Location', :action => 'new', :coords => /\d+.\d+,-\d+.\d+/
map.connect '/Location/list/', :controller => 'Location', :action => 'list'
map.connect '/Location/create/', :controller => 'Location', :action => 'create'
Here's my location_controller.rb
def new
@coords = Location.new(params[:coords])
end
Here's the error message it gives me:
NoMethodError in LocationController#new
undefined method `stringify_keys!' for "123.123,-123.123":String