Reputation: 8504
My setup: Rails 3.0.9, Ruby 1.9.2
I wish to generate a scaffold only for the create action, what's the syntax for that? I'm guessing it's something I append to
rails g scaffold Project name:string ...
Upvotes: 11
Views: 5203
Reputation: 171
Rails scaffolding is a very basic tool, it's not meant to be relied on, once you get a handle on the way rails works. However, you can use Ryan Bates' nifty-generator gem to generate scaffolds with greater control. Example:
rails g nifty:scaffold post name:string index new edit
Learn more here. https://github.com/ryanb/nifty-generators
Upvotes: 5
Reputation: 4851
I don't believe you can. I'm looking at the generator and I see nothing related to using an option to limit the template.
Upvotes: 9