Module: Lanes::API::HelperMethods
- Defined in:
- lib/lanes/api/helper_methods.rb
Instance Method Summary collapse
- #client_bootstrap_data ⇒ Object
- #csrf_token ⇒ Object
- #data ⇒ Object
- #lanes_api_url ⇒ Object
- #lanes_javascript_tag ⇒ Object
- #lanes_stylesheet_tag ⇒ Object
Instance Method Details
#client_bootstrap_data ⇒ Object
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_token ⇒ Object
18 19 20 |
# File 'lib/lanes/api/helper_methods.rb', line 18 def csrf_token Rack::Csrf.csrf_token(env) end |
#data ⇒ Object
26 27 28 |
# File 'lib/lanes/api/helper_methods.rb', line 26 def data @json_data ||= Oj.load( request.body.read ) end |
#lanes_api_url ⇒ Object
22 23 24 |
# File 'lib/lanes/api/helper_methods.rb', line 22 def lanes_api_url Lanes.config.mounted_at end |
#lanes_javascript_tag ⇒ Object
6 7 8 |
# File 'lib/lanes/api/helper_methods.rb', line 6 def lanes_javascript_tag javascript_tag( 'lanes' ) end |
#lanes_stylesheet_tag ⇒ Object
10 11 12 |
# File 'lib/lanes/api/helper_methods.rb', line 10 def lanes_stylesheet_tag stylesheet_tag( 'lanes' ) end |