Coursera Rails Module 3 Notes
I just finished the final module of this course. Overall I think it was a great course that provided a good overview of Ruby, and a thorough introduction to Rails. The next course dives into working with Databases and I am looking forward to learning more about Active Record.
Some Interesting Facts
- Rails has only been around since 2004.
- Startups love Rails since it makes it easy to do rapid prototyping.
- MVC has been around since 1979
Useful Resources
The lectures had a bunch of useful tools sprinkled throughout.- Learned about the Programmable Web API directory.
- Discovered the JSONView Browser Plugin which makes looking at JSON output in the web browser really nice.
Things I love about Rails
- Convention over Configuration. I love this, I love best practices, and I love having some guidelines to follow. Think less, do more.
- ORM makes it easy to swap out your DB as times goes on. Start dev in SQLite and should be able to seamlessly transition to MySQL, PostgreSQL, etc.
- Rake = Ruby Make, comes with a ton of useful built in utilities. For instance if you want to see all of the routes that your application is aware of you can run
rake routes
. - Helpers (or view helpers) are reusable macros that can be used across any of your views. This is much cleaner approach than themacros that I am used to working with in Flask. There are at on of useful helpers built into rails, like "cycle" which makes it super easy to make striped HTML tables.
Things I learned
General Rails Tooling
- Finally have a solid understanding of how Gems, Bundler, and Rbenv work together.
- Learned about and used the HTTParty Gem
- You can use a Pessimistic Version Constraint (Love the name) in your Gemfile which basically says do not go over a certain version. Essentially you are betting against the house and saying that you believe that an update to one of your gems is going to break everything sometime in the future. (Trust me this happens all of the time).
Testing with Rspec and Capybara
Once again, I cannot say how happy I am that this course dives right into all sorts of testing. Kudos to the JHU team for thinking about this important skill even in an introductory course. This module talked about doing acceptance testing with Capybara. We learned about:- Capybara - Acceptance Test Framework
- PhantomJS - Headless Browser
- Selenium - Browser Driver for Firefox/Chrome
- Poltergeist - PhantomJS Driver for Capybara
Debugging
The built in debugging tools in development mode in rails are just awesome. You get an IRB console inside of the browser, this is super useful for debugging purposes. The gems that are responsible for this functionality are byebug and web-console.Deploying To Heroku
The course walked us through how to deploy an app to Heroku. Super simple of course. It is really nice to be able to see your application out in the wild!Pro Tip
The rails generator makes it super easy to create all of the files that you may need for a controller or model. However if you accidentally create a model with the wrong name and your project it huge it can be somewhat daunting to figure out what is safe to remove. You can reverse a rails generated command with:rails d $TYPE $NAME
rails g model recipeee
rails d model recipeee
Final Project
The final project is a simple web application called Recipe Finder that allows you to search for recipes using the food2fork api. I cleaned it up a bit and added an actual search bar (the assignment just had you add query params).Thank you for reading! Share your thoughts with me on bluesky, mastodon, or via email.
Check out some more stuff to read down below.
Most popular posts this month
- Everything wrong with developer tools in a single paragraph
- SQLite DB Migrations with PRAGMA user_version
- Urge to Edit Old Posts
- Setting up ANTLR4 on Windows
- Reinstalling Windows at 1am
Recent Favorite Blog Posts
This is a collection of the last 8 posts that I bookmarked.
- 21st Century C++ from Communications of the ACM
- Submarines DevCon 2025 Keynote Speech from JoshHaines.com
- How I Use AI: Meet My Promptly Hired Model Intern from Armin Ronacher's Thoughts and Writings
- DeepSeek from Maggie Appleton
- Digital Reality Digital Shock from Christopher Butler
- 10 habits to help becoming a Debian Maintainer from Optimized by Otto
- Tiny corners from Manuel Moreale RSS Feed
- Build It Yourself from Armin Ronacher's Thoughts and Writings
Articles from blogs I follow around the net
“Stop calling it work” – Cedric Raguenaud
Cedric Raguenaud argues that.. “When we label our photographic pursuits as “work,” we unconsciously impose constraints and expectations that belong in the professional world. Suddenly, we feel pressured to maintain visibility, chase originality, and demon…
via Colin Devroe February 10, 2025The Art of Making Websites
Hidde de Vries gave a great talked titled “Creativity cannot be computed” (you can checkout the slides or watch the video). In his slides he has lots of bullet points that attempt to define what art is, and then in the talk he spends time covering each one…
via Jim Nielsen’s Blog February 10, 2025Corporate “DEI” is an imperfect vehicle for deeply meaningful ideals
I have not thought or said much about DEI (Diversity, Equity and Inclusion) over the years. Not because I don’t care about the espoused ideals — I suppose I do, rather a lot — but because corporate DEI efforts have always struck me as ineffective and blan…
via charity.wtf February 10, 2025Generated by openring