railties 3.0.20 → 3.1.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +36 -49
- data/README.rdoc +2 -1
- data/guides/assets/stylesheets/fixes.css +16 -0
- data/guides/rails_guides.rb +2 -2
- data/guides/rails_guides/generator.rb +8 -3
- data/guides/rails_guides/textile_extensions.rb +4 -2
- data/guides/source/2_2_release_notes.textile +3 -3
- data/guides/source/2_3_release_notes.textile +2 -2
- data/guides/source/3_0_release_notes.textile +14 -14
- data/guides/source/action_controller_overview.textile +54 -79
- data/guides/source/action_mailer_basics.textile +39 -9
- data/guides/source/action_view_overview.textile +257 -211
- data/guides/source/active_record_basics.textile +1 -1
- data/guides/source/active_record_querying.textile +217 -27
- data/guides/source/active_record_validations_callbacks.textile +94 -25
- data/guides/source/active_support_core_extensions.textile +109 -77
- data/guides/source/ajax_on_rails.textile +15 -150
- data/guides/source/api_documentation_guidelines.textile +12 -12
- data/guides/source/association_basics.textile +74 -60
- data/guides/source/caching_with_rails.textile +59 -60
- data/guides/source/command_line.textile +46 -47
- data/guides/source/configuring.textile +55 -37
- data/guides/source/contribute.textile +7 -7
- data/guides/source/contributing_to_ruby_on_rails.textile +14 -23
- data/guides/source/credits.html.erb +3 -3
- data/guides/source/debugging_rails_applications.textile +59 -46
- data/guides/source/form_helpers.textile +76 -31
- data/guides/source/generators.textile +39 -40
- data/guides/source/getting_started.textile +73 -94
- data/guides/source/i18n.textile +64 -58
- data/guides/source/index.html.erb +3 -3
- data/guides/source/initialization.textile +634 -3284
- data/guides/source/layout.html.erb +6 -7
- data/guides/source/layouts_and_rendering.textile +59 -60
- data/guides/source/migrations.textile +63 -59
- data/guides/source/nested_model_forms.textile +2 -2
- data/guides/source/performance_testing.textile +16 -16
- data/guides/source/plugins.textile +236 -1280
- data/guides/source/rails_application_templates.textile +37 -29
- data/guides/source/rails_on_rack.textile +4 -9
- data/guides/source/routing.textile +96 -75
- data/guides/source/ruby_on_rails_guides_guidelines.textile +19 -12
- data/guides/source/security.textile +57 -30
- data/guides/source/testing.textile +26 -24
- data/guides/w3c_validator.rb +2 -2
- data/lib/rails.rb +1 -7
- data/lib/rails/application.rb +46 -76
- data/lib/rails/application/bootstrap.rb +6 -11
- data/lib/rails/application/configuration.rb +43 -40
- data/lib/rails/application/finisher.rb +16 -4
- data/lib/rails/application/railties.rb +6 -24
- data/lib/rails/application/routes_reloader.rb +45 -0
- data/lib/rails/backtrace_cleaner.rb +1 -1
- data/lib/rails/cli.rb +7 -5
- data/lib/rails/commands.rb +27 -2
- data/lib/rails/commands/application.rb +14 -1
- data/lib/rails/commands/benchmarker.rb +3 -1
- data/lib/rails/commands/dbconsole.rb +2 -2
- data/lib/rails/commands/destroy.rb +3 -1
- data/lib/rails/commands/generate.rb +3 -1
- data/lib/rails/commands/plugin.rb +2 -7
- data/lib/rails/commands/plugin_new.rb +10 -0
- data/lib/rails/commands/profiler.rb +3 -1
- data/lib/rails/commands/server.rb +4 -0
- data/lib/rails/configuration.rb +8 -81
- data/lib/rails/console/app.rb +2 -2
- data/lib/rails/engine.rb +460 -78
- data/lib/rails/engine/configuration.rb +46 -49
- data/lib/rails/engine/railties.rb +33 -0
- data/lib/rails/generators.rb +11 -5
- data/lib/rails/generators/actions.rb +2 -27
- data/lib/rails/generators/app_base.rb +216 -0
- data/lib/rails/generators/base.rb +3 -2
- data/lib/rails/generators/erb/scaffold/templates/index.html.erb +1 -1
- data/lib/rails/generators/generated_attribute.rb +2 -1
- data/lib/rails/generators/migration.rb +6 -2
- data/lib/rails/generators/named_base.rb +79 -3
- data/lib/rails/generators/rails/app/app_generator.rb +44 -209
- data/lib/rails/generators/rails/app/templates/Gemfile +15 -31
- data/lib/rails/generators/rails/app/templates/README +2 -2
- data/lib/rails/generators/rails/app/templates/Rakefile +1 -1
- data/lib/rails/generators/rails/app/templates/{public → app/assets}/images/rails.png +0 -0
- data/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt +8 -0
- data/lib/rails/generators/rails/app/templates/app/assets/stylesheets/application.css +5 -0
- data/lib/rails/generators/rails/app/templates/app/mailers/.empty_directory +0 -0
- data/lib/rails/generators/rails/app/templates/app/models/.empty_directory +0 -0
- data/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt +4 -4
- data/lib/rails/generators/rails/app/templates/config/application.rb +19 -3
- data/lib/rails/generators/rails/app/templates/config/databases/jdbcmysql.yml +4 -4
- data/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml +11 -6
- data/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml +3 -3
- data/lib/rails/generators/rails/app/templates/config/databases/oracle.yml +1 -1
- data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +1 -2
- data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +14 -11
- data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +5 -1
- data/lib/rails/generators/rails/app/templates/config/initializers/session_store.rb.tt +1 -1
- data/lib/rails/generators/rails/app/templates/config/initializers/wrap_parameters.rb.tt +12 -0
- data/lib/rails/generators/rails/app/templates/config/locales/en.yml +1 -1
- data/lib/rails/generators/rails/app/templates/config/routes.rb +1 -1
- data/lib/rails/generators/rails/app/templates/db/{seeds.rb → seeds.rb.tt} +2 -2
- data/lib/rails/generators/rails/app/templates/public/index.html +10 -8
- data/lib/rails/generators/rails/app/templates/public/stylesheets/.empty_directory +0 -0
- data/lib/rails/generators/rails/app/templates/test/fixtures/.empty_directory +0 -0
- data/lib/rails/generators/rails/app/templates/test/functional/.empty_directory +0 -0
- data/lib/rails/generators/rails/app/templates/test/integration/.empty_directory +0 -0
- data/lib/rails/generators/rails/app/templates/test/{test_helper.rb.tt → test_helper.rb} +0 -0
- data/lib/rails/generators/rails/app/templates/test/unit/.empty_directory +0 -0
- data/lib/rails/generators/rails/assets/USAGE +20 -0
- data/lib/rails/generators/rails/assets/assets_generator.rb +39 -0
- data/lib/rails/generators/rails/assets/templates/javascript.js +2 -0
- data/lib/rails/generators/rails/assets/templates/javascript.js.coffee +3 -0
- data/lib/rails/generators/rails/assets/templates/stylesheet.css +4 -0
- data/lib/rails/generators/rails/assets/templates/stylesheet.css.scss +5 -0
- data/lib/rails/generators/rails/controller/controller_generator.rb +1 -1
- data/lib/rails/generators/rails/controller/templates/controller.rb +2 -0
- data/lib/rails/generators/rails/generator/generator_generator.rb +2 -2
- data/lib/rails/generators/rails/generator/templates/templates/.empty_directory +0 -0
- data/lib/rails/generators/rails/helper/templates/helper.rb +2 -0
- data/lib/rails/generators/rails/plugin/plugin_generator.rb +7 -0
- data/lib/rails/generators/rails/plugin/templates/Rakefile.tt +4 -4
- data/lib/rails/generators/rails/plugin_new/USAGE +10 -0
- data/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb +303 -0
- data/lib/rails/generators/rails/plugin_new/templates/%name%.gemspec +9 -0
- data/lib/rails/generators/rails/plugin_new/templates/Gemfile +11 -0
- data/lib/rails/generators/rails/plugin_new/templates/MIT-LICENSE +20 -0
- data/lib/rails/generators/rails/plugin_new/templates/README.rdoc +3 -0
- data/lib/rails/generators/rails/plugin_new/templates/Rakefile +21 -0
- data/lib/rails/generators/rails/plugin_new/templates/app/controllers/%name%/application_controller.rb.tt +4 -0
- data/lib/rails/generators/rails/plugin_new/templates/app/helpers/%name%/application_helper.rb.tt +4 -0
- data/lib/rails/generators/rails/plugin_new/templates/app/models/.empty_directory +0 -0
- data/lib/rails/generators/rails/plugin_new/templates/config/routes.rb +6 -0
- data/lib/rails/generators/rails/plugin_new/templates/gitignore +6 -0
- data/lib/rails/generators/rails/plugin_new/templates/lib/%name%.rb +6 -0
- data/lib/rails/generators/rails/plugin_new/templates/lib/%name%/engine.rb +7 -0
- data/lib/rails/generators/rails/plugin_new/templates/lib/tasks/%name%_tasks.rake +4 -0
- data/lib/rails/generators/rails/plugin_new/templates/rails/application.rb +16 -0
- data/lib/rails/generators/rails/plugin_new/templates/rails/boot.rb +10 -0
- data/lib/rails/generators/rails/plugin_new/templates/rails/routes.rb +4 -0
- data/lib/rails/generators/rails/plugin_new/templates/script/rails.tt +5 -0
- data/lib/rails/generators/rails/plugin_new/templates/test/%name%_test.rb +7 -0
- data/lib/rails/generators/rails/plugin_new/templates/test/integration/navigation_test.rb +12 -0
- data/lib/rails/generators/rails/plugin_new/templates/test/test_helper.rb +10 -0
- data/lib/rails/generators/rails/resource/resource_generator.rb +2 -2
- data/lib/rails/generators/rails/scaffold/scaffold_generator.rb +20 -1
- data/lib/rails/generators/rails/{stylesheets → scaffold}/templates/scaffold.css +0 -0
- data/lib/rails/generators/rails/scaffold/templates/scaffold.css.scss +58 -0
- data/lib/rails/generators/rails/scaffold_controller/templates/controller.rb +21 -19
- data/lib/rails/generators/resource_helpers.rb +3 -3
- data/lib/rails/generators/test_case.rb +2 -20
- data/lib/rails/generators/test_unit/controller/templates/functional_test.rb +5 -4
- data/lib/rails/generators/test_unit/helper/templates/helper_test.rb +2 -0
- data/lib/rails/generators/test_unit/integration/templates/integration_test.rb +3 -4
- data/lib/rails/generators/test_unit/mailer/templates/functional_test.rb +5 -4
- data/lib/rails/generators/test_unit/model/templates/fixtures.yml +1 -1
- data/lib/rails/generators/test_unit/model/templates/unit_test.rb +5 -4
- data/lib/rails/generators/test_unit/observer/templates/unit_test.rb +5 -4
- data/lib/rails/generators/test_unit/plugin/templates/%file_name%_test.rb.tt +3 -4
- data/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb +7 -5
- data/lib/rails/info.rb +0 -1
- data/lib/rails/paths.rb +119 -65
- data/lib/rails/plugin.rb +18 -19
- data/lib/rails/rack/log_tailer.rb +1 -1
- data/lib/rails/railtie.rb +50 -47
- data/lib/rails/railtie/configurable.rb +20 -10
- data/lib/rails/railtie/configuration.rb +20 -19
- data/lib/rails/source_annotation_extractor.rb +5 -5
- data/lib/rails/tasks.rb +1 -0
- data/lib/rails/tasks/assets.rake +10 -0
- data/lib/rails/tasks/documentation.rake +2 -8
- data/lib/rails/tasks/engine.rake +69 -0
- data/lib/rails/tasks/framework.rake +4 -21
- data/lib/rails/tasks/misc.rake +1 -1
- data/lib/rails/tasks/routes.rake +2 -1
- data/lib/rails/test_help.rb +17 -1
- data/lib/rails/test_unit/railtie.rb +1 -1
- data/lib/rails/test_unit/testing.rake +8 -3
- data/lib/rails/version.rb +3 -3
- metadata +128 -100
- checksums.yaml +0 -7
- data/lib/rails/application/configurable.rb +0 -19
- data/lib/rails/console/sandbox.rb +0 -6
- data/lib/rails/deprecation.rb +0 -41
- data/lib/rails/engine/configurable.rb +0 -25
- data/lib/rails/generators/rails/app/templates/config/databases/jdbc.yml +0 -62
- data/lib/rails/generators/rails/app/templates/public/javascripts/application.js +0 -2
- data/lib/rails/generators/rails/app/templates/public/javascripts/controls.js +0 -965
- data/lib/rails/generators/rails/app/templates/public/javascripts/dragdrop.js +0 -974
- data/lib/rails/generators/rails/app/templates/public/javascripts/effects.js +0 -1123
- data/lib/rails/generators/rails/app/templates/public/javascripts/prototype.js +0 -6001
- data/lib/rails/generators/rails/app/templates/public/javascripts/rails.js +0 -202
- data/lib/rails/generators/rails/stylesheets/USAGE +0 -5
- data/lib/rails/generators/rails/stylesheets/stylesheets_generator.rb +0 -9
- data/lib/rails/info_routes.rb +0 -3
@@ -1,20 +1,16 @@
|
|
1
1
|
source 'http://rubygems.org'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
gem '
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
<% unless options[:skip_active_record] -%>
|
16
|
-
gem '<%= gem_for_database %>'<%= ", '#{version_constraint_for_database_gem}'" if version_constraint_for_database_gem %>
|
17
|
-
<% end -%>
|
3
|
+
<%= rails_gemfile_entry -%>
|
4
|
+
|
5
|
+
<%= database_gemfile_entry -%>
|
6
|
+
|
7
|
+
# Asset template engines
|
8
|
+
<%= "gem 'json'\n" if RUBY_VERSION < "1.9.2" -%>
|
9
|
+
gem 'sass'
|
10
|
+
gem 'coffee-script'
|
11
|
+
gem 'uglifier'
|
12
|
+
|
13
|
+
<%= gem_for_javascript %>
|
18
14
|
|
19
15
|
# Use unicorn as the web server
|
20
16
|
# gem 'unicorn'
|
@@ -22,19 +18,7 @@ gem '<%= gem_for_database %>'<%= ", '#{version_constraint_for_database_gem}'" if
|
|
22
18
|
# Deploy with Capistrano
|
23
19
|
# gem 'capistrano'
|
24
20
|
|
25
|
-
# To use debugger
|
26
|
-
#
|
27
|
-
|
28
|
-
|
29
|
-
# Bundle the extra gems:
|
30
|
-
# gem 'bj'
|
31
|
-
# gem 'nokogiri'
|
32
|
-
# gem 'sqlite3-ruby', :require => 'sqlite3'
|
33
|
-
# gem 'aws-s3', :require => 'aws/s3'
|
34
|
-
|
35
|
-
# Bundle gems for the local environment. Make sure to
|
36
|
-
# put test-only gems in this group so their generators
|
37
|
-
# and rake tasks are available in development mode:
|
38
|
-
# group :development, :test do
|
39
|
-
# gem 'webrat'
|
40
|
-
# end
|
21
|
+
# To use debugger
|
22
|
+
# <%= gem_for_ruby_debugger %>
|
23
|
+
|
24
|
+
<%= gem_for_turn -%>
|
@@ -91,7 +91,7 @@ mode. With gems, use <tt>sudo gem install ruby-debug</tt>. Example:
|
|
91
91
|
|
92
92
|
class WeblogController < ActionController::Base
|
93
93
|
def index
|
94
|
-
@posts = Post.
|
94
|
+
@posts = Post.all
|
95
95
|
debugger
|
96
96
|
end
|
97
97
|
end
|
@@ -139,7 +139,7 @@ To reload your controllers and models after launching the console run
|
|
139
139
|
<tt>reload!</tt>
|
140
140
|
|
141
141
|
More information about irb can be found at:
|
142
|
-
link:http://www.rubycentral.
|
142
|
+
link:http://www.rubycentral.org/pickaxe/irb.html
|
143
143
|
|
144
144
|
|
145
145
|
== dbconsole
|
@@ -1,7 +1,7 @@
|
|
1
|
+
#!/usr/bin/env rake
|
1
2
|
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
2
3
|
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
3
4
|
|
4
5
|
require File.expand_path('../config/application', __FILE__)
|
5
|
-
require 'rake'
|
6
6
|
|
7
7
|
<%= app_const %>.load_tasks
|
File without changes
|
@@ -0,0 +1,8 @@
|
|
1
|
+
// FIXME: Tell people that this is a manifest file, real code should go into discrete files
|
2
|
+
// FIXME: Tell people how Sprockets and CoffeeScript works
|
3
|
+
//
|
4
|
+
<% unless options[:skip_javascript] -%>
|
5
|
+
//= require <%= options[:javascript] %>
|
6
|
+
//= require <%= options[:javascript] %>_ujs
|
7
|
+
<% end -%>
|
8
|
+
//= require_tree .
|
File without changes
|
File without changes
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
2
|
<html>
|
3
3
|
<head>
|
4
|
-
<title><%=
|
5
|
-
<%%= stylesheet_link_tag
|
6
|
-
<%%= javascript_include_tag
|
7
|
-
<%%=
|
4
|
+
<title><%= camelized %></title>
|
5
|
+
<%%= stylesheet_link_tag "application" %>
|
6
|
+
<%%= javascript_include_tag "application" %>
|
7
|
+
<%%= csrf_meta_tags %>
|
8
8
|
</head>
|
9
9
|
<body>
|
10
10
|
|
@@ -39,11 +39,19 @@ module <%= app_const_base %>
|
|
39
39
|
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
40
40
|
# config.i18n.default_locale = :de
|
41
41
|
|
42
|
+
# Please note that JavaScript expansions are *ignored altogether* if the asset
|
43
|
+
# pipeline is enabled (see config.assets.enabled below). Put your defaults in
|
44
|
+
# app/assets/javascripts/application.js in that case.
|
45
|
+
#
|
42
46
|
# JavaScript files you want as :defaults (application.js is always included).
|
43
|
-
<% if options[:
|
44
|
-
config.action_view.javascript_expansions[:defaults] = %w()
|
47
|
+
<% if options[:skip_javascript] -%>
|
48
|
+
# config.action_view.javascript_expansions[:defaults] = %w()
|
45
49
|
<% else -%>
|
46
|
-
# config.action_view.javascript_expansions[:defaults] = %w(
|
50
|
+
# config.action_view.javascript_expansions[:defaults] = %w(prototype prototype_ujs)
|
51
|
+
<% end -%>
|
52
|
+
|
53
|
+
<% if options[:skip_test_unit] -%>
|
54
|
+
config.generators.test_framework = false
|
47
55
|
<% end -%>
|
48
56
|
|
49
57
|
# Configure the default encoding used in templates for Ruby 1.9.
|
@@ -51,5 +59,13 @@ module <%= app_const_base %>
|
|
51
59
|
|
52
60
|
# Configure sensitive parameters which will be filtered from the log file.
|
53
61
|
config.filter_parameters += [:password]
|
62
|
+
|
63
|
+
<% unless options[:skip_active_record] -%>
|
64
|
+
# Enable IdentityMap for Active Record, to disable set to false or remove the line below.
|
65
|
+
config.active_record.identity_map = true
|
66
|
+
<% end -%>
|
67
|
+
|
68
|
+
# Enable the asset pipeline
|
69
|
+
config.assets.enabled = true
|
54
70
|
end
|
55
71
|
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
# And be sure to use new-style password hashing:
|
7
7
|
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
|
8
8
|
development:
|
9
|
-
adapter:
|
9
|
+
adapter: jdbcmysql
|
10
10
|
database: <%= app_name %>_development
|
11
11
|
username: root
|
12
12
|
password:
|
@@ -16,15 +16,15 @@ development:
|
|
16
16
|
# re-generated from your development database when you run "rake".
|
17
17
|
# Do not set this db to the same as development or production.
|
18
18
|
test:
|
19
|
-
adapter:
|
19
|
+
adapter: jdbcmysql
|
20
20
|
database: <%= app_name %>_test
|
21
21
|
username: root
|
22
22
|
password:
|
23
23
|
host: localhost
|
24
24
|
|
25
25
|
production:
|
26
|
-
adapter:
|
26
|
+
adapter: jdbcmysql
|
27
27
|
database: <%= app_name %>_production
|
28
28
|
username: root
|
29
29
|
password:
|
30
|
-
host: localhost
|
30
|
+
host: localhost
|
@@ -1,10 +1,15 @@
|
|
1
1
|
# PostgreSQL. Versions 7.4 and 8.x are supported.
|
2
2
|
#
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
# Install the pg driver:
|
4
|
+
# gem install pg
|
5
|
+
# On Mac OS X with macports:
|
6
|
+
# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
|
7
|
+
# On Windows:
|
8
|
+
# gem install pg
|
9
|
+
# Choose the win32 build.
|
10
|
+
# Install PostgreSQL and put its /bin directory on your path.
|
6
11
|
development:
|
7
|
-
adapter:
|
12
|
+
adapter: jdbcpostgresql
|
8
13
|
encoding: unicode
|
9
14
|
database: <%= app_name %>_development
|
10
15
|
username: <%= app_name %>
|
@@ -29,14 +34,14 @@ development:
|
|
29
34
|
# re-generated from your development database when you run "rake".
|
30
35
|
# Do not set this db to the same as development or production.
|
31
36
|
test:
|
32
|
-
adapter:
|
37
|
+
adapter: jdbcpostgresql
|
33
38
|
encoding: unicode
|
34
39
|
database: <%= app_name %>_test
|
35
40
|
username: <%= app_name %>
|
36
41
|
password:
|
37
42
|
|
38
43
|
production:
|
39
|
-
adapter:
|
44
|
+
adapter: jdbcpostgresql
|
40
45
|
encoding: unicode
|
41
46
|
database: <%= app_name %>_production
|
42
47
|
username: <%= app_name %>
|
@@ -2,16 +2,16 @@
|
|
2
2
|
# gem 'activerecord-jdbcsqlite3-adapter'
|
3
3
|
|
4
4
|
development:
|
5
|
-
adapter:
|
5
|
+
adapter: jdbcsqlite3
|
6
6
|
database: db/development.sqlite3
|
7
7
|
|
8
8
|
# Warning: The database defined as "test" will be erased and
|
9
9
|
# re-generated from your development database when you run "rake".
|
10
10
|
# Do not set this db to the same as development or production.
|
11
11
|
test:
|
12
|
-
adapter:
|
12
|
+
adapter: jdbcsqlite3
|
13
13
|
database: db/test.sqlite3
|
14
14
|
|
15
15
|
production:
|
16
|
-
adapter:
|
16
|
+
adapter: jdbcsqlite3
|
17
17
|
database: db/production.sqlite3
|
@@ -10,7 +10,7 @@
|
|
10
10
|
#
|
11
11
|
# By default prefetch_rows (OCI_ATTR_PREFETCH_ROWS) is set to 100. And
|
12
12
|
# until true bind variables are supported, cursor_sharing is set by default
|
13
|
-
# to 'similar'. Both can be changed in the
|
13
|
+
# to 'similar'. Both can be changed in the configuration below; the defaults
|
14
14
|
# are equivalent to specifying:
|
15
15
|
#
|
16
16
|
# prefetch_rows: 100
|
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
# In the development environment your application's code is reloaded on
|
5
5
|
# every request. This slows down response time but is perfect for development
|
6
|
-
# since you don't have to restart the
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
7
7
|
config.cache_classes = false
|
8
8
|
|
9
9
|
# Log error messages when you accidentally call methods on nil.
|
@@ -11,7 +11,6 @@
|
|
11
11
|
|
12
12
|
# Show full error reports and disable caching
|
13
13
|
config.consider_all_requests_local = true
|
14
|
-
config.action_view.debug_rjs = true
|
15
14
|
config.action_controller.perform_caching = false
|
16
15
|
|
17
16
|
# Don't care if the mailer can't send
|
@@ -1,7 +1,6 @@
|
|
1
1
|
<%= app_const %>.configure do
|
2
2
|
# Settings specified here will take precedence over those in config/application.rb
|
3
3
|
|
4
|
-
# The production environment is meant for finished, "live" apps.
|
5
4
|
# Code is not reloaded between requests
|
6
5
|
config.cache_classes = true
|
7
6
|
|
@@ -9,14 +8,19 @@
|
|
9
8
|
config.consider_all_requests_local = false
|
10
9
|
config.action_controller.perform_caching = true
|
11
10
|
|
12
|
-
#
|
13
|
-
config.
|
11
|
+
# Disable Rails's static asset server (Apache or nginx will already do this)
|
12
|
+
config.serve_static_assets = false
|
14
13
|
|
15
|
-
#
|
16
|
-
|
14
|
+
# Compress both stylesheets and JavaScripts
|
15
|
+
config.assets.js_compressor = :uglifier
|
16
|
+
config.assets.css_compressor = :scss
|
17
|
+
|
18
|
+
# Specifies the header that your server uses for sending files
|
19
|
+
# (comment out if your front-end server doesn't support this)
|
20
|
+
config.action_dispatch.x_sendfile_header = "X-Sendfile" # Use 'X-Accel-Redirect' for nginx
|
17
21
|
|
18
|
-
#
|
19
|
-
#
|
22
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
23
|
+
# config.force_ssl = true
|
20
24
|
|
21
25
|
# See everything in the log (default is :info)
|
22
26
|
# config.log_level = :debug
|
@@ -27,13 +31,12 @@
|
|
27
31
|
# Use a different cache store in production
|
28
32
|
# config.cache_store = :mem_cache_store
|
29
33
|
|
30
|
-
# Disable Rails's static asset server
|
31
|
-
# In production, Apache or nginx will already do this
|
32
|
-
config.serve_static_assets = false
|
33
|
-
|
34
34
|
# Enable serving of images, stylesheets, and javascripts from an asset server
|
35
35
|
# config.action_controller.asset_host = "http://assets.example.com"
|
36
36
|
|
37
|
+
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
38
|
+
# config.assets.precompile += %w( search.js )
|
39
|
+
|
37
40
|
# Disable delivery errors, bad email addresses will be ignored
|
38
41
|
# config.action_mailer.raise_delivery_errors = false
|
39
42
|
|
@@ -7,7 +7,11 @@
|
|
7
7
|
# and recreated between test runs. Don't rely on the data there!
|
8
8
|
config.cache_classes = true
|
9
9
|
|
10
|
-
#
|
10
|
+
# Configure static asset server for tests with Cache-Control for performance
|
11
|
+
config.serve_static_assets = true
|
12
|
+
config.static_cache_control = "public, max-age=3600"
|
13
|
+
|
14
|
+
# Log error messages when you accidentally call methods on nil
|
11
15
|
config.whiny_nils = true
|
12
16
|
|
13
17
|
# Show full error reports and disable caching
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Be sure to restart your server when you modify this file.
|
2
2
|
|
3
|
-
<%= app_const %>.config.session_store :cookie_store, :key
|
3
|
+
<%= app_const %>.config.session_store :cookie_store, <%= key_value :key, "'_#{app_name}_session'" %>
|
4
4
|
|
5
5
|
# Use the database for sessions instead of the cookie-based default,
|
6
6
|
# which shouldn't be used to store highly confidential information
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
#
|
3
|
+
# This file contains the settings for ActionController::ParametersWrapper
|
4
|
+
# which will be enabled by default in the upcoming version of Ruby on Rails.
|
5
|
+
|
6
|
+
# Enable parameter wrapping for JSON. You can disable this by set :format to empty array.
|
7
|
+
ActionController::Base.wrap_parameters :format => [:json]
|
8
|
+
|
9
|
+
# Disable root element in JSON by default.
|
10
|
+
if defined?(ActiveRecord)
|
11
|
+
ActiveRecord::Base.include_root_in_json = false
|
12
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Sample localization file for English. Add more files in this directory for other locales.
|
2
|
-
# See
|
2
|
+
# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
|
3
3
|
|
4
4
|
en:
|
5
5
|
hello: "Hello world"
|
@@ -3,5 +3,5 @@
|
|
3
3
|
#
|
4
4
|
# Examples:
|
5
5
|
#
|
6
|
-
# cities = City.create([{ :name
|
7
|
-
# Mayor.create(:name
|
6
|
+
# cities = City.create([{ <%= key_value :name, "'Chicago'" %> }, { <%= key_value :name, "'Copenhagen'" %> }])
|
7
|
+
# Mayor.create(<%= key_value :name, "'Daley'" %>, <%= key_value :city, "cities.first" %>)
|
@@ -52,7 +52,6 @@
|
|
52
52
|
clear: both;
|
53
53
|
}
|
54
54
|
|
55
|
-
|
56
55
|
#header, #about, #getting-started {
|
57
56
|
padding-left: 75px;
|
58
57
|
padding-right: 30px;
|
@@ -60,7 +59,7 @@
|
|
60
59
|
|
61
60
|
|
62
61
|
#header {
|
63
|
-
background-image: url("
|
62
|
+
background-image: url("/assets/rails.png");
|
64
63
|
background-repeat: no-repeat;
|
65
64
|
background-position: top left;
|
66
65
|
height: 64px;
|
@@ -168,6 +167,9 @@
|
|
168
167
|
margin-bottom: 5px;
|
169
168
|
}
|
170
169
|
|
170
|
+
.filename {
|
171
|
+
font-style: italic;
|
172
|
+
}
|
171
173
|
</style>
|
172
174
|
<script type="text/javascript">
|
173
175
|
function about() {
|
@@ -190,10 +192,10 @@
|
|
190
192
|
<li>
|
191
193
|
<h3>Browse the documentation</h3>
|
192
194
|
<ul class="links">
|
193
|
-
<li><a href="http://api.rubyonrails.org/">Rails API</a></li>
|
194
|
-
<li><a href="http://stdlib.rubyonrails.org/">Ruby standard library</a></li>
|
195
|
-
<li><a href="http://corelib.rubyonrails.org/">Ruby core</a></li>
|
196
195
|
<li><a href="http://guides.rubyonrails.org/">Rails Guides</a></li>
|
196
|
+
<li><a href="http://api.rubyonrails.org/">Rails API</a></li>
|
197
|
+
<li><a href="http://www.ruby-doc.org/core/">Ruby core</a></li>
|
198
|
+
<li><a href="http://www.ruby-doc.org/stdlib/">Ruby standard library</a></li>
|
197
199
|
</ul>
|
198
200
|
</li>
|
199
201
|
</ul>
|
@@ -221,13 +223,13 @@
|
|
221
223
|
</li>
|
222
224
|
|
223
225
|
<li>
|
224
|
-
<h2>Set up a default route and remove
|
225
|
-
<p>Routes are set up in config/routes.rb
|
226
|
+
<h2>Set up a default route and remove <span class="filename">public/index.html</span></h2>
|
227
|
+
<p>Routes are set up in <span class="filename">config/routes.rb</span>.</p>
|
226
228
|
</li>
|
227
229
|
|
228
230
|
<li>
|
229
231
|
<h2>Create your database</h2>
|
230
|
-
<p>Run <code>rake db:
|
232
|
+
<p>Run <code>rake db:create</code> to create your database. If you're not using SQLite (the default), edit <span class="filename">config/database.yml</span> with your username and password.</p>
|
231
233
|
</li>
|
232
234
|
</ol>
|
233
235
|
</div>
|
File without changes
|
File without changes
|