Class: Slim::Generators::ScaffoldGenerator

Inherits:
Erb::Generators::ScaffoldGenerator
  • Object
show all
Defined in:
lib/generators/slim/scaffold/scaffold_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_form_fileObject



16
17
18
19
# File 'lib/generators/slim/scaffold/scaffold_generator.rb', line 16

def copy_form_file
  filename = defined?(SimpleForm) ? 'simpleform_form' : 'plain_form'
  install_template filename, "_form"
end

#copy_scaffold_stylesheetObject



21
22
23
24
# File 'lib/generators/slim/scaffold/scaffold_generator.rb', line 21

def copy_scaffold_stylesheet
  ext = Rails.application.config.generators.options[:rails][:stylesheet_engine] || :sass
  copy_file "scaffolds.css.#{ext}", "app/assets/stylesheets/scaffolds.css.#{ext}"
end

#copy_view_filesObject



8
9
10
11
12
13
14
# File 'lib/generators/slim/scaffold/scaffold_generator.rb', line 8

def copy_view_files
  available_views.each do |view|
    # filename = filename_with_extensions view
    # template "#{view}.html.slim", File.join('app', 'views', controller_file_path, filename)
    install_template view, view
  end
end