I am having some problems with the new routing in Rails 3. What is the best way to prefix the path with a user name. Right now I have the following code:
resources :links, :path => '/:username' do
put 'star', :on => :member
end
But it leaves params empty.
EDIT:
I would like to have a urls like:
/:username/links
/:username/links/:id/star
And I would like to be able to fetch params[:username]
You can use
scopefor this, it’s much neater: