aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails')
-rw-r--r--railties/lib/rails/generators/rails/app/templates/README12
-rw-r--r--railties/lib/rails/generators/rails/app/templates/config/application.rb7
-rw-r--r--railties/lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb2
-rw-r--r--railties/lib/rails/generators/rails/app/templates/config/initializers/locale.rb2
-rw-r--r--railties/lib/rails/generators/rails/controller/USAGE2
-rw-r--r--railties/lib/rails/generators/rails/model/USAGE14
-rw-r--r--railties/lib/rails/templates/rails/welcome/index.html.erb9
7 files changed, 23 insertions, 25 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/README b/railties/lib/rails/generators/rails/app/templates/README
index 0ca71e3050..2bd7c27f2a 100644
--- a/railties/lib/rails/generators/rails/app/templates/README
+++ b/railties/lib/rails/generators/rails/app/templates/README
@@ -57,7 +57,7 @@ shown in the browser on requests from 127.0.0.1.
You can also log your own messages directly into the log file from your code
using the Ruby logger class from inside your controllers. Example:
- class WeblogController < ActionController::Base
+ class WeblogsController < ActionController::Base
def destroy
@weblog = Weblog.find(params[:id])
@weblog.destroy
@@ -89,7 +89,7 @@ execution at any point in the code, investigate and change the model, and then,
resume execution! You need to install the 'debugger' gem to run the server in debugging
mode. Add gem 'debugger' to your Gemfile and run <tt>bundle</tt> to install it. Example:
- class WeblogController < ActionController::Base
+ class PostsController < ActionController::Base
def index
@posts = Post.all
debugger
@@ -100,17 +100,15 @@ So the controller will accept the action, run the first line, then present you
with a IRB prompt in the server window. Here you can do things like:
>> @posts.inspect
- => "[#<Post:0x14a6be8
- @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>,
- #<Post:0x14a6620
- @attributes={"title"=>"Rails", "body"=>"Only ten..", "id"=>"2"}>]"
+ => "#<ActiveRecord::Relation [#<Post id: 1, title: nil, body: nil>,
+ #<Post id: 2, title: \"Rails\", body: "Only ten..">]>"
>> @posts.first.title = "hello from a debugger"
=> "hello from a debugger"
...and even better, you can examine how your runtime objects actually work:
>> f = @posts.first
- => #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
+ => #<Post id: 1, title: nil, body: nil>
>> f.
Display all 152 possibilities? (y or n)
diff --git a/railties/lib/rails/generators/rails/app/templates/config/application.rb b/railties/lib/rails/generators/rails/app/templates/config/application.rb
index 1122d8f6a5..f5d7d698a3 100644
--- a/railties/lib/rails/generators/rails/app/templates/config/application.rb
+++ b/railties/lib/rails/generators/rails/app/templates/config/application.rb
@@ -22,13 +22,8 @@ module <%= app_const_base %>
# Custom directories with classes and modules you want to be autoloadable.
# config.autoload_paths += %W(#{config.root}/extras)
-
- # Use SQL instead of Active Record's schema dumper when creating the database.
- # This is necessary if your schema can't be completely dumped by the schema dumper,
- # like if you have constraints or database-specific column types.
- # config.active_record.schema_format = :sql
-
<% if options.skip_sprockets? -%>
+
# Disable the asset pipeline.
config.assets.enabled = false
<% end -%>
diff --git a/railties/lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb b/railties/lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb
index e203fcee0a..4a994e1e7b 100644
--- a/railties/lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb
+++ b/railties/lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb
@@ -1,2 +1,4 @@
+# Be sure to restart your server when you modify this file.
+
# Configure sensitive parameters which will be filtered from the log file.
Rails.application.config.filter_parameters += [:password]
diff --git a/railties/lib/rails/generators/rails/app/templates/config/initializers/locale.rb b/railties/lib/rails/generators/rails/app/templates/config/initializers/locale.rb
index a8285f88ca..d89dac7c6a 100644
--- a/railties/lib/rails/generators/rails/app/templates/config/initializers/locale.rb
+++ b/railties/lib/rails/generators/rails/app/templates/config/initializers/locale.rb
@@ -1,3 +1,5 @@
+# Be sure to restart your server when you modify this file.
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# Rails.application.config.time_zone = 'Central Time (US & Canada)'
diff --git a/railties/lib/rails/generators/rails/controller/USAGE b/railties/lib/rails/generators/rails/controller/USAGE
index 9def4af65c..64239ad599 100644
--- a/railties/lib/rails/generators/rails/controller/USAGE
+++ b/railties/lib/rails/generators/rails/controller/USAGE
@@ -6,7 +6,7 @@ Description:
path like 'parent_module/controller_name'.
This generates a controller class in app/controllers and invokes helper,
- template engine and test framework generators.
+ template engine, assets, and test framework generators.
Example:
`rails generate controller CreditCards open debit credit close`
diff --git a/railties/lib/rails/generators/rails/model/USAGE b/railties/lib/rails/generators/rails/model/USAGE
index e29e19490e..6574200fbf 100644
--- a/railties/lib/rails/generators/rails/model/USAGE
+++ b/railties/lib/rails/generators/rails/model/USAGE
@@ -21,12 +21,12 @@ Description:
Available field types:
- Just after the field name you can specify a type like text or boolean.
+ Just after the field name you can specify a type like text or boolean.
It will generate the column with the associated SQL type. For instance:
`rails generate model post title:string body:text`
- will generate a title column with a varchar type and a body column with a text
+ will generate a title column with a varchar type and a body column with a text
type. You can use the following types:
integer
@@ -57,16 +57,16 @@ Available field types:
limit Set the maximum size of the field giving a number between curly braces
default Set a default value for the field
- precision Defines the precision for the decimal fields
+ precision Defines the precision for the decimal fields
scale Defines the scale for the decimal fields
- uniq Defines the field values as unique
+ uniq Defines the field values as unique
index Will add an index on the field
Examples:
`rails generate model user pseudo:string{30}`
`rails generate model user pseudo:string:uniq`
-
+
Examples:
`rails generate model account`
@@ -76,7 +76,7 @@ Examples:
Model: app/models/account.rb
Test: test/models/account_test.rb
Fixtures: test/fixtures/accounts.yml
- Migration: db/migrate/XXX_add_accounts.rb
+ Migration: db/migrate/XXX_create_accounts.rb
`rails generate model post title:string body:text published:boolean`
@@ -90,5 +90,5 @@ Examples:
Model: app/models/admin/account.rb
Test: test/models/admin/account_test.rb
Fixtures: test/fixtures/admin/accounts.yml
- Migration: db/migrate/XXX_add_admin_accounts.rb
+ Migration: db/migrate/XXX_create_admin_accounts.rb
diff --git a/railties/lib/rails/templates/rails/welcome/index.html.erb b/railties/lib/rails/templates/rails/welcome/index.html.erb
index 17174e72c0..abe705618a 100644
--- a/railties/lib/rails/templates/rails/welcome/index.html.erb
+++ b/railties/lib/rails/templates/rails/welcome/index.html.erb
@@ -173,17 +173,18 @@
</style>
<script>
function about() {
- var info = document.getElementById('about-content');
+ var info = document.getElementById('about-content'),
+ xhr;
- if (info.innerHTML == '') {
- var xhr = new XMLHttpRequest();
+ if (info.innerHTML === '') {
+ xhr = new XMLHttpRequest();
xhr.open("GET", "rails/info/properties", false);
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
xhr.send("");
info.innerHTML = xhr.responseText;
}
- info.style.display = info.style.display == 'none' ? 'block' : 'none';
+ info.style.display = info.style.display === 'none' ? 'block' : 'none';
}
</script>
</head>