Build an asset manifest for iD
This commit is contained in:
parent
d23f262543
commit
2afb1242cc
2 changed files with 12 additions and 0 deletions
11
app/helpers/asset_helper.rb
Normal file
11
app/helpers/asset_helper.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
module AssetHelper
|
||||
def assets(directory)
|
||||
assets = {}
|
||||
|
||||
Rails.application.assets.index.each_logical_path("#{directory}/*") do |path|
|
||||
assets[path.sub(/^#{directory}\//, "")] = asset_path(path)
|
||||
end
|
||||
|
||||
assets
|
||||
end
|
||||
end
|
|
@ -21,6 +21,7 @@
|
|||
var id = iD()
|
||||
.embed(true)
|
||||
.assetPath("/assets/iD/") <%# Can't use asset_path('iD/') in production. %>
|
||||
.assetMap(<%= assets("iD").to_json.html_safe %>)
|
||||
.locale("<%= locale %>", "<%= asset_path("iD/locales/#{locale}.json") %>")
|
||||
.preauth({
|
||||
<% token = @user.access_token(ID_KEY) %>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue