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.
Subscribe to Youtube
39 clues algebra astronomy baseball bees biography books botany Building Chain Reaction chess christmas computer programming dissecting easter economics florida fun games geography Gold rush history holidays homeschooling karate Latin lego lego mindstorm London magic math music reading robotics Rube Goldberg Machine science Scratch spanish swimming teeth toys travel Uncategorized vacation wedding