Sha256: bea8919a3c2028379d8b82e8e36ec5c3aafefc597d5927057cba8643b5830461
Contents?: true
Size: 562 Bytes
Versions: 19
Compression:
Stored size: 562 Bytes
Contents
require 'sinatra' class ApplicationController < Sinatra::Base # Application manifest file accessor method helpers do def manifest(*args) html = String.new args.map(&:to_sym).each do |arg| html << %{<link href="/assets/application.css" type="text/css" rel="stylesheet">} if arg == :stylesheet html << %{<script src="/assets/application.js" type="text/javascript"></script>} if arg == :script end html rescue raise ArgumentError.new "Expected arguments to be any of: [stylesheet, script]" end end end
Version data entries
19 entries across 19 versions & 1 rubygems