I strongly feel its a silly error and I'm somehow not able to see through it. I'm trying to use this piece of code in the view of my mailer.
<p><%= link_to 'here', unsubscribe_path(:email => "[email protected]") %></p>
And I've defined a named route in my routes file :
map.unsubscribe '/unsubscribe', :controller => :users, :action => :unsubscribe
So when I send my email this is the link I get:
http://b.comonly_pathtruecontrollerusersactionunsubscribe/
Any ideas ? Thanks !
EDIT
Here's the view:
<html>
<body>
<p>
Hi, <br />
You have an alert for : <%= @alert.name %>. <br />
Here is some brief information about it: <br />
<%= @alert.details %><br /><br />
<br />Thank You,<br />
</p>
<p>
Click <p><%= link_to 'here', unsubscribe_path(:email => "[email protected]") %></p> to unsubscribe</p>
</body>
</html>
And here's the mailer:
class Alert < ActionMailer::Base
def send(alert, email)
@subject = "hi"
@recipients = "[email protected]"
@from = "[email protected]"
@sent_on = Time.now
@content_type = "text/html"
@alert = alert
@email = email
end
end