Skip to content

Commit

Permalink
add js extension to coffee files
Browse files Browse the repository at this point in the history
  • Loading branch information
maccman committed Oct 22, 2011
1 parent f220c92 commit 9a7c0e9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -31,15 +31,15 @@ Running `rails g spine:new` will create the following directory structure:
app/assets/javascripts/app/models/
app/assets/javascripts/app/views/
app/assets/javascripts/app/controllers/
app/assets/javascripts/app/index.coffee
app/assets/javascripts/app/index.js.coffee

By default your application will be namespaced by the `app` directory. You can specify a different namespace with the `--app` option:

rails g spine:new --app foo_bar

**NOTE:** If you use the `--app` option here, then you will also have to specify it with other generators.

Use the top-level level `index.coffee` file to setup namespacing and initial controller instantiation.
Use the top-level level `index.js.coffee` file to setup namespacing and initial controller instantiation.

## Generators

Expand Down
2 changes: 1 addition & 1 deletion lib/generators/spine/controller/controller_generator.rb
Expand Up @@ -11,7 +11,7 @@ def create_controller
template "controller.coffee.erb", File.join(
"app/assets/javascripts",
app_name, "controllers",
class_path, file_name.pluralize + ".coffee"
class_path, file_name.pluralize + ".js.coffee"
)
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/spine/model/model_generator.rb
Expand Up @@ -10,7 +10,7 @@ class ModelGenerator < Base
argument :fields, :desc => 'List of model attributes', :type => :array, :banner => 'field1 field2'

def create_model
template "model.coffee.erb", "app/assets/javascripts/#{app_name}/models/#{file_name}.coffee"
template "model.coffee.erb", "app/assets/javascripts/#{app_name}/models/#{file_name}.js.coffee"
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/spine/new/new_generator.rb
Expand Up @@ -25,7 +25,7 @@ def create_dir_layout
end

def create_app_file
template "index.coffee.erb", "app/assets/javascripts/#{app_name}/index.coffee"
template "index.coffee.erb", "app/assets/javascripts/#{app_name}/index.js.coffee"
end

def add_spine_app_to_application
Expand Down

0 comments on commit 9a7c0e9

Please sign in to comment.