fix generator problem. allow no auth

This commit is contained in:
Torsten 2023-10-23 20:10:44 +03:00
parent 9f6b5a878a
commit 60808aee26
5 changed files with 17 additions and 7 deletions

View File

@ -1,6 +1,11 @@
module Merged
class MergedController < ::ApplicationController
before_action :authenticate_member!
before_action :authenticate_if
layout "merged/application"
def authenticate_if
return unless respond_to? :"authenticate_member!"
authenticate_member!
end
end
end

View File

@ -25,8 +25,9 @@
= link_to merged.changes_index_path do
%button.my-3.button{class: last_change_class}= last_change_text
= form_tag( main_app.destroy_member_session_path , {method: :delete } ) do
%button.flex.w-full.items-center.gap-2.rounded-lg.px-4.py-2.text-sm.text-blue-700.hover:bg-red-50{:role => "menuitem", :type => "submit"}
%svg.h-4.w-4{:fill => "none", :stroke => "currentColor", "stroke-width" => "2", :viewbox => "0 0 24 24", :xmlns => "http://www.w3.org/2000/svg"}
%path{:d => "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16", "stroke-linecap" => "round", "stroke-linejoin" => "round"}
Sign out
- if main_app.respond_to? :destroy_member_session_path
= form_tag( main_app.destroy_member_session_path , {method: :delete } ) do
%button.flex.w-full.items-center.gap-2.rounded-lg.px-4.py-2.text-sm.text-blue-700.hover:bg-red-50{:role => "menuitem", :type => "submit"}
%svg.h-4.w-4{:fill => "none", :stroke => "currentColor", "stroke-width" => "2", :viewbox => "0 0 24 24", :xmlns => "http://www.w3.org/2000/svg"}
%path{:d => "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16", "stroke-linecap" => "round", "stroke-linejoin" => "round"}
Sign out

View File

@ -1,3 +1,5 @@
require "simple_form"
# frozen_string_literal: true
#
# Uncomment this and change the path if necessary to include your own

View File

@ -59,7 +59,7 @@ Merged.text_columns = {
"2" => "columns-1 md:columns-2" }
Merged.columns = { "1" => "grid-cols-1",
"2" => "grid-cols-1 md:grid-cols-2"
"2" => "grid-cols-1 md:grid-cols-2" ,
"3" => "grid-cols-1 md:grid-cols-2 lg:grid-cols-3",
"4" => "grid-cols-1 md:grid-cols-2 lg:grid-cols-4",
"5" => "grid-cols-1 md:grid-cols-3 lg:grid-cols-5",

View File

@ -24,4 +24,6 @@ Gem::Specification.new do |spec|
spec.add_dependency "active_hash"
spec.add_dependency "mini_magick"
spec.add_dependency "ruby2js" , '~> 5.0', '>= 5.0.1'
spec.add_dependency "simple_form" , "5.1.0"
end