Class: Exception2db::Util

Inherits:
Object
  • Object
show all
Defined in:
lib/exception2db/util.rb

Class Method Summary collapse

Class Method Details

.javascript_include_tag(*args) ⇒ Object



10
11
12
13
14
15
# File 'lib/exception2db/util.rb', line 10

def self.javascript_include_tag(*args)
  data = args.inject('') do |sum, arg|
    sum << File.new(File.join(Exception2dbConfig.setting[:plugin_dir], 'lib', 'js', "#{arg}.js")).read
  end
  ['<script type="text/javascript">', data, '</script>'].join.html_safe
end


3
4
5
6
7
8
# File 'lib/exception2db/util.rb', line 3

def self.stylesheet_link_tag(*args)
  data = args.inject('') do |sum, arg|
    sum << File.new(File.join(::Exception2dbConfig.setting[:plugin_dir], 'lib', 'css', "#{arg}.css")).read
  end
  ["<style type='text/css'>", data, '</style>'].join.html_safe
end