class AngularjsCrudGenerator

Public Instance Methods

create_app_dir() click to toggle source
# File lib/generators/angularjs_crud/angularjs_crud_generator.rb, line 8
def create_app_dir
  empty_directory app_dir
end
create_app_partial() click to toggle source
# File lib/generators/angularjs_crud/angularjs_crud_generator.rb, line 30
def create_app_partial
  template "_app_partial.html.erb", "app/views/angular_apps/_#{file_name.pluralize}_app.html.erb"
end
create_main_js_file() click to toggle source
# File lib/generators/angularjs_crud/angularjs_crud_generator.rb, line 12
def create_main_js_file
  template "angular_app/main.js", "#{app_dir}/main.js"
end
create_template_files() click to toggle source
# File lib/generators/angularjs_crud/angularjs_crud_generator.rb, line 22
def create_template_files
  template "angular_app/templates/tmpl_form.html", "#{app_dir}/templates/tmpl_form.html"
  template "angular_app/templates/tmpl_new.html", "#{app_dir}/templates/tmpl_new.html"
  template "angular_app/templates/tmpl_edit.html", "#{app_dir}/templates/tmpl_edit.html"
  template "angular_app/templates/tmpl_show.html", "#{app_dir}/templates/tmpl_show.html"
  template "angular_app/templates/tmpl_delete.html", "#{app_dir}/templates/tmpl_delete.html"
end
create_test_files() click to toggle source
# File lib/generators/angularjs_crud/angularjs_crud_generator.rb, line 16
def create_test_files
  template "angular_app/test/services/model_spec.js", "#{app_dir}/test/services/#{file_name}_spec.js"
  template "angular_app/test/directives/form_spec.js", "#{app_dir}/test/directives/#{file_name}_form_spec.js"
  template "angular_app/test/controllers/main_ctrl_spec.js", "#{app_dir}/test/controllers/main_ctrl_spec.js"
end
print_end() click to toggle source
print_start() click to toggle source

Private Instance Methods

app_dir() click to toggle source
# File lib/generators/angularjs_crud/angularjs_crud_generator.rb, line 39
def app_dir
  "public/assets/js/apps/#{file_name.pluralize}"
end