Pass hash prameters in routes

1 view
Skip to first unread message

Saurabh Peshkar

unread,
Jul 23, 2010, 11:17:26 PM7/23/10
to rubyonra...@googlegroups.com
Hi All,

Query:

I am having a link as

<%= 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 an url as

http://localhost:3000/some_name/some_id

my requirement is to construct the url as:

http://localhost:3000/some_name/some_id/<the value inside
params[:first_param][:second_params]>

Please help me out.

Thanks,

Saurabh
--
Posted via http://www.ruby-forum.com/.

Reply all
Reply to author
Forward
0 new messages