Class: Devise::Webauthn::ControllersGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Devise::Webauthn::ControllersGenerator
- Defined in:
- lib/generators/devise/webauthn/controllers_generator.rb
Constant Summary collapse
- CONTROLLERS =
%w[ passkeys second_factor_webauthn_credentials two_factor_authentications passkey_authentication_options passkey_registration_options security_key_authentication_options security_key_registration_options ].freeze
Instance Method Summary collapse
Instance Method Details
#create_controllers ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/generators/devise/webauthn/controllers_generator.rb', line 26 def create_controllers @scope_prefix = scope.blank? ? "" : "#{scope.camelize}::" controllers = [:controllers] || CONTROLLERS controllers.each do |name| template "#{name}_controller.rb", "app/controllers/#{scope}/#{name}_controller.rb" end end |
#show_readme ⇒ Object
35 36 37 |
# File 'lib/generators/devise/webauthn/controllers_generator.rb', line 35 def show_readme readme "README" if behavior == :invoke end |