dave
1
Hi there, I have a VERY newbie question about replacing the scaffolding
code in show.rhtml, which looks like this:
<% for column in Recipe.content_columns %>
<%= column.human_name %>: <%=
@recipe.send(column.name) %>
<% end %>
With this format I can’t really get to each individual item in the
recipe. I want to do something like:
<% for recipe in @recipes %>
<%= recipe.description %>
<% end %>
My controller looks like this:
def show
name = Recipe.find(params[:id])
end
Any ideas? Thanks in advance!
Dave
dave
2
Okay, I answered my own question. I can do:
<%= @recipe.description %>
Awesome!
Dave wrote:
Hi there, I have a VERY newbie question about replacing the scaffolding
code in show.rhtml, which looks like this:
<% for column in Recipe.content_columns %>
<%= column.human_name %>: <%=
@recipe.send(column.name) %>
<% end %>
With this format I can’t really get to each individual item in the
recipe. I want to do something like:
<% for recipe in @recipes %>
<%= recipe.description %>
<% end %>
My controller looks like this:
def show
name = Recipe.find(params[:id])
end
Any ideas? Thanks in advance!
Dave