diff --git a/Gemfile b/Gemfile index 7c082d4..f13fdd1 100644 --- a/Gemfile +++ b/Gemfile @@ -42,6 +42,8 @@ gem 'acts_as_tree' # Use Capistrano for deployment # gem 'capistrano-rails', group: :development +gem 'draper' + group :development, :test do # Call 'byebug' anywhere in the code to # stop execution and get a debugger console diff --git a/app/decorators/application_decorator.rb b/app/decorators/application_decorator.rb new file mode 100644 index 0000000..5caf08b --- /dev/null +++ b/app/decorators/application_decorator.rb @@ -0,0 +1,8 @@ +class ApplicationDecorator < Draper::Decorator + # Define methods for all decorated objects. + # Helpers are accessed through `helpers` (aka `h`). For example: + # + # def percent_amount + # h.number_to_percentage object.amount, precision: 2 + # end +end