When a user signs up for my site, they are redirected to '/welcome', which includes these links:
<%= link_to "Create Band Page", bands_user_path %>
<%= link_to "Complete Profile", edit_user_path(current_user) %>
The 'Complete Profile' link shows up and works fine. However, the page won't display with the 'Create Band Page' link, and results in this error:
No route matches {:action=>"bands", :controller=>"users"}
I have that link on the user's page and it works fine tho.
My users_controller includes this bit:
def bands
@band = current_user.bands.build
@bands = current_user.bands.all
@user = current_user
end
And the relevant routes.rb parts look like this:
resources :users do
member do
get :following, :followers, :bands
end
end
match '/welcome', to: 'static_pages#welcome'
As I said before, when I use the link on a user's show page it works fine, and rake routes includes the appropriate link:
bands_user GET /users/:id/bands(.:format) users#bands
What am I missing here?