Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow puting assets into character folder

  • Loading branch information...
commit 73a7b75b8a7f0db0b484469817a6aecfe3d1e2b7 1 parent 194ae5e
Roman authored
View
8 app/helpers/namespace_helper.rb
@@ -7,4 +7,12 @@ def character_namespace
end
end
+
+ def find_asset(*files)
+ files.each do |file|
+ return file if Rails.application.assets.find_asset(file)
+ end
+ raise ArgumentError.new "Cannot find any of: #{files.join(",")}"
+ end
+
end
View
4 app/views/character/application.html.erb
@@ -11,12 +11,12 @@
<title><%= character_namespace.title %> | Admin</title>
- <%= stylesheet_link_tag character_namespace.stylesheet_filename, :media => 'all' %>
+ <%= stylesheet_link_tag find_asset("character/#{character_namespace.stylesheet_filename}",character_namespace.stylesheet_filename), :media => 'all' %>
<%= javascript_include_tag 'vendor/custom.modernizr' %>
<script>window.character_namespace = '<%= character_namespace.name %>';</script>
- <%= javascript_include_tag character_namespace.javascript_filename %>
+ <%= javascript_include_tag find_asset("character/#{character_namespace.javascript_filename}", character_namespace.javascript_filename) %>
<% if Rails.env.development? and character_namespace.no_auth_on_development %>
<%# do not add browserid javascript when on localhost and no_auth flag set %>
Please sign in to comment.
Something went wrong with that request. Please try again.