From 27c8b51fcf9366fc01095a1269e30ec7eaf15251 Mon Sep 17 00:00:00 2001 From: Mike Simkins Date: Sun, 21 Aug 2016 17:14:00 +0100 Subject: [PATCH] Add 'Return To Application' Link to Menu Bar --- Gemfile.lock | 6 +++--- app/views/layouts/resque_web/application.html.erb | 3 +++ test/dummy/app/controllers/portal_controller.rb | 5 +++++ test/dummy/app/views/portal/index.html.erb | 2 ++ test/dummy/config/routes.rb | 2 +- 5 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 test/dummy/app/controllers/portal_controller.rb create mode 100644 test/dummy/app/views/portal/index.html.erb diff --git a/Gemfile.lock b/Gemfile.lock index 701be02..1ad5ec0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -23,7 +23,7 @@ GIT PATH remote: . specs: - resque-web (0.0.8) + resque-web (0.0.9) coffee-rails jquery-rails resque @@ -105,7 +105,7 @@ GEM domain_name (~> 0.5) i18n (0.7.0) jdbc-sqlite3 (3.8.11.2) - jquery-rails (4.1.1) + jquery-rails (4.2.1) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) @@ -393,7 +393,7 @@ GEM rubysl-yaml (2.1.0) rubysl-zlib (2.0.1) sass (3.4.22) - sass-rails (5.0.5) + sass-rails (5.0.6) railties (>= 4.0.0, < 6) sass (~> 3.1) sprockets (>= 2.8, < 4.0) diff --git a/app/views/layouts/resque_web/application.html.erb b/app/views/layouts/resque_web/application.html.erb index 446e1c5..eefffeb 100644 --- a/app/views/layouts/resque_web/application.html.erb +++ b/app/views/layouts/resque_web/application.html.erb @@ -45,6 +45,9 @@ <% tabs.each do |tab_name,path| %> <%= tab tab_name,path %> <% end %> + <% if respond_to?(:main_app) %> +
  • <%= link_to "Return to Application", main_app.root_path, :class => "nav navbar-nav" %>
  • + <% end %> diff --git a/test/dummy/app/controllers/portal_controller.rb b/test/dummy/app/controllers/portal_controller.rb new file mode 100644 index 0000000..a670c67 --- /dev/null +++ b/test/dummy/app/controllers/portal_controller.rb @@ -0,0 +1,5 @@ +class PortalController < ApplicationController + + def index + end +end diff --git a/test/dummy/app/views/portal/index.html.erb b/test/dummy/app/views/portal/index.html.erb new file mode 100644 index 0000000..0763c7f --- /dev/null +++ b/test/dummy/app/views/portal/index.html.erb @@ -0,0 +1,2 @@ +

    This is the root page

    + diff --git a/test/dummy/config/routes.rb b/test/dummy/config/routes.rb index 3caf1ac..ac49e2a 100644 --- a/test/dummy/config/routes.rb +++ b/test/dummy/config/routes.rb @@ -1,4 +1,4 @@ Rails.application.routes.draw do - + root :to => "portal#index" mount ResqueWeb::Engine => "/resque_web" end