Draper
Add ~Don~ draper to decorate models in your application.
Used 23 times
J
Jason Charnes
Usage
Run this command in your Rails app directory in the terminal:
rails app:template LOCATION="https://railsbytes.com/script/V1bsq4"
Template Source
Review the code before running this template on your machine.
run "spring stop"
gem "draper"
run "bundle install"
generate "draper:install"
if yes?("Would you like to generate decorators for your existing models?")
Dir.glob(Rails.root.join("app/models/*.rb")).each { |file| require file }
models = ApplicationRecord.send(:subclasses).map(&:name)
models.each { |model| generate(:decorator, model) }
end