Sha256: 00a5a7b75c6d39e6e24bb5ba8a7233abde7c9259d4778986697334c45c107013

Contents?: true

Size: 704 Bytes

Versions: 7

Compression:

Stored size: 704 Bytes

Contents

require 'generators/ember/generator_helpers'

module Ember
  module Generators
    class ViewGenerator < ::Rails::Generators::NamedBase
      include Ember::Generators::GeneratorHelpers

      source_root File.expand_path("../../templates", __FILE__)

      desc "Creates a new Ember.js view and associated template."
      class_option :without_template, :type => :boolean, :default => false, :desc => "Create template for this view"

      def create_view_files
        file_path = File.join(app_path, 'views', class_path, "#{file_name}.js.es6")
        template "view.js.es6", file_path
        invoke('ember:template', [ name ], options) unless options[:without_template]
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ember-appkit-rails-0.4.0 lib/generators/ember/view_generator.rb
ember-appkit-rails-0.3.2 lib/generators/ember/view_generator.rb
ember-appkit-rails-0.3.1 lib/generators/ember/view_generator.rb
ember-appkit-rails-0.3.0 lib/generators/ember/view_generator.rb
ember-appkit-rails-0.2.2 lib/generators/ember/view_generator.rb
ember-appkit-rails-0.2.1 lib/generators/ember/view_generator.rb
ember-appkit-rails-0.2.0 lib/generators/ember/view_generator.rb