Sha256: 682080a41989d563755a3d85c305dd8e34307f4ab18a5d5edc0b2ad4a4f7eca9
Contents?: true
Size: 847 Bytes
Versions: 2
Compression:
Stored size: 847 Bytes
Contents
module SeajsHelper # generate seajs.use() def seajs_use(*modules) seajs_config = Rails.application.config.seajs modules.map! do |m| if m.start_with? '#' m[1..-1] else if seajs_config.compiled? seajs_config.family + '/' + m else '/assets/' + m end end end html = <<-html <script> seajs.use(#{modules.to_s}) </script> html html.html_safe end # include seajs script and map config def seajs_tag seajs_config = Rails.application.config.seajs html = <<-html <script src="/assets/sea-modules/#{seajs_config.seajs_path}"></script> <script> seajs.config({ map: #{seajs_config.map_json || '[]'} }) </script> html html.html_safe end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
seajs-rails-0.0.7 | app/helpers/seajs_helper.rb |
seajs-rails-0.0.6 | app/helpers/seajs_helper.rb |