I’m attempting to provide a confirmation link in my user welcome email and I’m getting the following Rails error:
Need controller and action!
It makes a fuss about this line:
<p>Please take a moment to activate your account by going to:
<%= link_to confirm_user_url(:id => @user.confirmation_code) %>.</p>
In my development.rb environment, I have the following line:
config.action_mailer.default_url_options = {
:host => "localhost", :port => 3000
}
There’s no problem with the @user variable. I’ve tested the email with things like @user.username and @user.confirmation_code. I’m only getting trouble with url_for and named routes like confirm_user_url.
When I check my routes with rake routes, confirm_user shows up, so it’s not an issue with the named route not existing.
I can’t seem to figure it out. What gives?
Since having a clickable url is what you said in your where after in your comment, here you go macek
I’ve used the
auto_linkhelper in some of my mailers to make urls clickable and it has worked out pretty well. I think that does email addresses also, check out the full api for all the options. Enjoy.