diff options
Diffstat (limited to 'railties/lib/generators/rails/app/templates')
7 files changed, 28 insertions, 45 deletions
diff --git a/railties/lib/generators/rails/app/templates/Gemfile b/railties/lib/generators/rails/app/templates/Gemfile index f4bce8646d..0dd10f3f2d 100644 --- a/railties/lib/generators/rails/app/templates/Gemfile +++ b/railties/lib/generators/rails/app/templates/Gemfile @@ -1,4 +1,4 @@ -source 'http://gemcutter.org' +source 'http://rubygems.org' <%- if options.dev? -%> gem 'rails', :path => '<%= Rails::Generators::RAILS_DEV_PATH %>' @@ -15,15 +15,15 @@ gem 'rails', '<%= Rails::VERSION::STRING %>' gem '<%= gem_for_database %>'<% if require_for_database %>, :require => '<%= require_for_database %>'<% end %> <% end -%> -# Use mongrel as the web server -# gem 'mongrel' +# Use unicorn as the web server +# gem 'unicorn' # Deploy with Capistrano # gem 'capistrano' # Bundle the extra gems: # gem 'bj' -# gem 'hpricot', '0.6' +# gem 'nokogiri', '1.4.1' # gem 'sqlite3-ruby', :require => 'sqlite3' # gem 'aws-s3', :require => 'aws/s3' diff --git a/railties/lib/generators/rails/app/templates/config/application.rb b/railties/lib/generators/rails/app/templates/config/application.rb index 7c555c2542..dc20ffb2fa 100644 --- a/railties/lib/generators/rails/app/templates/config/application.rb +++ b/railties/lib/generators/rails/app/templates/config/application.rb @@ -35,7 +35,7 @@ module <%= app_const_base %> # config.time_zone = 'Central Time (US & Canada)' # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. - # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')] + # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] # config.i18n.default_locale = :de # Configure generators values. Many other options are available, be sure to check the documentation. diff --git a/railties/lib/generators/rails/app/templates/config/boot.rb b/railties/lib/generators/rails/app/templates/config/boot.rb index 29c9d506e5..3cb561d41f 100644 --- a/railties/lib/generators/rails/app/templates/config/boot.rb +++ b/railties/lib/generators/rails/app/templates/config/boot.rb @@ -5,13 +5,4 @@ rescue LoadError require 'rubygems' require 'bundler' Bundler.setup - - # To use 2.x style vendor/rails and RubyGems - # - # vendor_rails = File.expand_path('../../vendor/rails', __FILE__) - # if File.exist?(vendor_rails) - # Dir["#{vendor_rails}/*/lib"].each { |path| $:.unshift(path) } - # end - # - # require 'rubygems' end diff --git a/railties/lib/generators/rails/app/templates/config/initializers/cookie_verification_secret.rb.tt b/railties/lib/generators/rails/app/templates/config/initializers/cookie_verification_secret.rb.tt index 451dbe1d1c..be627fbbcc 100644 --- a/railties/lib/generators/rails/app/templates/config/initializers/cookie_verification_secret.rb.tt +++ b/railties/lib/generators/rails/app/templates/config/initializers/cookie_verification_secret.rb.tt @@ -4,4 +4,4 @@ # If you change this key, all old signed cookies will become invalid! # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attacks. -ActionController::Base.cookie_verifier_secret = '<%= app_secret %>' +Rails.application.config.cookie_secret = '<%= app_secret %>' diff --git a/railties/lib/generators/rails/app/templates/config/initializers/session_store.rb.tt b/railties/lib/generators/rails/app/templates/config/initializers/session_store.rb.tt index baff704d3e..9e32fb930e 100644 --- a/railties/lib/generators/rails/app/templates/config/initializers/session_store.rb.tt +++ b/railties/lib/generators/rails/app/templates/config/initializers/session_store.rb.tt @@ -1,15 +1,10 @@ # Be sure to restart your server when you modify this file. -# Your secret key for verifying cookie session data integrity. -# If you change this key, all old sessions will become invalid! -# Make sure the secret is at least 30 characters and all random, -# no regular words or you'll be exposed to dictionary attacks. -ActionController::Base.session = { - :key => '_<%= app_name %>_session', - :secret => '<%= app_secret %>' +Rails.application.config.session_store :cookie_store, { + :key => '_<%= app_name %>_session', } # Use the database for sessions instead of the cookie-based default, # which shouldn't be used to store highly confidential information # (create the session table with "rake db:sessions:create") -# ActionController::Base.session_store = :active_record_store +# Rails.application.config.session_store :active_record_store diff --git a/railties/lib/generators/rails/app/templates/public/index.html b/railties/lib/generators/rails/app/templates/public/index.html index ef916f9c5a..836da1b689 100644 --- a/railties/lib/generators/rails/app/templates/public/index.html +++ b/railties/lib/generators/rails/app/templates/public/index.html @@ -181,27 +181,27 @@ } </style> - <script type="text/javascript" src="javascripts/prototype.js"></script> - <script type="text/javascript" src="javascripts/effects.js"></script> <script type="text/javascript"> function about() { - if (Element.empty('about-content')) { - new Ajax.Updater('about-content', 'rails/info/properties', { - method: 'get', - onFailure: function() {Element.classNames('about-content').add('failure')}, - onComplete: function() {new Effect.BlindDown('about-content', {duration: 0.25})} - }); - } else { - new Effect[Element.visible('about-content') ? - 'BlindUp' : 'BlindDown']('about-content', {duration: 0.25}); - } + info = document.getElementById('about-content'); + if (window.XMLHttpRequest) + { xhr = new XMLHttpRequest(); } + else + { xhr = new ActiveXObject("Microsoft.XMLHTTP"); } + xhr.open("GET","rails/info/properties",false); + xhr.send(""); + info.innerHTML = xhr.responseText; + info.style.display = 'block' + } + + function prepend() { + search = document.getElementById('search-text'); + text = search.value; + search.value = 'site:rubyonrails.org ' + text; } window.onload = function() { - $('search-text').value = ''; - $('search').onsubmit = function() { - $('search-text').value = 'site:rubyonrails.org ' + $F('search-text'); - } + document.getElementById('search-text').value = ''; } </script> </head> @@ -210,7 +210,7 @@ <div id="sidebar"> <ul id="sidebar-items"> <li> - <form id="search" action="http://www.google.com/search" method="get"> + <form id="search" action="http://www.google.com/search" method="get" onSubmit="prepend();"> <input type="hidden" name="hl" value="en" /> <input type="text" id="search-text" name="q" value="site:rubyonrails.org " /> <input type="submit" value="Search" /> the Rails site diff --git a/railties/lib/generators/rails/app/templates/script/rails b/railties/lib/generators/rails/app/templates/script/rails index b01d1ee183..199fe1a6d3 100644 --- a/railties/lib/generators/rails/app/templates/script/rails +++ b/railties/lib/generators/rails/app/templates/script/rails @@ -1,8 +1,5 @@ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. -ENV_PATH = File.expand_path('../../config/environment', __FILE__) -BOOT_PATH = File.expand_path('../../config/boot', __FILE__) -APP_PATH = File.expand_path('../../config/application', __FILE__) - -require BOOT_PATH +ENV_PATH = File.expand_path('../../config/environment', __FILE__) +require File.expand_path('../../config/boot', __FILE__) require 'rails/commands' |