Hello all. I’ve been working through some online tutorials, learning ROR
and have a question on scaffolding. Through the command promt i’ve ran
$ script/generate scaffold Albums
This created the controllers, helpers, models, and views.
I have a database table titled “albums” and have two records saved
The problem is that the scaffold command did not create what I had
expected it to create within my views. It only created partial code.
Below is the code it generated. The same goes for all my Albums views.
|<%= link_to 'Show', artist %>||<%= link_to 'Edit', edit_artist_path(artist) %>||<%= link_to 'Destroy', artist, :confirm => 'Are you sure?', :method => :delete %>|
<%= link_to ‘New artist’, new_artist_path %>
When I view the page, it displays the “Show” “Edit” “Destroy” links, and
displays these for the number of items I have within the database. I
added an additional item to the database and the “Show” “Edit” “Destroy”
was displayed an additional time, making the total three to match the
number of records I have in the database table.
So i went one step further, and figured out that i’m missing the Table
Headings along with the elements to represent what data is supposed to
be displaed. For example, if I type
id is displayed for each of the three records within the Albums table.
So, the question is, why isnt it filling out the code I had expected? I
have over come a lot of issues, mainly because of the tutorial i am
walking through is using an older version of ROR. This issue I cant find
an answer on. Anyone have any ideas that could point me in the right