Module: Formol::ViewHelpers::AssetsHelper

Defined in:
lib/formol/view_helpers/assets_helper.rb

Instance Method Summary collapse

Instance Method Details

#include_formol_javascriptsObject



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/formol/view_helpers/assets_helper.rb', line 4

def include_formol_javascripts
  path = controller.controller_path

  return unless path.start_with?('formol')
  
  js_files = []
  
  js_files << "markitup/jquery.markitup.js"
  js_files << "markitup/sets/#{Formol.config.text_formatter}/set.js"
  js_files << path
  
  js_files.collect{ |j| javascript_include_tag j }.join("\n").html_safe
end

#include_formol_stylesheetsObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/formol/view_helpers/assets_helper.rb', line 18

def include_formol_stylesheets
  path = controller.controller_path
  
  return unless path.start_with?('formol')
  
  stylesheets = []
  
  stylesheets << "pygments/#{Formol.config.default_pygment_theme}"
  stylesheets << "markitup/skins/simple/style"
  stylesheets << "markitup/sets/#{Formol.config.text_formatter}/style"
  stylesheets << (path.start_with?('formol/admin') ? "formol/admin" : path)
  
  stylesheets.collect{ |s| stylesheet_link_tag s }.join("\n").html_safe
end