Rails is a web-application framework that includes everything needed to
create database-backed web applications according to the
Understanding the MVC pattern is key to understanding Rails. MVC divides your application into three layers, each with a specific responsibility.
The Model layer represents your domain model (such as Account, Product, Person, Post, etc.) and encapsulates the business logic that is specific to your application. In Rails, database-backed model classes are derived from ActiveRecord::Base. Active Record allows you to present the data from database rows as objects and embellish these data objects with business logic methods. You can read more about Active Record in its README. Although most Rails models are backed by a database, models can also be ordinary Ruby classes, or Ruby classes that implement a set of interfaces as provided by the Active Model module. You can read more about Active Model in its README.
The Controller layer is responsible for handling incoming HTTP requests and providing a suitable response. Usually this means returning HTML, but Rails controllers can also generate XML, JSON, PDFs, mobile-specific views, and more. Controllers load and manipulate models, and render view templates in order to generate the appropriate HTTP response. In Rails, incoming requests are routed by Action Dispatch to an appropriate controller, and controller classes are derived from ActionController::Base. Action Dispatch and Action Controller are bundled together in Action Pack. You can read more about Action Pack in its README.
The View layer is composed of "templates" that are responsible for providing appropriate representations of your application's resources. Templates can come in a variety of formats, but most view templates are HTML with embedded Ruby code (ERB files). Views are typically rendered to generate a controller response, or to generate the body of an email. In Rails, View generation is handled by Action View. You can read more about Action View in its README.
Ruby on Rails alternatives and related gems
Based on the "Web Frameworks" category
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of Ruby on Rails or a related project?
Ruby on Rails RecommendationsThere are no recommendations yet. Be the first to promote Ruby on Rails!
Have you used Ruby on Rails? Share your experience. Write a short recommendation and Ruby on Rails, you and your project will be promoted on Awesome Ruby.
Recommend Ruby on Rails
Recently added Ruby on Rails resources
Write sandboxed rake tasks that rolls back any changes you made to the database upon exit.Article Added by manojmj92 // medium.com // about 1 month ago
After using Heroku for years, I wanted to give AWS Elastic Beanstalk a try. My experience during deployment was less-than-stellar, so I wrote a tutorial on deploying a Rails 5.2 / PostgreSQL app on AWS Elastic Beanstalk to help others who might be in the same situation I was.Tutorial Added by evrimfeyyaz // evrim.io // about 2 months ago
How many times have you, while investigating an (admittedly rare ;)) production bug, stumbled upon an exception backtrace that just doesn't have enough information? For example, an exception gets reraised, destroying the original backtrace with it. So now your logs say that your AI failed to take over the world with AIEpicFailError (great, you already know that), but not why (Timeout::Error while connecting to stackoverflow.com).Article Added by Kasia66 // blog.cloud66.com // about 2 months ago
This is an article showing how developers can bring their testing and documentation infrastructure to the next levelArticle Added by Blackening999 // startupcraft.io // about 2 months ago
Detecting outdated browser in one way on both Ruby-backend and Node.js-frontendArticle Added by dsalahutdinov // dev.to // about 2 months ago
How not-null constraint and default values help to write better codeArticle Added by dsalahutdinov // dev.to // 2 months ago
The Software-as-a-Service model has turned the IT industry upside down. Is Ruby on Rails the technology to do the same with SaaS?Article Added by mreyman1990 // ideamotive.co // 2 months ago
🦇 Laundry day at the Batcave. Testing asynchronous threads in Ruby explained.Article Added by AppSignal // blog.appsignal.com // 2 months ago
Many projects need a state machine to control workflows, You can read all sorts of computer science articles on what a state machine is, but the essence is that a particular object can exist in a certain number of states only, and events will cause a transition from one state to another.Article Added by Tocacar // medium.com // 3 months ago
Recently, we made changes to our codebase in regards to Content Security Policy (CSP). This article starts with a minuscule intro to CSP, then talks about why we decided to change our approach, what we changed, some unintended consequences and how we fixed things; it then ends with some observations and learnings.Article Added by Tocacar // medium.com // 3 months ago