Quick question about a loop

--- models ---

User < ActiveRecord::Base

has_many :recipes

end

Recipes < ActiveRecord::Base

  belongs_to :user

end

--- controller ---

def user_profile
   @user = User.find(params[:id]) # all prehaps get user from the
session
end

-- view --- (user_profile.rhtml)

<% @user.recipes.each do | recipe | -%>
  <%= h recipe.name %>
<% end -%>

HTH,
Nicholas