Created
February 25, 2010 23:46
-
-
Save alg/315193 to your computer and use it in GitHub Desktop.
JS embedding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!! | |
%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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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