开发者

Rails3 error using form_for method

I generated model and views 开发者_开发知识库using scaffold generate command, but after generation this problem appear...

Showing /home/coderx/development/avioapp/app/views/plains/_form.html.erb where line #1 raised:

undefined method `define_attribute_methods' for nil:NilClass

Extracted source (around line #1):

1: <%= form_for @plain do |f| %>
2:   <% if @plain.errors.any? %>
3:     <div id="error_explanation">
4:       <h2><%= pluralize(@plain.errors.count, "error") %> prohibited this plain from being saved:</h2>


Yeap, it was a problem in Controller, I have messed up something when was using git branches.. Thank you for your suggestion!


I also faced this type of error. In my case it was due to some reserve keywords (as table field).

Though you have found your solution but I think it might help others :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜