You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
558 B
21 lines
558 B
#coding=utf-8
|
|
#
|
|
|
|
module WechatsHelper
|
|
def include_wechat_jsfile
|
|
if Rails.env.production?
|
|
javascript_include_tag '/javascripts/wechat/build/app.min.js'
|
|
else
|
|
wechat_path = File.join(Rails.root, "public", "javascripts", "wechat")
|
|
srcs = Rails.application.config.wechat_srcs
|
|
paths = []
|
|
srcs.each do |src|
|
|
Dir.glob(wechat_path+ "/#{src}" ) do |path|
|
|
paths << path[File.join(Rails.root, "public").to_s.size, path.size]
|
|
end
|
|
end
|
|
javascript_include_tag *paths
|
|
end
|
|
end
|
|
end
|