2011-08-08 50 views
0

我封閉這個愚蠢的形式:Rails的3.1rc5 index_path未定義的方法

我有一百萬關係:

class Elementtype < ActiveRecord::Base 

    has_many :elementtypeproperties 

class Propertytype < ActiveRecord::Base 

    has_many :elementtypeproperties 


class Elementtypeproperties < ActiveRecord::Base 

    belongs_to :elementtype 
    belongs_to :propertytype 

我創造了這個形式:

<%= simple_form_for @elementtypeproperty do |form| %> 


    <%=form.collection :elementtype_id%> 
    <%=form.collection :propertytype_id%> 

    <%= form.button :submit %> 



<% end %> 

包含在這查看:

<h1>New elementtypeproperty</h1> 

<%= render 'form' %> 

<%= link_to 'Back', elementtypeproperties_path %> 

當我嘗試打開頁面,我收到以下消息:

ActionView::Template::Error (undefined method `elementtypeproperties_index_path' for #<#<Class:0x000001010b51d8>:0x000001010a5fa8>): 
    1: <%= simple_form_for @elementtypeproperty do |form| %> 
    2: 
    3: 
    4:  <%=form.collection :order_id%> 
    app/views/elementtypeproperties/_form.html.erb:1:in `_app_views_elementtypeproperties__form_html_erb__3568906133403572328_2153973000' 
    app/views/elementtypeproperties/new.html.erb:3:in `_app_views_elementtypeproperties_new_html_erb__1519898890038681767_2154367600' 
    app/controllers/elementtypeproperties_controller.rb:29:in `new' 

怎麼了?謝謝!!!

+1

你會發現,如果你標記你接受問題的答案,人們更願意幫助你。 –

+0

Oups,對不起,我不知道。完成。謝謝(你的)信息。 – ndemoreau

+0

沒問題,很高興你解決了你的問題。 –

回答

2

解決了,我的模型是複數,由於遷移錯誤。