Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
JS embedding
!!!
%html{ "xmlns" => "http://www.w3.org/1999/xhtml", "xml:lang" => "en", "lang" => "en" }
%head
%meta{ "http-equiv" => "content-type", "content" => "text/html;charset=UTF-8" }
-# snip
= stylesheet_link_tag @additional_styles if @additional_styles
= javascript_include_tag @additional_scripts if @additional_scripts
# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
# Adds stylesheets
def stylesheet(*names)
@additional_styles = (names + (@additional_styles || [])).uniq unless names.blank?
end
# Adds javascript files
def javascript(*names)
@additional_scripts = (names + (@additional_scripts || [])).uniq unless names.blank?
end
end
- stylesheet "admin/keywords", "admin/..."
- javascript "admin/keywords", "jquery-..."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.