undefined method `protect_against_forgery?' for #<#<Class:0x0

Sorry, I do not know your purpose, but apparently you have a purpose to activate user. Try this, if this solution not work, please tell me your action (activate_email) on controller!

see on rake routes output :

activate_email_users PUT /users/activate_email(.:format) users#activate_email user GET /users/:id(.:format) users#show

when your generate

http://localhost:3000/users/activate_email?email_token=WWNvMN-r_lXgovrQiDlSSQ

Your problem was activate_email considered to be :id

users/activate_email => users/:id

And solution for your problem :

Try removing the method from the link. Its better specifying the method in your routes file. How about replacing match by put in routes as :

resources :users  do
  member do
    get :following,:followers
  end
end
put "/users/activate_email/:email_token" => "users#activate_email", :as => "activate"

and on view

<%= link_to "Activate", activate_path(:email_token => @user.email_token)  %>

I have not tested this, but I guess this will suffice.

UPDATE

for Question : undefined method `protect_against_forgery?'

Add this to a helper that only your mailer template uses:

 def protect_against_forgery?
      false
 end

NOTE : If You have new question, please create new "Ask Question" and aprrove answer is usefull for this question