Class: Rubyblok::Generators::WebhookControllerGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/rubyblok/webhook_controller_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_initializerObject



13
14
15
# File 'lib/generators/rubyblok/webhook_controller_generator.rb', line 13

def copy_initializer
  template('webhook_controller.rb.erb', "app/controllers/#{file_name}_controller.rb")
end

#routes_configObject



17
18
19
20
21
22
# File 'lib/generators/rubyblok/webhook_controller_generator.rb', line 17

def routes_config
  destination_path = 'config/routes.rb'
  insert_into_file destination_path, after: 'Rails.application.routes.draw do' do
    routes_content
  end
end