I think the most useful concept I learned this week was the connection between Controller and View, specifically with regards to the index and show actions.

With the index action, we are always dealing with all entries that have been made, so the variable is plural. For instance, we would declare under the product controller:

def index
    @products = Product.all

In turn, when the index action is called, it renders the views/XXX/index.html.erb page. In this page, in order to retreive information for the products, we would have to call the @products variable:

<% @products.each do |product| %>
    <%= image_tag (product.image.thumb.url) %>

Similarly, under the show action, we are dealing with information for a specific occurance of a product, and thus the word "product" should be singular.

def show
    @product = Product.find(params[:id])

And in the views/products/show.html.erb file, we call the singular @product variable which has already been defined in the controller:

<%= image_tag @product.image.medium.url, :class => "style_image" %>

This distinction really helped me to code better in the view files to make sure I'm getting the correct variables.