Reputation: 8047
I have run
rails generate Model Profile name:string
It have worked and generated all the files. When I see the profile.rb file though it only has the class declaration not the fields.
class Profile < ActiveRecord::Base
end
Do I have to add all the fields manually ?
Upvotes: 1
Views: 339
Reputation: 230286
No, you don't to add fields manually. ActiveRecord will discover them at runtime from the table structure. This is part of rails magic :)
Upvotes: 2