Sha256: 301d8e323daaec8b30a81f50689897152004d8c513d901b09bdff0d7e1ab94b1
Contents?: true
Size: 681 Bytes
Versions: 13
Compression:
Stored size: 681 Bytes
Contents
require 'rails/generators/erb/scaffold/scaffold_generator' module Slim module Generators class ScaffoldGenerator < Erb::Generators::ScaffoldGenerator source_root File.expand_path(File.join('..', 'templates'), __FILE__) def copy_view_files available_views.each do |view| filename = filename_with_extensions view template "#{view}.html.slim", File.join('app', 'views', controller_file_path, filename) end end hook_for :form_builder, :as => :scaffold protected def available_views ['index', 'edit', 'show', 'new', '_form'] end def handler :slim end end end end
Version data entries
13 entries across 13 versions & 1 rubygems