Class: ActionViewHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/services/action_view_helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeActionViewHelper

Returns a new instance of ActionViewHelper.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/services/action_view_helper.rb', line 5

def initialize
  notifly_path = File.expand_path(File.dirname(File.dirname(__FILE__))) + '../../app/views/notifly'
  ActionController::Base.prepend_view_path(notifly_path)
  @action_view = ActionView::Base.new(ActionController::Base.view_paths)
  @action_view.extend ApplicationHelper

  @action_view.class_eval do
    include Notifly::Engine.routes.url_helpers

    def protect_against_forgery?
      false
    end
  end
end

Instance Attribute Details

#action_viewObject (readonly)

Returns the value of attribute action_view.



2
3
4
# File 'lib/services/action_view_helper.rb', line 2

def action_view
  @action_view
end