...or an explanation for anything here, tailored to what you already know. Just ask. πŸ“„ Rails Guide: Action Mailer Basics β€” mailers, views, delivery methods, previews and interceptors πŸ“„ Action Mailer previews β€” our...

πŸ“˜ Chapter "Task H1: Sending Confirmation Emails" from Agile Web Development with Rails 8 (in our library β€” check which edition we have) πŸ“„ Valid recipients: Using the Truemail gem to validate...

Rails is our web framework. In this lesson you build your first two Rails applications: a small store by following the official guide, and the beginning of MovieDB, the app...

Work on this lesson in teacher mode. Learning goals You can explain the Rails request cycle β€” routing, controller, model, view, response β€” and follow a request through the files of...

makandra Curriculum

...or an explanation for anything here, tailored to what you already know. Just ask. πŸ“„ Rails Guide: Active Record Migrations β€” the reference; read it fully once πŸ“„ How to use models in...

...use application models in migrations (archived blog post) πŸ“„ How to write complex migrations in Rails β€” our card πŸ“„ Rails Guide: Active Record Callbacks β€” for keeping the cached columns of the exercise...

While working on a Rails application, your code base will grow a collection of different file types including: Ruby (business logic) HTML fragments (layouts and views) CSS/Sass/SCSS (styles) JavaScript (client...

...files which are often summed up as assets. You might already have noticed that Rails modifies those assets before delivering them to the client. For example, you'll never see...

...web application remembers a user between requests. This lesson covers how cookies work, how Rails sessions build on them, and what signed, encrypted and SameSite cookies protect against. Important

...lifetime and scope (expiry, domain, path, Secure, HttpOnly, SameSite). You can explain how a Rails session builds on cookies, and why a "session cookie" is something else. You can explain...

Rails ships with a default menu of libraries and conventions β€” its creators call it "Omakase", the chef's choice. Like many companies, we don't follow that menu blindly. Over...

...we differ and why, so you won't be confused when a tutorial, a Rails guide or a freshly generated app looks different from our projects. Important

Why and what to test πŸ“˜ Chapter "The value of tests" from Growing Rails Applications in Practice (in our library) πŸ“„ Write tests. Not too many. Mostly integration. β€” the reasoning...

...strategy that fits β€” the different test-suite shapes side by side πŸ“„ Guidelines for Testing Rails Applications β€” the same discussion for a Rails/RSpec suite RSpec and Capybara πŸ“˜ Everyday Rails Testing with...

...together with its child records, like a movie with its showtimes. This lesson covers Rails' nested attributes and how to build and test such forms. Important Work on this lesson...

...records in a single transaction β€” all of it or nothing. You can explain how Rails form helpers name nested inputs and how those names turn into the nested structure of...

makandra Curriculum

Validations keep invalid data out of your database. This lesson covers Rails' built-in validations, how to test them, and how to show helpful error messages in your forms.

...Work on this lesson in teacher mode. Learning goals You can validate records with Rails' built-in validations and know where to look up the rest. You can explain when...

...you ask for it (and_call_original). You can explain which spec types rspec-rails offers besides model and feature specs, and write a request spec or a helper spec...

...render_template() matcher that helps with test above. To get this matcher, add a gem rails-controller-testing. Tip If you place your spec file in spec/requests you don't...

...This lesson covers the most common attacks like XSS, CSRF and SQL injection, how Rails protects you, and where you still need to be careful. Important Work on this lesson...

...building a file path from user input), session hijacking. You know which of these Rails prevents by default and where you still have to do the right thing yourself, e.g...

Rails' I18n API keeps user-facing strings, formats and error messages in locale files. This lesson covers how to use it, why it is useful even for single-language apps...

...for view-scoped keys like t('.title') πŸ“„ Guide to localizing a Rails application β€” our card πŸ“„ rails-i18n β€” Rails' standard translations per language; we copy and customize the locale files

...how the database executes a query (e.g. with EXPLAIN ANALYZE). You can read a Rails schema file and recognize ActiveRecord's naming conventions for tables and keys.

...minute live demo πŸ“„ Differences between transactions and locking β€” clears up a common misunderstanding Rails and reference πŸ“„ Rails Guides: Active Record Basics β€” Convention over Configuration β€” naming conventions for tables and columns...

...say what you're trying to do. "What options does validates take in our Rails version?" gets a better answer than "how do validations work?". Most answers are right. When...

...Run an experiment. "Try it in the app and show me the result." A rails runner one-liner, a console session or a throwaway spec settles most questions in seconds...

...Ruby projects. These projects use a large number of different versions for Ruby, Rails and many gems. To be able to switch between projects easily, we must control every dependency...

...can explain that a gem may bring executables of its own, like rspec or rails, in addition to library code. You can explain what bundle exec does and when it...

...travels from the browser to the server (a multipart form post) and where a Rails app can store it. You can treat an uploaded file like any other model attribute...

...the happy path, unit tests for versions and validations. You can explain how ActiveStorage, Rails' built-in alternative, differs from CarrierWave and why we default to CarrierWave. Resources

Every test needs data. Instead of Rails' global fixtures we use factories that create only the records a test needs, which keeps tests isolated and predictable. Important

...why test order must never change a result. Learn Factories, not fixtures By default Rails uses global fixtures for its tests. This is a giant world of example data that...

...becomes complex ▢️ All the Little Things β€” Sandi Metz refactors the Gilded Rose kata live (RailsConf 2014); watch after your own attempt πŸ“„ Gilded Rose kata β€” our Ruby version with a test...

...chapters 2 "Meaningful Names", 3 "Functions", 4 "Comments" and 17 "Smells and Heuristics" πŸ“˜ Growing Rails Applications in Practice β€” chapters 5 "Dealing with fat models" and 7 "Extracting service objects"

πŸ“„ Best practices for writing code comments Video ▢️ All the Little Things β€” Sandi Metz, RailsConf 2014, 40 min: refactoring a nested conditional into small objects, live Discuss with your mentor...

...the values a user may pick, and validate it πŸ“„ Solving bizarre authorization requirements with Rails β€” slides of our talk on modelling authorization with scopes and powers ▢️ Autorisierung mit RBAC, ABAC...

...what "homegrown crypto" risks. You can add sign-up, login and logout to a Rails app with our default library (Clearance), adapt its views to the app, and deny access...

...or an explanation for anything here, tailored to what you already know. Just ask. πŸ“„ Rails Authentication from Scratch β€” Steve Polito; read it to understand the mechanics, don't write the...

Rake tasks automate recurring jobs in a Rails app, from database maintenance to custom scripts. This lesson covers how tasks are defined, how they depend on each other, and how...

...is rake good for? Take a look at some of the Rake tasks that Rails gives you (rake -T within a Rails project) Find the code that defines the rake...

...to understand what middlewares in Rack are good for. Rack Start with these articles: Rails on Rack Introduction to Rack Middleware Short Screencast to a sample Middleware

...answer the following questions: What is Rack? How does Rack relate to Ruby on Rails? What is Rack middleware? What are some advantages of implementing functionality as a middleware as...

...card teaches the React basics you need for that β€” components, state, effects, talking to Rails β€” and how to mount an island from an Unpoly compiler. It is not about building...

...you can explain why effects need cleanup. You can let an island talk to Rails through a small JSON API, both reading and writing. You can mount and unmount a...