Sha256: 023a00a4edbb008050c2243af00ca3ea0440c8ebcce80a42e5d38daeea3eee92

Contents?: true

Size: 693 Bytes

Versions: 2

Compression:

Stored size: 693 Bytes

Contents

require 'ember/version'

module Ember
  module Generators
    class ControllerGenerator < ::Rails::Generators::NamedBase
      source_root File.expand_path("../../templates", __FILE__)

      desc "Creates a new Ember.js controller"
      class_option :array, :type => :boolean, :default => false, :desc => "Create an Ember.ArrayController to represent multiple objects"

      def create_controller_files
        file_path = File.join('app/assets/javascripts/controllers', class_path, "#{file_name}_controller.js")
        if options.array?
          template 'array_controller.js', file_path
        else
          template 'controller.js', file_path
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ember-rails-0.6.0 lib/generators/ember/controller_generator.rb
ember-rails-0.5.0 lib/generators/ember/controller_generator.rb