How to accept hash parameters in routes


I have a link like

<%= link_to "link_name", :controller => "some_controller", :action =>
"some_action", :id => "some_id", :first_param => {:second_param => "some
value"} %>

and in my routes.rb

map.connect '/some_name/:id' :controller => "some_controller", :action
=> "some_action"

Above code is giving me a URL like


my requirement is to construct the URL as:


Please help me out.




You can use route globbing:

map.connect '/some_name/:id/*other', :controller => 'some_controller',
            :action => 'some_action'

—this will make the additional parameters accessible within your action via params[:other].

Need Your Help

Problem with Windows XP scheduler calling C# app requiring passing of variable

c# windows-xp scheduled-tasks

I have a app I need to run off a computer. It has to be scheduled. I am using Windows XP Professional and the app is in I have attempted to schedule the job, but I think my syntax...

CakePHP 2.0 - customize database error message

database cakephp error-handling cakephp-2.0

I have a CakePHP 2.0 application with a MySQL database. Two database tables are connected with a 1:n relation and a foreign key constraint.