resources
keyword in rails routes is a magical keyword that creates 7 restful routes by default
edit
is one of those
check these docs link http://guides.rubyonrails.org/routing.html#crud-verbs-and-actions
edit expects to edit a record so requires a id to find the record for editing
in your case
you can just add a custom action in users controller
like
in UsersController
def accept_invitation
@user = User.find_by_email_activation_token!(params[:token])
@user.email_activation_token = true
redirect_to root_url, :notice => "Email has been verified."
end
in routes.rb
resources :users do
collection do
get :accept_invitation
end
end
in app/views/user_mailer/registration_confirmation.html.haml
accept_invitation_users_url({:token=>@user.email_activation_token})
Check out how to add custom routes here http://guides.rubyonrails.org/routing.html#adding-more-restful-actions