The number after “users” would be the user id, and the string after
“activate” would be the activation code. In the link above it would be
user id 45 and activation code 1jf872.
I have no problem sending the email. My problem is getting the route
(the url) recognized.
I have this in routes…
resources :users do
member do
get :activate
end
end
users_controller.rb
def activate @user = User.find(params[:id])
end
Which finds the user. But how can I make the query to find by both the
user id and the activation code?
like select users where users.id = 45 and activation_code = 1jf872
/var/lib/gems/1.8/gems/actionpack-3.0.9/lib/action_dispatch/routing/
mapper.rb:171:in default_controller_and_action': missing :action (ArgumentError) from /var/lib/gems/1.8/gems/actionpack-3.0.9/lib/action_dispatch/routing/ mapper.rb:72:innormalize_options!’
Try ‘activate/:activation_code’ instead – There wouldn’t be any map
to :activate (the symbol) since it doesn’t exist in your application.
Have a read through the routing guide, too, I may have something
wrong. Try using a match statement rather than get directly. I’m not
sure if this syntax is supported by get.
Walter
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.