A quick tidbit on working in a view
If you're working in a view and you wondering why your...
<% for person in @people %>
<% person.name %>
<% end %>
...isn't showing the name of that person as stored in your database (you may not get an error), it's not because the app isn't working right. You're just not telling it to convert the raw data it's getting from the db. You need to modify the
<% person.name %>
line to look like this
<%= person.name %>
The = sign tells Rails to turn that value into a string. If the data is a string, it will be displayed on your page. Voila!
<% for person in @people %>
<% person.name %>
<% end %>
...isn't showing the name of that person as stored in your database (you may not get an error), it's not because the app isn't working right. You're just not telling it to convert the raw data it's getting from the db. You need to modify the
<% person.name %>
line to look like this
<%= person.name %>
The = sign tells Rails to turn that value into a string. If the data is a string, it will be displayed on your page. Voila!