Lesson Learn: Using Action Mailer

0 Shares
0
0
0

In the past couple days, I have been trying to deploy a site that involves using Action Mailer which allow you to send automatic email notifications to users who click on your page (in areas such as “register”, etc).  

I have been following the Rails Guides for it but I couldn’t seem to make it work and after fighting with my code I was finally able to fix a bug and make it work and here are my notes (cheatsheet) for anyone who may find to be stuck trying to follow the rails guide or other tutorials:

What was the problem?

After the user was clicking, I was able to send an automatic email so the mailer main goal was done but I wasn’t able to send them to the next page and instead I was getting the following error:

How did I fix this?

Well, seems like the exact layout of the code has changed a bit through different rails version and with the rails 3.2 we need to include a respond_to do |format|  …end code in which we will place the Mailer code(code provided by the Rails Guide).  Therefore, the fix code should be the following in the user controller file:

Lesson Learn:  Watch out for new changes depending on the version so whatever the rails guide or other trust worthy materials say may not work because of it.  

0 Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like
Designing Personal Website In my process to get a full time job as a web developer, there was…
Read More
CSS Transparency – CheatSheet For Dark Transparency: background-color: rgba(25,0,0,0.5)
Read More
RESTful routes Here is a good  cheatsheet to take for anyone who is a beginner and its trying…
Read More