Class: Joosy::Generators::ResourceGenerator

Inherits:
Rails::Generators::JoosyBase show all
Defined in:
lib/rails/generators/joosy/resource_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_filesObject



8
9
10
11
12
13
14
15
16
# File 'lib/rails/generators/joosy/resource_generator.rb', line 8

def create_files
  super

  if namespace_name.empty?
    template "app/resources/template.js.coffee", "#{app_path}/resources/#{file_name}.js.coffee"
  else
    template "app/resources/template_with_namespace.js.coffee", "#{app_path}/resources/#{namespace_path}/#{file_name}.js.coffee"
  end
end