diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2010-04-09 10:04:20 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-04-09 10:04:20 -0700 |
commit | ec8e747960da9c0413cb5da7834f458bc5dd8ce1 (patch) | |
tree | 1dca16b6de668a2d2f875b3e090c3650d5e115b5 /railties/lib/rails/generators | |
parent | c44cacb07077325d0434b571889ac032dfb026f6 (diff) | |
download | rails-ec8e747960da9c0413cb5da7834f458bc5dd8ce1.tar.gz rails-ec8e747960da9c0413cb5da7834f458bc5dd8ce1.tar.bz2 rails-ec8e747960da9c0413cb5da7834f458bc5dd8ce1.zip |
Partially revert "A new application now comes with a layout and a stylesheet."
This reverts commit ea2c5fa8046e2f953b366adc94f0610ccfea0828.
Conflicts:
railties/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb
railties/test/generators/app_generator_test.rb
Diffstat (limited to 'railties/lib/rails/generators')
-rw-r--r-- | railties/lib/rails/generators/rails/app/app_generator.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/app/views/layouts/.empty_directory | 0 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/public/stylesheets/.empty_directory | 0 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/scaffold/scaffold_generator.rb | 1 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/stylesheets/USAGE | 5 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/stylesheets/stylesheets_generator.rb | 9 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/stylesheets/templates/scaffold.css (renamed from railties/lib/rails/generators/rails/app/templates/public/stylesheets/application.css) | 0 |
7 files changed, 16 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index f7644c3280..192792d078 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -142,7 +142,7 @@ module Rails::Generators end def create_public_stylesheets_files - directory "public/stylesheets" + empty_directory_with_gitkeep "public/stylesheets" end def create_prototype_files diff --git a/railties/lib/rails/generators/rails/app/templates/app/views/layouts/.empty_directory b/railties/lib/rails/generators/rails/app/templates/app/views/layouts/.empty_directory new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/railties/lib/rails/generators/rails/app/templates/app/views/layouts/.empty_directory diff --git a/railties/lib/rails/generators/rails/app/templates/public/stylesheets/.empty_directory b/railties/lib/rails/generators/rails/app/templates/public/stylesheets/.empty_directory new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/railties/lib/rails/generators/rails/app/templates/public/stylesheets/.empty_directory diff --git a/railties/lib/rails/generators/rails/scaffold/scaffold_generator.rb b/railties/lib/rails/generators/rails/scaffold/scaffold_generator.rb index bd156f399c..779f933785 100644 --- a/railties/lib/rails/generators/rails/scaffold/scaffold_generator.rb +++ b/railties/lib/rails/generators/rails/scaffold/scaffold_generator.rb @@ -7,6 +7,7 @@ module Rails remove_class_option :actions hook_for :scaffold_controller, :required => true + hook_for :stylesheets end end end diff --git a/railties/lib/rails/generators/rails/stylesheets/USAGE b/railties/lib/rails/generators/rails/stylesheets/USAGE new file mode 100644 index 0000000000..59e5495d0b --- /dev/null +++ b/railties/lib/rails/generators/rails/stylesheets/USAGE @@ -0,0 +1,5 @@ +Description: + Copies scaffold stylesheets to public/stylesheets/. + +Examples: + `rails generate stylesheets` diff --git a/railties/lib/rails/generators/rails/stylesheets/stylesheets_generator.rb b/railties/lib/rails/generators/rails/stylesheets/stylesheets_generator.rb new file mode 100644 index 0000000000..ce68443c39 --- /dev/null +++ b/railties/lib/rails/generators/rails/stylesheets/stylesheets_generator.rb @@ -0,0 +1,9 @@ +module Rails + module Generators + class StylesheetsGenerator < Base + def copy_stylesheets_file + template "scaffold.css", "public/stylesheets/scaffold.css" if behavior == :invoke + end + end + end +end diff --git a/railties/lib/rails/generators/rails/app/templates/public/stylesheets/application.css b/railties/lib/rails/generators/rails/stylesheets/templates/scaffold.css index ea3dc9b8b5..ea3dc9b8b5 100644 --- a/railties/lib/rails/generators/rails/app/templates/public/stylesheets/application.css +++ b/railties/lib/rails/generators/rails/stylesheets/templates/scaffold.css |