I am trying to generate my CRUD scripts with scaffold_controller I am using:
Loading development environment (Rails 3.0.10)
ruby-1.9.2-p290 :001 >
My model is quite simple: class Orgjed < ActiveRecord::Base end And in my schema this is how it writes:
create_table "orgjeds", :force => true do |t|
t.string "naziv"
t.datetime "created_at"
t.datetime "updated_at"
end
and I am trying to create controller and all scripts with rails generate scaffold_controller Orgjed After that, script seems to do everything ok:
...
create app/views/orgjeds/index.html.erb
create app/views/orgjeds/edit.html.erb
...
After I start a server and try to go to correct path this is what I got back in my browser:
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>
also, I looked into _form.html.erb and there are no fields like naziv... Is it a bug or am I doing something wrong? Thank you
rails g scaffold Model attributes?