Ok, I have been messing with this for a while and CANNOT figure how I am
getting this particular error. Here is what I have.
Model
class FlashRate < ActiveRecord::Base
belongs_to :review
has_many :reviews
attr_accessor :questions, :keys
end
Controller
def flash_rate
@flash_rate = FlashRate.new
@review = Review.find(params[:id])
@relation = Relation.find(@review.relation.id)
@flash_questions = FlashRate.new
@flash_rate = FlashRate.new
@flash_rate.questions = @relation.get_questions
@flash_rate.keys = [ :prop1, :prop2, :prop3, :prop4, :prop5, :prop6,
:prop7 ]
end
View
<% @block_title = “Flash Rate” -%>
<% @block_description = “Don’t make others repeat your mistakes” -%>
<%= start_form_tag(:action => “save_flash_rate” , :id => @review ) %>
<% @flash_rate.each do |flash| %>
<%= flash.questions %>
<%= select(:flash_rate, flash_keys , @scale ) %><% end %>
<%= submit_tag(" Flash Rate ") %>
<%= end_form_tag %>
When I run this code I get an error I don’t understand from the Action
Controller. It says:
undefined method `each’ for #FlashRate:0x3b22cc0
Any know why I would get this error?
Thanks for the help.