Sha256: 36eb7a65445ac8a9cb2e1b69fbf62df55a4f7eaacbbccfc8fa5ac42bfef83b12
Contents?: true
Size: 1.13 KB
Versions: 17
Compression:
Stored size: 1.13 KB
Contents
require 'generators/backbone/model/model_generator' module Backbone module Generators class ScaffoldGenerator < ModelGenerator source_root File.expand_path("../templates", __FILE__) desc "This generator creates the client side crud scaffolding" def create_router_files template 'router.coffee', File.join(backbone_path, "routers", class_path, "#{plural_name}_router.js.coffee") end def create_view_files available_views.each do |view| template "views/#{view}_view.coffee", File.join(backbone_path, "views", plural_name, "#{view}_view.js.coffee") template "templates/#{view}.jst", File.join(backbone_path, "templates", plural_name, "#{view}.jst.ejs") end template "views/model_view.coffee", File.join(backbone_path, "views", plural_name, "#{singular_name}_view.js.coffee") template "templates/model.jst", File.join(backbone_path, "templates", plural_name, "#{singular_name}.jst.ejs") end protected def available_views %w(index show new edit) end end end end
Version data entries
17 entries across 17 versions & 2 rubygems