Rails Fundamentals Session Two

Rails Fundamentals Session Two


Routes

rake routes

Referencing URLs with names and helpers

special routes

root_path

Relationships

Once you add a relationship, Rails will figure out routes and lets you access the related models

For example:

  1. add a belongs_to relationship in the answer model. Now you can use the relations
    question.answers.create ...
    
  2. Once you set up the relationships, Rails will also figure out the route
    redirect_to question
    

Routes

Session

Action Mailer

Action Mailer allows you to send emails from your application using mailer classes and views.

rails generate mailer UserMailer

Next Class