码迷,mamicode.com
首页 > 编程语言 > 详细

Rails 添加css javascript 结合easyui

时间:2014-07-07 17:38:39      阅读:394      评论:0      收藏:0      [点我收藏+]

标签:style   java   javascript   for   io   amp   

<% content_for :header_tags do  %>
    <%=stylesheet_link_tag ‘bar.css‘, :plugin=>‘redmine_standard‘ %>
    <%=javascript_include_tag ‘bar.css‘, :plugin=>‘redmine_standard‘ %>
<%    end  %>

 

 

<% content_for :header_tags do  %>
    <%=stylesheet_link_tag ‘easyui.css‘, :easyui=>‘jquery-easyui-1.3.6/themes/default‘ %>
    <%=stylesheet_link_tag ‘icon.css‘, :easyui=>‘jquery-easyui-1.3.6/themes‘ %>
    <%=javascript_include_tag ‘jquery.min.js‘, :easyui=>‘jquery-easyui-1.3.6‘ %>
    <%=javascript_include_tag ‘jquery.easyui.min.js‘, :easyui=>‘jquery-easyui-1.3.6‘ %>
<% end  %>

 

 def javascript_include_tag(*sources)
    options = sources.last.is_a?(Hash) ? sources.pop : {}
    plugin = options.delete(:plugin)
    easyui = options.delete(:easyui)
    sources = sources.map do |source|
      if easyui
        "/#{easyui}/#{source}"
      elsif plugin
        "/plugin_assets/#{plugin}/javascripts/#{source}"
      else
        source
      end
    end
    # if plugin = options.delete(:plugin)
    #   sources = sources.map do |source|
    #     if plugin
    #       "/plugin_assets/#{plugin}/javascripts/#{source}"
    #     else
    #       source
    #     end
    #   end
    # end
    super sources, options
  end

 

  def stylesheet_link_tag(*sources)
    options = sources.last.is_a?(Hash) ? sources.pop : {}
    plugin = options.delete(:plugin)
    easyui = options.delete(:easyui)
    sources = sources.map do |source|
      if easyui
        "/#{easyui}/#{source}"
      elsif plugin
        "/plugin_assets/#{plugin}/stylesheets/#{source}"
      elsif current_theme && current_theme.stylesheets.include?(source)
        current_theme.stylesheet_path(source)
      else
        source
      end
    end
    super sources, options
  end

Rails 添加css javascript 结合easyui,布布扣,bubuko.com

Rails 添加css javascript 结合easyui

标签:style   java   javascript   for   io   amp   

原文地址:http://www.cnblogs.com/yuzhengdong/p/3813627.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!