mirror of
https://github.com/docusealco/docuseal
synced 2026-11-04 22:42:32 -05:00
initial commit
This commit is contained in:
commit
97c462ead2
159 files changed
+10987
No files matched your search
@@ -0,0 +1,25 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ApplicationController < ActionController::Base
|
||||
include ActiveStorage::SetCurrent
|
||||
|
||||
before_action :maybe_redirect_to_setup, unless: :signed_in?
|
||||
before_action :authenticate_user!, unless: :devise_controller?
|
||||
|
||||
helper_method :button_title,
|
||||
:current_account
|
||||
|
||||
private
|
||||
|
||||
def current_account
|
||||
current_user&.account
|
||||
end
|
||||
|
||||
def maybe_redirect_to_setup
|
||||
redirect_to setup_index_path unless User.exists?
|
||||
end
|
||||
|
||||
def button_title(title = 'Submit', disabled_with = 'Submitting...')
|
||||
render_to_string(partial: 'shared/button_title', locals: { title:, disabled_with: })
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user