Rails 3.1rc5 index_path неопределенный метод - PullRequest
0 голосов
/ 08 августа 2011

Я заблокирован этой глупой формой:

У меня м-н отношения:

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 Ответ

2 голосов
/ 09 августа 2011

Решено, моя модель была множественного числа из-за ошибки в миграциях.

...