Class: Abyme::Generators::ControllerGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/abyme/controller/controller_generator.rb

Instance Method Summary collapse

Instance Method Details

#insert_abyme_attributes_in_strong_paramsObject



8
9
10
11
12
13
14
15
16
# File 'lib/generators/abyme/controller/controller_generator.rb', line 8

def insert_abyme_attributes_in_strong_params
  return unless File.exists? controller_file_path

  insert_into_file(
    controller_file_path,
    "abyme_attributes, ",
    after: /^(\w|\s)*params\s*(.*)permit\(\s*/
  )
end