Setting up CORS and Local Email in Ruby on Rails

Cross Origin Resource Sharing (CORS) is incredibly important, especially for sharing resources across multiple domains and servers. With the cors rack gem, Rails can easily handle CORS properly. In this episode we'll discuss it briefly.
Sending emails in staging and production is easy, just setup with your provider. But in development, we may not have access to providers, or even to the Internet, so it makes sense to send them locally. With the letteropener gem, we can do just that. NOTE: I forgot to show the setup in development.rb for letteropener, but it's available in Github.
⏱️ Timestamps: 00:00 - Introduction 00:24 - Setting up cors.rb file 02:22 - letter opener gem
💌 Newsletter: https://www.programmingtil.com/
🪐Elsewhere: Twitter: https://twitter.com/davidwparker Twitter: https://twitter.com/programmingtil GitHub: https://github.com/davidwparker
💭Concepts:
  • CORS
  • Email

📚Resources:
  • https://github.com/ryanb/letteropener
  • https://github.com/cyu/rack-cors

🎬 Subscribe! http://bit.ly/subdavidwparker
My name is David W Parker and I’m creating and publishing videos on ProgrammingTIL to help teach anyone and everyone who wants to code. I’m a huge fan of Ruby on Rails, Svelte, and WebGL. I’ve used React a lot in the past, as well as some Vue and AngularJS. I’ve done some professional Python and Django as well. I like to create real applications and my tutorials will walk you through how to build something real from beginning-to-end.

ruby #rails #rubyonrails #cors

© programmingtil.com