Class: Kingsman::Generators::KingsmanGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Includes:
Rails::Generators::ResourceHelpers
Defined in:
lib/generators/kingsman/kingsman_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_kingsman_routesObject



20
21
22
23
24
25
# File 'lib/generators/kingsman/kingsman_generator.rb', line 20

def add_kingsman_routes
  kingsman_route  = "kingsman_for :#{plural_name}".dup
  kingsman_route << %Q(, class_name: "#{class_name}") if class_name.include?("::")
  kingsman_route << %Q(, skip: :all) unless options.routes?
  route kingsman_route
end