Module: ActiveAdmin::ViewHelpers::ActiveAdminApplicationHelper
- Defined in:
- lib/activeadmin_custom_layout/helpers.rb
Instance Attribute Summary collapse
-
#aa_data ⇒ Object
Returns the value of attribute aa_data.
Instance Method Summary collapse
-
#active_admin_data_tag ⇒ string
Injects ActiveAdmin data into the WEB page as a javaScript object.
- #arbre_content_for(name, &block) ⇒ Object
- #controller_env_javascript_include_tag ⇒ Object
- #controller_env_stylesheet_link_tag ⇒ Object
- #controller_javascript_include_tag ⇒ Object
- #controlller_stylesheet_link_tag ⇒ Object
Instance Attribute Details
#aa_data ⇒ Object
Returns the value of attribute aa_data.
4 5 6 |
# File 'lib/activeadmin_custom_layout/helpers.rb', line 4 def aa_data @aa_data end |
Instance Method Details
#active_admin_data_tag ⇒ string
Injects ActiveAdmin data into the WEB page as a javaScript object
22 23 24 |
# File 'lib/activeadmin_custom_layout/helpers.rb', line 22 def active_admin_data_tag "<script type=\"text/javascript\">window.active_admin_data = #{aa_data.to_json}</script>".html_safe end |
#arbre_content_for(name, &block) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/activeadmin_custom_layout/helpers.rb', line 6 def arbre_content_for( name, &block ) if block_given? content_for name.to_sym do Arbre::Context.new do text_node yield end.content end end end |
#controller_env_javascript_include_tag ⇒ Object
38 39 40 |
# File 'lib/activeadmin_custom_layout/helpers.rb', line 38 def controller_env_javascript_include_tag javascript_include_tag "#{params[:controller]}-#{Rails.env}" if asset_exist?("#{params[:controller]}-#{Rails.env}.js") end |
#controller_env_stylesheet_link_tag ⇒ Object
30 31 32 |
# File 'lib/activeadmin_custom_layout/helpers.rb', line 30 def controller_env_stylesheet_link_tag stylesheet_link_tag "#{params[:controller]}-#{Rails.env}" if asset_exist?("#{params[:controller]}-#{Rails.env}.css") end |
#controller_javascript_include_tag ⇒ Object
34 35 36 |
# File 'lib/activeadmin_custom_layout/helpers.rb', line 34 def controller_javascript_include_tag javascript_include_tag params[:controller] if asset_exist?("#{params[:controller]}.js") end |
#controlller_stylesheet_link_tag ⇒ Object
26 27 28 |
# File 'lib/activeadmin_custom_layout/helpers.rb', line 26 def controlller_stylesheet_link_tag stylesheet_link_tag params[:controller] if asset_exist?("#{params[:controller]}.css") end |