From 36929d35c8046bd6d3db5cd6d6557e9b7ea1d818 Mon Sep 17 00:00:00 2001 From: Torsten Date: Tue, 10 Jan 2023 12:24:28 +0200 Subject: [PATCH] re derive from app application, but use merged layout --- app/controllers/merged/merged_controller.rb | 3 ++- app/helpers/merged/pages_helper.rb | 2 +- app/views/layouts/merged/application.haml | 2 +- test/dummy/config/routes.rb | 1 + test/integration/images_test.rb | 2 +- test/integration/pages_test.rb | 2 +- test/integration/style_test.rb | 2 +- 7 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/controllers/merged/merged_controller.rb b/app/controllers/merged/merged_controller.rb index b82dbd2..17560df 100644 --- a/app/controllers/merged/merged_controller.rb +++ b/app/controllers/merged/merged_controller.rb @@ -1,5 +1,6 @@ module Merged - class MergedController < ApplicationController + class MergedController < ::ApplicationController before_action :authenticate_member! + layout "merged/application" end end diff --git a/app/helpers/merged/pages_helper.rb b/app/helpers/merged/pages_helper.rb index 713030d..727c5b7 100644 --- a/app/helpers/merged/pages_helper.rb +++ b/app/helpers/merged/pages_helper.rb @@ -6,7 +6,7 @@ module Merged blog.sections.last end def last_blog - self.class.last_blog + PagesHelper.last_blog end def header_list diff --git a/app/views/layouts/merged/application.haml b/app/views/layouts/merged/application.haml index 91d55fc..5407e08 100644 --- a/app/views/layouts/merged/application.haml +++ b/app/views/layouts/merged/application.haml @@ -2,7 +2,7 @@ %html %head %meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/ - %title Hubfeenix + %title Merged CMS %meta{:content => "width=device-width,initial-scale=1", :name => "viewport"}/ = csrf_meta_tags = csp_meta_tag diff --git a/test/dummy/config/routes.rb b/test/dummy/config/routes.rb index 76e5639..b22d4d3 100644 --- a/test/dummy/config/routes.rb +++ b/test/dummy/config/routes.rb @@ -3,4 +3,5 @@ Rails.application.routes.draw do get ":id" , to: "merged/view#page" , id: :id + get :destroy_member_session , to: "merged/view#page" end diff --git a/test/integration/images_test.rb b/test/integration/images_test.rb index 9585aa4..e398d23 100644 --- a/test/integration/images_test.rb +++ b/test/integration/images_test.rb @@ -5,7 +5,7 @@ class ImagesTest < ActionDispatch::IntegrationTest def test_index visit "/merged/images" - assert_title page, "Dummy" + assert_title page, "Merged" assert_text page, "Pages" end diff --git a/test/integration/pages_test.rb b/test/integration/pages_test.rb index ee4b278..60093c4 100644 --- a/test/integration/pages_test.rb +++ b/test/integration/pages_test.rb @@ -5,7 +5,7 @@ class PageTest < ActionDispatch::IntegrationTest def test_returns_success visit "/merged/pages" - assert_title page, "Dummy" + assert_title page, "Merged" assert_text page, "Pages" end diff --git a/test/integration/style_test.rb b/test/integration/style_test.rb index 3ebbf76..9889302 100644 --- a/test/integration/style_test.rb +++ b/test/integration/style_test.rb @@ -5,7 +5,7 @@ class StylesTest < ActionDispatch::IntegrationTest def test_returns_success visit "/merged/styles/index" - assert_title page, "Dummy" + assert_title page, "Merged" assert_text page, "Styles" end end