1
def index
@posts = Post.published
respond_to do |format|
format.html # index.html.erb
format.json { render json: @posts }
format.atom
end
end
我正在接受这个错误。而且我是新的RoR任何人都可以帮助我。现在可以做什么?未定义的方法`调用'为#<ActiveRecord :: Relation []>
你可以显示错误的回溯? – 2014-10-16 20:45:38
app/controllers/posts_controller.rb:3:在'index' – mkayaa93 2014-10-16 20:47:42
是发布了一个方法还是关系? – Anthony 2014-10-16 20:48:23