This file contains hidden or 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
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
<script src="/application.js"></script> | |
<%= "<script src=\"/#{@js}\"></script>" if @js %> |
This file contains hidden or 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
get '/' do | |
@js = ["custom.js","sorter.js","colorpicker.js"] | |
slim :index | |
end |
This file contains hidden or 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
<% if @js %> | |
<% @js.each do |script| %> | |
<%= "<script src=\"/javascripts/#{script}.js\"></script>" %> | |
<% end %> | |
<% end %> |
This file contains hidden or 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
settings.javascripts = [ "https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js", "application.js" ] |
This file contains hidden or 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
<% javascripts = (@js ? @js + settings.javascripts : settings.javascripts).uniq %> | |
<% javascripts.each do |script| %> | |
<%= "<script src=\"/javascripts/#{script}.js\"></script>" %> | |
<% end %> |
This file contains hidden or 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
helpers do | |
def javascripts | |
javascripts = (@js ? @js + settings.javascripts : settings.javascripts).uniq | |
javascripts.each do |script| | |
html << "<script src=\"/#{script}\"></script>" | |
end.join | |
end | |
end |
This file contains hidden or 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
<%= javascripts %> |
This file contains hidden or 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
helpers do | |
def javascripts *scripts | |
javascripts = (@js ? @js + settings.javascripts + args : settings.javascripts + args).uniq | |
javascripts.each do |script| | |
html << "<script src=\"/#{script}\"></script>" | |
end.join | |
end | |
end |
This file contains hidden or 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
helpers do | |
def js *scripts | |
@js ||= [] | |
@js = scripts | |
end | |
def javascripts(*args) | |
js = [] | |
js << settings.javascripts if settings.respond_to?('javascripts') | |
js << args |
This file contains hidden or 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
get '/' do | |
js "custom.js","sorter.js","colorpicker.js" | |
slim :index | |
end |