diff options
Diffstat (limited to 'railties/lib/rails/generators/rails/app')
6 files changed, 84 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 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/app/templates/public/stylesheets/application.css b/railties/lib/rails/generators/rails/app/templates/public/stylesheets/application.css new file mode 100644 index 0000000000..ea3dc9b8b5 --- /dev/null +++ b/railties/lib/rails/generators/rails/app/templates/public/stylesheets/application.css @@ -0,0 +1,65 @@ +body { background-color: #fff; color: #333; } + +body, p, ol, ul, td { + font-family: verdana, arial, helvetica, sans-serif; + font-size: 13px; + line-height: 18px; +} + +pre { + background-color: #eee; + padding: 10px; + font-size: 11px; +} + +a { color: #000; } +a:visited { color: #666; } +a:hover { color: #fff; background-color:#000; } + +div.field, div.actions { + margin-bottom: 10px; +} + +.notice { + color: green; +} + +.alert { + color: red; +} + +.fieldWithErrors { + padding: 2px; + background-color: red; + display: table; +} + +#errorExplanation { + width: 400px; + border: 2px solid red; + padding: 7px; + padding-bottom: 12px; + margin-bottom: 20px; + background-color: #f0f0f0; +} + +#errorExplanation h2 { + text-align: left; + font-weight: bold; + padding: 5px 5px 5px 15px; + font-size: 12px; + margin: -7px; + background-color: #c00; + color: #fff; +} + +#errorExplanation p { + color: #333; + margin-bottom: 0; + padding: 5px; +} + +#errorExplanation ul li { + font-size: 12px; + list-style: square; +} |