Home

Awesome

Nice Generators Build Status Code Climate

Nice generators for rails 3.

Installation

Add nice_generators to your Gemfile:

gem 'nice_generators'

Install it using bundle install

Run the following command to install some templates and the translation file (config/locales/nice.en.yml):

rails generate nice:install

Available generators

rails generate nice:install

This generator was already explained: it allows us to use nice_generators.

rails generate nice:layout application

This generator creates a nice layout, similar to the default layout, but well-indented and displaying flashes. In addition, it generates a layout helper containing useful methods.

rails generate nice:scaffold article title:string body:text

It's just like rails generate scaffold article title:string body:text, but with some nice features.

rails generate nice:scaffold_controller comment name:string body:text post_id:integer

It's just like rails generate scaffold_controller article name:string body:text post_id:integer, but with some nice features.

Features

Integration with simple_form

You can use nice_generators along with simple_form. Simply run rails generate simple_form:install after running rails generate nice:install.

rails generate nice:install
rails generate simple_form:install

Slim templates

Change the template engine in config/application.rb

config.generators do |g|
  g.template_engine :slim
end

Contributing

  1. Fork it
  2. Create a branch (git checkout -b my_awesome_branch)
  3. Commit your changes (git commit -am "Added some magic")
  4. Push to the branch (git push origin my_awesome_branch)
  5. Send pull request