Custom method in restful design

Hi all,

I want to make a custom method in my restful users controller. The
method ‘activate’, activates and finalizes the signup proces of a
user.

The method should get the id and the activation code of the user
(provided via the link in the mail) and see if it matches. the user
should be send to the activation view.

Can someone tell me how I make this custom method? I defined the
activate method in the controller and have added something like
map.resources :users, :member => { :activate => :get}
to my routes

I really don’t know wether I should take the get, post or put (and
what they actually mean).

maybe someone can clarify this?

many thanks
Stijn

In your routes.db, put something like this:

map.resources :projects do |projects|
projects.resources :chat_messages, :collection => { :show_recent
=> :get}
end

You can call your function using:

show_recent_project_chat_messages_path(@project)

… it’s beautiful :slight_smile:

Martijn