Class: Rockstart::ScaffoldTemplatesGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/rockstart/scaffold_templates/scaffold_templates_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_rspec_scaffold_templatesObject



19
20
21
22
23
24
# File 'lib/generators/rockstart/scaffold_templates/scaffold_templates_generator.rb', line 19

def copy_rspec_scaffold_templates
  copy_file "rspec/scaffold/api_request_spec.rb",
            "#{rspec_templates_dir}/scaffold/api_request_spec.rb"
  copy_file "rspec/scaffold/request_spec.rb",
            "#{rspec_templates_dir}/scaffold/request_spec.rb"
end

#copy_scaffold_templatesObject



14
15
16
17
# File 'lib/generators/rockstart/scaffold_templates/scaffold_templates_generator.rb', line 14

def copy_scaffold_templates
  template "api_controller.rb.tt", "lib/templates/rails/scaffold_controller/api_controller.rb.tt"
  template "controller.rb.tt", "lib/templates/rails/scaffold_controller/controller.rb.tt"
end