I am trying to generate a layout which I can use between my rails webapp
and mobile versions. I have been using nifty-generator
, but it says the generated files are identical to what was generated by rails3 new application creation.
What's the major difference between default scaffold
and nifty:scaffold
?
If you visit the Github page (https://github.com/ryanb/nifty-generators) for the project under 'Troubleshooting and FAQs' it answers a few questions including this one. The response given there is:
One of the primary differences is that nifty:scaffold allows you to choose which controller actions to generate.
rails g nifty:scaffold post name:string index new edit
There are a few changes to the generated code as well, such as no XML format by default.
It also offers support for HAML, Shoulda, and RSpec.
Once you get a handle on the code that Rails needs in its RESTful controllers I would highly recommend using Inherited Resources (https://github.com/josevalim/inherited_resources) instead. It really helps DRY up your controllers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With