In my application I have a namespaced admin section. Here’s a snippet from my routes.rb:
map.namespace :admin do |admin|
admin.resources :contents
end
map.resources :contents
Within my admin namespace, right now I am using the following:
link_to content, admin_content_path(content)
But I want to do:
link_to content, content
Which is currently equivalent to:
link_to content, content_path(content)
Is there a way to have all links within views belonging to a controller be prefixed with a namespace?
if i am reading you correctly, you can do
this should get you to admin_content_path(content). assuming of course the content is a valid variable (looks like you took this code from a block in an index scaffold view).
There is no prefix to apply to all restful links in a view, however. May i suggest just using the restful notation of admin_content_path(content) henceforth.