From 41f6163df9d7633caa7ca0cb0dc0a95028053d8a Mon Sep 17 00:00:00 2001 From: Matt Gibson Date: Thu, 23 Apr 2015 23:22:53 +0100 Subject: [PATCH 1/2] Include css and js manifests from plugins if they are there. --- app/views/layouts/resque_web/application.html.erb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/views/layouts/resque_web/application.html.erb b/app/views/layouts/resque_web/application.html.erb index d7557cc..492d3dc 100644 --- a/app/views/layouts/resque_web/application.html.erb +++ b/app/views/layouts/resque_web/application.html.erb @@ -6,8 +6,18 @@ Resque. - <%= stylesheet_link_tag "resque_web/application", :media => "all" %> + <%= stylesheet_link_tag "resque_web/application", :media => "all" %> + <%= + ResqueWeb::Plugins.plugins.collect do |p| + stylesheet_link_tag "#{p.name.underscore.downcase}/application" + end.join("\n").html_safe + %> <%= javascript_include_tag "resque_web/application" %> + <%= + ResqueWeb::Plugins.plugins.collect do |p| + javascript_include_tag "#{p.name.underscore.downcase}/application" + end.join("\n").html_safe + %> <%= csrf_meta_tags %> From 984c059762a32eb9478eb3124a89d9eb6fa09382 Mon Sep 17 00:00:00 2001 From: Matt Gibson Date: Mon, 25 May 2015 20:02:31 +0100 Subject: [PATCH 2/2] Do not include asset if the file does not exist --- app/views/layouts/resque_web/application.html.erb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/resque_web/application.html.erb b/app/views/layouts/resque_web/application.html.erb index 492d3dc..10c1b78 100644 --- a/app/views/layouts/resque_web/application.html.erb +++ b/app/views/layouts/resque_web/application.html.erb @@ -9,13 +9,17 @@ <%= stylesheet_link_tag "resque_web/application", :media => "all" %> <%= ResqueWeb::Plugins.plugins.collect do |p| - stylesheet_link_tag "#{p.name.underscore.downcase}/application" + if Rails.application.assets.find_asset("#{p.name.underscore.downcase}/application.css") + stylesheet_link_tag "#{p.name.underscore.downcase}/application" + end end.join("\n").html_safe %> <%= javascript_include_tag "resque_web/application" %> <%= ResqueWeb::Plugins.plugins.collect do |p| - javascript_include_tag "#{p.name.underscore.downcase}/application" + if Rails.application.assets.find_asset("#{p.name.underscore.downcase}/application.js") + javascript_include_tag "#{p.name.underscore.downcase}/application" + end end.join("\n").html_safe %> <%= csrf_meta_tags %>