I am quite new to RoR and I am looking for a way of getting a route for a given controller, action & param.
Something similar to url_for() but without the domain and protocol.
Lets say I have :
params = {"controller"=>"controller", "action"=>"edit", "project_id"=>"1"}
I need to get :
route = "/controller/edit/1"
It would be best if I do not have to manually build the route and if I don't need to split the result of url_for().
Does RoR natively support such a feature? It's probably an easy question, but I couldn't find an answer.
This is the helper that will generate a path like you want:
You can use this Helper to generate the full path (including host) of the link:
Edit : More info available at http://guides.rubyonrails.org/routing.html#path-and-url-helpers
You should be able to use the following
This will produce an
<a>
with a link to your controller/action.