nifty-generators icon indicating copy to clipboard operation
nifty-generators copied to clipboard

Default haml in views

Open pablox-cl opened this issue 13 years ago • 6 comments

I created a new app and then ran:

rails g nifty:layout --haml

I expected that it should work with haml since then, but everytime I use the nifty:scaffold I've to specify --haml at the end... is there any way to make it default?

pablox-cl avatar Jun 11 '11 22:06 pablox-cl

AFAIS there are two "issues" with your request:

  • nifty:layout and nifty:scaffold are largely independent of each other (with a loose dependency via a helper method that scaffold uses, and that can be generated by layout)
  • rails does not provide a standard way for generators to store preferences in a project

If this will be addressed at all, I ask to make the implementation general, and also remember the options for the test framework.

rainerfrey avatar Jun 13 '11 12:06 rainerfrey

  • Oh, okay I didn't know that they were so independent from each other =P.
  • I didn't know either that generators could store some preferences. I guess I could try to find another way to include the --haml part :P

Thanks for your answer =)

pablox-cl avatar Jun 13 '11 22:06 pablox-cl

Rails 3 has a way to specify defaults like this, it would be great if nifty generators could listen for these defaults, I haven't built this into the gem yet though.

ryanb avatar Jun 29 '11 21:06 ryanb

cool. In such a case it is nice to be proven wrong. Can you give a pointer on how to store defaults with/for a generator (rails doc, or some starting point in the rails sources ...)?

rainerfrey avatar Jul 01 '11 06:07 rainerfrey

See the Configuring Generators docs for where to set default behavior.

ryanb avatar Jul 01 '11 17:07 ryanb

Ah thanks Ryan. Never noticed that part.

rainerfrey avatar Jul 01 '11 17:07 rainerfrey