Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
JS embedding
%html{ "xmlns" => "", "xml:lang" => "en", "lang" => "en" }
%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?
# Adds javascript files
def javascript(*names)
@additional_scripts = (names + (@additional_scripts || [])).uniq unless names.blank?
- 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.