Ruby_on_Rails.svg

Views are the part of the app that users see. To make one, go to this path: /app/views. You will see a folder called layouts. This contains your templates. If you made a model, then you should see a folder named after it. To use the views, make 2 files: index.html.erb and show.html.erb. Erb stands for Embedded Ruby. To use embeded Ruby, write <% @e = Example.find(1) %>. This doesn’t print out, so you have to write this to print it out: <%= @e.title %> . THe equals sign is very important. But this feels dirty, writing this logic in erb. This should go inside a controller instead. We will discuss controllers in part 3.