Skip to content

Commit 870b3e3

Browse files
committed
added configuration generator, updated readme
1 parent 3701508 commit 870b3e3

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ After the generator finishes, you will be prompted to add helper call to your ap
2424

2525
NOTE: Your JS files needed have been included before `include_rails_script`. In other words, you still need `<%= javascript_include_tag "application" %>` in your application layout.
2626

27+
## Configuration
28+
You can configure name of your application in config/initializers/rails_script.rb file.
29+
2730
## Usage
2831

2932
### Page (Action) Specific JavaScript

lib/generators/rails_script/install/install_generator.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ class InstallGenerator < ::Rails::Generators::Base
66
def copy_files
77
template 'base.js.coffee', 'app/assets/javascripts/base.js.coffee'
88
template 'global.js.coffee', 'app/assets/javascripts/global.js.coffee'
9+
template 'rails_script.rb', 'config/initializers/rails_script.rb'
910
end
1011

1112
def create_directories
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
RailsScript.config do |c|
2+
# Configure name that will be used to namespace the javascript classes
3+
c.app_namespace = "App"
4+
end

0 commit comments

Comments
 (0)