What is the difference between standard scaffolds and excellent ones: scaffold?

I am trying to create a layout that I can use between my rails webapp and mobile versions. I used nifty-generator , but it says that the generated files are identical to those that were created when creating the new rails3 application.

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

+6
source share
1 answer

If you visit the Github page ( https://github.com/ryanb/nifty-generators ) for a project in the "Troubleshooting and Frequently Asked Questions" section, it answers several questions, including this one. The answer is:

One of the main differences is that nifty: scaffold allows you to choose which controller actions to create.

 rails g nifty:scaffold post name:string index new edit 

There are several changes to the generated code, for example, without XML by default.

It also offers support for HAML, Shoulda, and RSpec.

Once you get the code descriptor that Rails requires in your RESTful controllers, I would strongly recommend using Inherited Resources ( https://github.com/josevalim/inherited_resources ) instead. It really helps DRY your controllers.

+14
source

Source: https://habr.com/ru/post/904881/


All Articles