Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between default scaffold and nifty:scaffold?

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?

like image 593
diya Avatar asked Jan 02 '12 07:01

diya


1 Answers

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.

like image 97
ootoovak Avatar answered Oct 01 '22 23:10

ootoovak