Class: Rails::Generators::ScaffoldGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/ember/scaffold_override.rb

Instance Method Summary collapse

Instance Method Details

#add_emberObject


11
12
13
14
15
16
17
18
# File 'lib/generators/ember/scaffold_override.rb', line 11

def add_ember
  if options.ember
    say_status :invoke, "ember:resource", :white
    with_padding do
      invoke "ember:scaffold", [singular_name, attributes.map { |a| "#{a.name}:#{a.type}" }].flatten
    end
  end
end

#write_resourceObject


20
21
22
# File 'lib/generators/ember/scaffold_override.rb', line 20

def write_resource
  action Walker.new(file_path.pluralize, File.join(destination_root, 'config/routes.rb'), ::Rails.application.config.ember.api_version)
end