Skip to content

Ruby on Rails

Ruby on Rails gives a web app a common structure for pages, requests and records. It can handle a form, check the submitted details and save them in a database.

Visit Ruby on Rails

What does Rails give you for a form that saves data?

Rails gives the form an address, code to handle what someone submits and a place to define the saved record. For a repair shop, that can connect an intake screen to a work order that a staff member can open later.

From the form to the saved work order
Part of the appWhat it does
Route and viewThe route tells Rails which code to run for an address. The view turns app data into a page people can read.
Controller and modelThe controller handles the request. The model describes the record and can check things such as whether its repair note is missing.
Active Record and database changesActive Record connects the app’s record to the database. A migration records a change to its structure, such as adding a field.

How can you check that one work order survives a refresh?

Use a blank local Rails project and a disposable database, or trace the exercise on paper. Before you start the app, confirm the setup has no live records, customer sign-in, payments or email. If you cannot tell, stay with the paper exercise.

Rails has a generator that gives you building blocks for signing in, including user and session records. Your app still needs to decide what each person can open or change.

  1. Set up the form and an empty list
    Give the work-order form two saved fields, a reference and a repair note. Add a Rails validation that requires the note. Apply the migration to the disposable database before submitting anything, then open the read-only list and check that it is empty.
  2. Try leaving out the note
    Enter an invented reference and leave the note blank. Submit the form. It should ask for the missing note and the read-only list should stay empty.
  3. Save a complete work order
    Submit an invented reference and a sample note. Show a confirmation only after the database saves them. Open the work order again through a read-only page, then refresh and check that the same reference and note are still there.
  4. Make the record private if your app needs that
    If you add staff access, first confirm the sign-in setup is test-only. With two dummy accounts, check that the right staff account can see the work order and an unauthorized one cannot.

Which version of Ruby can run your Rails project?

Check the Rails and Ruby versions in the project. The Rails 8.1.4.1 package accepts Ruby 3.2 or newer. Ruby 3.2 has reached upstream end of life, so use a maintained version that works with the project’s dependencies and host.

Rails and Ruby have separate support schedules. The Rails 8.0 series has reached the end of its official security support. If you inherit an older app, inspect both version lists and try upgrades in a copy with a disposable database first.

What do you need to keep a Rails app running after launch?

A live setup needs a host that runs Ruby and the Rails app, and a database that keeps records across restarts. A page that saves a work order needs the running app behind it.

What still needs a home
Part of the setupWhat to check
The running appThe host can run the Ruby version and the release you built. Rails documents a Docker-based deployment path with Kamal. You supply its host and other deployment services.
Database and uploaded filesIf you use SQLite or store files on the host, confirm the storage lasts across replacements and is included in recovery. When several app copies handle the same work orders, check that all of them can read and write to one durable database. If you use a separate database or file service, check its backup and restore setup.
Settings and account accessGive the test deployment its own private settings. Reopen one work order after a restart and check that the intended account can still read it.

Can you move the code and the saved work orders together?

Keep the editable project, dependency lock and Ruby version. Move saved records and uploaded files through the tools for the storage you chose. Keep private settings out of the source archive.

Rails is MIT-licensed. Your host, database and other services can charge separately. Restore one old work order into a private copy and confirm the old address, record and access still work. A code rollback by itself does not restore database records.