diff options
Diffstat (limited to 'railties/lib/rails/generators')
11 files changed, 19 insertions, 39 deletions
diff --git a/railties/lib/rails/generators/erb/scaffold/scaffold_generator.rb b/railties/lib/rails/generators/erb/scaffold/scaffold_generator.rb index f607e580a5..ee591d85b3 100644 --- a/railties/lib/rails/generators/erb/scaffold/scaffold_generator.rb +++ b/railties/lib/rails/generators/erb/scaffold/scaffold_generator.rb @@ -25,12 +25,6 @@ module Erb end end - def copy_layout_file - return unless options[:layout] - template filename_with_extensions(:layout), - File.join("app/views/layouts", controller_class_path, filename_with_extensions(controller_file_name)) - end - protected def available_views diff --git a/railties/lib/rails/generators/erb/scaffold/templates/layout.html.erb b/railties/lib/rails/generators/erb/scaffold/templates/layout.html.erb deleted file mode 100644 index 3f64be0c45..0000000000 --- a/railties/lib/rails/generators/erb/scaffold/templates/layout.html.erb +++ /dev/null @@ -1,17 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <title><%= controller_class_name %>: <%%= controller.action_name %></title> - <%%= stylesheet_link_tag 'scaffold' %> - <%%= javascript_include_tag :defaults %> - <%%= csrf_meta_tag %> -</head> -<body> - -<p class="notice"><%%= notice %></p> -<p class="alert"><%%= alert %></p> - -<%%= yield %> - -</body> -</html> diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index fbad3c9ef1..df6e98f38d 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -137,7 +137,7 @@ module Rails::Generators end def create_public_stylesheets_files - empty_directory_with_gitkeep "public/stylesheets" + directory "public/stylesheets" end def create_prototype_files diff --git a/railties/lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb b/railties/lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb index e8065d9505..f2569b3a77 100644 --- a/railties/lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb +++ b/railties/lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb @@ -1,3 +1,4 @@ class ApplicationController < ActionController::Base protect_from_forgery + layout 'application' end 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 deleted file mode 100644 index e69de29bb2..0000000000 --- a/railties/lib/rails/generators/rails/app/templates/app/views/layouts/.empty_directory +++ /dev/null diff --git a/railties/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb b/railties/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb new file mode 100644 index 0000000000..7a08d5b957 --- /dev/null +++ b/railties/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb @@ -0,0 +1,17 @@ +<!DOCTYPE html> +<html> +<head> + <title><%= controller_name.humanize %>: <%= action_name %></title> + <%= stylesheet_link_tag 'application' %> + <%= javascript_include_tag :defaults %> + <%= csrf_meta_tag %> +</head> +<body> + +<p class="notice"><%= notice %></p> +<p class="alert"><%= alert %></p> + +<%= yield %> + +</body> +</html> 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 deleted file mode 100644 index e69de29bb2..0000000000 --- a/railties/lib/rails/generators/rails/app/templates/public/stylesheets/.empty_directory +++ /dev/null diff --git a/railties/lib/rails/generators/rails/stylesheets/templates/scaffold.css b/railties/lib/rails/generators/rails/app/templates/public/stylesheets/application.css index ea3dc9b8b5..ea3dc9b8b5 100644 --- a/railties/lib/rails/generators/rails/stylesheets/templates/scaffold.css +++ b/railties/lib/rails/generators/rails/app/templates/public/stylesheets/application.css diff --git a/railties/lib/rails/generators/rails/scaffold/scaffold_generator.rb b/railties/lib/rails/generators/rails/scaffold/scaffold_generator.rb index 779f933785..bd156f399c 100644 --- a/railties/lib/rails/generators/rails/scaffold/scaffold_generator.rb +++ b/railties/lib/rails/generators/rails/scaffold/scaffold_generator.rb @@ -7,7 +7,6 @@ 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 deleted file mode 100644 index 59e5495d0b..0000000000 --- a/railties/lib/rails/generators/rails/stylesheets/USAGE +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index ce68443c39..0000000000 --- a/railties/lib/rails/generators/rails/stylesheets/stylesheets_generator.rb +++ /dev/null @@ -1,9 +0,0 @@ -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 |