我想我的生成與scaffold_controller CRUD腳本我使用(錯誤):問題產生scaffold_controller
Loading development environment (Rails 3.0.10)
ruby-1.9.2-p290 :001 >
我的模型很簡單: 類Orgjed <的ActiveRecord :: Base的 結束 而在我的模式這是怎麼寫道:
create_table "orgjeds", :force => true do |t|
t.string "naziv"
t.datetime "created_at"
t.datetime "updated_at"
end
,我試圖創建控制器和帶有 軌道根的所有腳本Orgjed 之後中心提供全方位scaffold_controller,腳本似乎做的一切OK:我啓動服務器,並嘗試去正確的路徑之後
...
create app/views/orgjeds/index.html.erb
create app/views/orgjeds/edit.html.erb
...
就是我回來在我的瀏覽器:
NoMethodError in Orgjeds#index
Showing xxx/ev_rada/app/views/orgjeds/index.html.erb where line #12
raised:
undefined method `orgjed_path' for #<#<Class:0x9fbe1dc>:0x9fb0cf8>
Extracted source (around line #12):
9:
10: <% @orgjeds.each do |orgjed| %>
11: <tr>
12: <td><%= link_to 'Show', orgjed %></td>
13: <td><%= link_to 'Edit', edit_orgjed_path(orgjed) %></td>
14: <td><%= link_to 'Destroy', orgjed, :confirm => 'Are you
sure?', :method => :delete %></td>
15: </tr>
此外,我看着_form.html.erb 並沒有像納茲夫的領域... 這是一個錯誤還是我做錯了什麼? 謝謝
解決問題您是否嘗試過使用簡單的'軌摹支架型號attributes'? –