added application_decorator
This commit is contained in:
parent
2a5da1f6ed
commit
69d65ad96a
2
Gemfile
2
Gemfile
|
|
@ -42,6 +42,8 @@ gem 'acts_as_tree'
|
||||||
# Use Capistrano for deployment
|
# Use Capistrano for deployment
|
||||||
# gem 'capistrano-rails', group: :development
|
# gem 'capistrano-rails', group: :development
|
||||||
|
|
||||||
|
gem 'draper'
|
||||||
|
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
# Call 'byebug' anywhere in the code to
|
# Call 'byebug' anywhere in the code to
|
||||||
# stop execution and get a debugger console
|
# stop execution and get a debugger console
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
Loading…
Reference in New Issue