When I was just starting to learn Ruby on Rails, I had trouble setting up multiple associations with the same model due to my lack of understanding and reliance on Rail’s “magical” generators. Here I’ll show you how to implement it and analyze how it happens. On this example there are two models, User and TransferRequest. TransferRequest has attributes sender and receiver which are instances of User.Feb 23, 2018
This article is a compilation of what every developer learning AWS should do with their new account. I’ll demonstrate how to secure the root account by locking away the root user and applying all the best practices recommended by Amazon Web Services. I’ll also demonstrate how to install and configure the AWS Command Line Interface for development.May 30, 2017
Rails by default uses a numeric id as a parameter for its URL. Sometimes when building a website such as this blog, instead of emmanuelcorrales.com/blog/4 we want the url to be more SEO and user friendly like emmanuelcorrales.com/blog/seo-and-user-friendly-urls-for-rails-with-friendlyid. We can achieve this by using the FriendlyID gem. In this tutorial I'll show you how to use FriendlyID.Jan 9, 2017
While searching for ways to upload images to Amazon S3 on Rails, I stumbled upon two gems that simplifies this task, Paperclip and Carrierwave. I tried Paperclip first and made an article about it here. A senior colleague of mine recommended Carrierwave, so I tried to give it a shot and it was worth it. It is much cleaner to implement because it requires the user to create a helper class for uploading. The model just needs to mount the helper class. This separates the code for uploading unlike on Paperclip where the code for uploading is included in the model and requires the user to create a migration.