Class: ScaffoldPlus::Generators::AutofocusGenerator

Inherits:
ActiveRecord::Generators::Base
  • Object
show all
Defined in:
lib/generators/scaffold_plus/autofocus/autofocus_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_to_viewObject



12
13
14
15
# File 'lib/generators/scaffold_plus/autofocus/autofocus_generator.rb', line 12

def add_to_view
  file = "app/views/#{table_name}/_form.html.erb"
  gsub_file file, /(:#{column}) %>/, "\\1, autofocus: true %>"
end