Ruby On Rails Architecture

Layer and Component

Active Record


  • Table to Class Mapping
    • Each table is mapped to one or more classes
    • getters and setters
  • Database Connectivity
    • config/database.yml
  • CRUD Operations
    • find()
  • Data Validation
    • validate_on_create() and validate_on_update()

Create a model object from a table,

ruby script/generate model Tale

Action View


  • Templates
    • rhtml
  • Form Helper
    • start placing the element methods in the form of form_tag().
  • Formatting Helper
    • date, currency, and string
  • Layout
    • Layout API
    • nesting different pages
    • a header, body, and footer


<title>Select Date</title>
<h3> Please select the date of the publication of the
date_select("post", "written_on", :start_year => 1855)

Action Controller


  • Session Handling
    • session object
  • Filtering
    • logging, user authentication and personalized response
    • before, after, and around
  • Caching


ruby script/generate controller AddTale