Saturday, January 28, 2017

This Week in Rails: Mailer preprocessing and new ERB handler

Posted by kaspth

Steampunk! It’s all the rage with the kids these days.

Honestly, I was going to work this better into the lead but then I ran out of… ssssstea… 🤓

Anyway friendo! Here’s what Kasper dug up from this week in Rails.

This Week’s Rails Contributors

This week we got 33 committers: welcome or hello again! Either way, you all seem to be on the right track 😉

Action Mailer Preprocessing

Incoming! Mailers can now use params allowing for easier preprocessing with before_action akin to Action Controller. To enable call mailers like this: InvitationMailer.with(invitee: person).account_invitation.deliver_later

See the pull request for a considerable A/B example.

Rails uses Erubi for ERB handling

For many years Rails has used Erubis to handle ERB templates, but it’s been deprecated in favor of Erubi. Being 1/6 shorter to type is far from the only thing Erubi has going for it, so dip into the pull request for the full list 😄

One more thing

Steampunk! It’s hip, it’s wholesome and for the whole family.

Wrapping up

That’s it from This Week in Rails! There were many other great contributions, too numerous to list here, but feel free to check them out!

See ya!