Module: Initjs::Generators::ResourceHelpers

Included in:
AddGenerator, InstallGenerator
Defined in:
lib/generators/initjs/resource_helpers.rb

Instance Method Summary collapse

Instance Method Details

#application_nameObject



9
10
11
12
13
14
15
# File 'lib/generators/initjs/resource_helpers.rb', line 9

def application_name
  if defined?(Rails) && Rails.application
    Rails.application.class.name.split('::').first
  else
    "App"
  end
end

#application_pathObject



5
6
7
# File 'lib/generators/initjs/resource_helpers.rb', line 5

def application_path
  "app/assets/javascripts/#{application_name.underscore}"
end

#js_app_nameObject



17
18
19
# File 'lib/generators/initjs/resource_helpers.rb', line 17

def js_app_name
  application_name.camelize
end