Module: Flexite::ApplicationHelper

Defined in:
app/helpers/flexite/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#back_to_appObject



11
12
13
# File 'app/helpers/flexite/application_helper.rb', line 11

def back_to_app
  link_to "Back to #{Flexite.config.app_name}", Flexite.config.app_link, class: 'btn btn-default'
end

#present(model) {|model.presenter(self)| ... } ⇒ Object

Yields:

  • (model.presenter(self))


3
4
5
6
7
8
9
# File 'app/helpers/flexite/application_helper.rb', line 3

def present(model)
  unless model.respond_to?(:presenter)
    raise "#{model.class.name} is not presentable"
  end

  yield(model.presenter(self))
end