Take the 2-minute tour ×

In my UserController I have:

def join

I have a join.html.erb in my /views/user/ folder.

My routes has a :

resources :user

When I go to:


I get:

The action 'show' could not be found for UserController

share|improve this question
add comment

3 Answers

up vote 2 down vote accepted

You're using resources, but have a non-REST action, so you need to add the join action to the route with the appropriate HTTP verb:

map.resources :users, :member => { :join => :get }
share|improve this answer
add comment

Re: why isn't the join action found?

To answer your specific question, what's happening is that you want to have an action "join" for your User model.

Your problem is that you haven't defined a route matching the url http://localhost:3000/user/join

The line resources :user in your routes file only defines routes for the seven standard rest verbs/actions:


See: http://apidock.com/rails/ActionController/Resources/resources

Added: to fix, you'll need to add an explicit or generic route. Routing docs

Added: Re: why am I seeing the error message re show? To be ultra-precise, the route selector "GET /usr/:id" (created by your resource call) is being used to select the SHOW action for the User resource. The :id value is being set to "join". Since you don't have a Show method defined in your controller, that's the error that you're seeing.

share|improve this answer
The generic route Larry mentions would look like this: resources :user do member do get 'join' end end –  Jeremy Oct 24 '10 at 23:05
add comment


def show

in your UserController.

To be certain:


def join



resources :users
share|improve this answer
but /user/join I want to use the 'join' action in the usercontroller, not the 'show' action. –  Blankman Oct 24 '10 at 22:11
I'm just suggesting that you fix the error you're getting first. Maybe your answer will be more visible once you do. –  tinifni Oct 24 '10 at 22:14
Sorry if my answer is lacking. I'm still new to RoR. I'm just offering what little I know to try and help out. Hope you find your answer! –  tinifni Oct 24 '10 at 22:27
add comment

Your Answer


