Module: Faalis::Generators::Concerns::Angular

Included in:
DashboardScaffold
Defined in:
lib/faalis/generators/concerns/angular.rb

Overview

This Concern looks for raw_path and path in scaffold json file which both of them are optional. Using raw_path you can override the full path of generate file. and with path you can override the directory name inside app/assets/javascripts.

Instance Method Summary (collapse)

Instance Method Details

- (Object) angularjs_app_path (private)

return the relative path to place where scaffold shoud be created.



15
16
17
18
19
20
21
22
23
24
# File 'lib/faalis/generators/concerns/angular.rb', line 15

def angularjs_app_path
  if !resource_data['raw_path'].blank?
    resource_data['raw_path']
  elsif !resource_data['path'].blank?
    "app/assets/javascripts/#{resource_data['path']}/"
  else
    path = Faalis::Engine.dashboard_js_manifest.split('/')[0..-2].join('/')
    "app/assets/javascripts/#{path}/"
  end
end