Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 33 lines (26 sloc) 0.997 kb
b61f6f5 @josevalim Load generators from both lib/rails/generators and lib/generators. Us…
josevalim authored
1 require 'rails/generators/rails/resource/resource_generator'
dec1ee7 @josevalim Started with scaffold controller and added remove_hook_for.
josevalim authored
2
3 module Rails
4 module Generators
019df98 @claudiob Replace comments' non-breaking spaces with spaces
claudiob authored
5 class ScaffoldGenerator < ResourceGenerator # :nodoc:
0efedf2 @josevalim Ensure scaffold works properly even if plural name is given. [#3062]
josevalim authored
6 remove_hook_for :resource_controller
7 remove_class_option :actions
80cd163 @josevalim Added scaffold views to scaffold controller.
josevalim authored
8
5ad7f8a @robin850 Use Ruby 1.9 Hash syntax in railties
robin850 authored
9 class_option :stylesheets, type: :boolean, desc: "Generate Stylesheets"
10 class_option :stylesheet_engine, desc: "Engine for Stylesheets"
e208ad9 @rafaelfranca Use Ruby 1.9 syntax
rafaelfranca authored
11 class_option :assets, type: :boolean
12 class_option :resource_route, type: :boolean
3a68aec @josevalim Make generators more modular, add hooks and improve test suite.
josevalim authored
13
cb025f8 @wycats Add --no-html to scaffold generator
wycats authored
14 def handle_skip
2e5f49d @kjg Don't generate a scaffold.css if no-assets
kjg authored
15 @options = @options.merge(stylesheets: false) unless options[:assets]
d643cbe @rwz Changed if ! to unless
rwz authored
16 @options = @options.merge(stylesheet_engine: false) unless options[:stylesheets]
cb025f8 @wycats Add --no-html to scaffold generator
wycats authored
17 end
18
5ad7f8a @robin850 Use Ruby 1.9 Hash syntax in railties
robin850 authored
19 hook_for :scaffold_controller, required: true
3a68aec @josevalim Make generators more modular, add hooks and improve test suite.
josevalim authored
20
21 hook_for :assets do |assets|
22 invoke assets, [controller_name]
23 end
24
74ade51 Move SCSS generators and default templates from Rails to the Sass Rai…
tomhuda authored
25 hook_for :stylesheet_engine do |stylesheet_engine|
cb025f8 @wycats Add --no-html to scaffold generator
wycats authored
26 if behavior == :invoke
27 invoke stylesheet_engine, [controller_name]
28 end
3a68aec @josevalim Make generators more modular, add hooks and improve test suite.
josevalim authored
29 end
dec1ee7 @josevalim Started with scaffold controller and added remove_hook_for.
josevalim authored
30 end
31 end
32 end
Something went wrong with that request. Please try again.