Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: v3.1.0.rc1
Fetching contributors…

Cannot retrieve contributors at this time

33 lines (25 sloc) 0.933 kb
require 'rails/generators/rails/resource/resource_generator'
module Rails
module Generators
class ScaffoldGenerator < ResourceGenerator #metagenerator
remove_hook_for :resource_controller
remove_class_option :actions
class_option :stylesheets, :type => :boolean, :desc => "Generate Stylesheets"
class_option :stylesheet_engine, :desc => "Engine for Stylesheets"
hook_for :scaffold_controller, :required => true
def copy_stylesheets_file
if behavior == :invoke && options.stylesheets?
template "scaffold.#{stylesheet_extension}", "app/assets/stylesheets/scaffold.#{stylesheet_extension}"
end
end
hook_for :assets do |assets|
invoke assets, [controller_name]
end
private
def stylesheet_extension
options.stylesheet_engine.present? ?
"css.#{options.stylesheet_engine}" : "css"
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.