Dapper
Dapper adds the ability to generate presenters for your rails project.
Installation
Add this line to your application's Gemfile:
gem 'dapper'
And then execute:
$ bundle
Or install it yourself as:
$ gem install dapper
Usage
Once the gem is installed, run the presenters generator.
$ rails generate presenter CONTROLLER_NAME [actions]
Example:
$ rails generate presenter Photos index new edit
The result will be:
myrailsproject |~app/ |~presenters/ |~photos/ |-edit_presenter.rb |-index_presenter.rb `-new_presenter.rb
Running the presenter generator without any actions will default to one index_presenter.rb
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request