Module: Lanes::API::HelperMethods

Defined in:
lib/lanes/api/helper_methods.rb

Instance Method Summary collapse

Instance Method Details

#client_bootstrap_dataObject



14
15
16
# File 'lib/lanes/api/helper_methods.rb', line 14

def client_bootstrap_data
    Oj.dump(Extensions.client_bootstrap_data(self), mode: :compat)
end

#csrf_tokenObject



18
19
20
# File 'lib/lanes/api/helper_methods.rb', line 18

def csrf_token
    Rack::Csrf.csrf_token(env)
end

#dataObject



26
27
28
# File 'lib/lanes/api/helper_methods.rb', line 26

def data
    @json_data ||= Oj.load( request.body.read )
end

#lanes_api_urlObject



22
23
24
# File 'lib/lanes/api/helper_methods.rb', line 22

def lanes_api_url
    Lanes.config.mounted_at
end

#lanes_javascript_tagObject



6
7
8
# File 'lib/lanes/api/helper_methods.rb', line 6

def lanes_javascript_tag
    javascript_tag( 'lanes' )
end

#lanes_stylesheet_tagObject



10
11
12
# File 'lib/lanes/api/helper_methods.rb', line 10

def lanes_stylesheet_tag
    stylesheet_tag( 'lanes' )
end