Displaying 1 result from an estimated 1 matches for "plccontrol".
Did you mean:
ccontrol
2007 Jun 25
2
undefined method `each' for ***:Class PROBLEM
...looks like this:
class Post < ActiveRecord::Base
end
i wrote an action in my controller which looks like this:
def testing
@posts = Post
for p in @posts
render :text => p.id
end
end
when i run this action on the browser, it gives me this error message:
NoMethodError in PlcController#testing
undefined method `each'' for Post:Class
RAILS_ROOT: ./script/../config/..
Application Trace | Framework Trace | Full Trace
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
base.rb:1235:in `method_missing''
#{RAILS_ROOT}/app/controllers/plc_controller...