mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge branch 'master' of github.com:lifo/docrails
This commit is contained in:
commit
48b580a03b
6 changed files with 14 additions and 13 deletions
|
@ -193,7 +193,8 @@ module ActionView
|
|||
# number_with_delimiter(12345678) # => 12,345,678
|
||||
# number_with_delimiter(12345678.05) # => 12,345,678.05
|
||||
# number_with_delimiter(12345678, :delimiter => ".") # => 12.345.678
|
||||
# number_with_delimiter(12345678, :separator => ",") # => 12,345,678
|
||||
# number_with_delimiter(12345678, :delimiter => ",") # => 12,345,678
|
||||
# number_with_delimiter(12345678.05, :separator => " ") # => 12,345,678 05
|
||||
# number_with_delimiter(12345678.05, :locale => :fr) # => 12 345 678,05
|
||||
# number_with_delimiter(98765432.98, :delimiter => " ", :separator => ",")
|
||||
# # => 98 765 432,98
|
||||
|
|
|
@ -438,7 +438,7 @@ location ~ ^/assets/ {
|
|||
}
|
||||
</plain>
|
||||
|
||||
When files are precompiled, Sprockets also creates a "gzipped":http://en.wikipedia.org/wiki/Gzip (.gz) version of your assets. Web servers are typically configured to use a moderate compression ratio as a compromise, but since precompilation happens once Sprockets uses the maximum compression ratio, thus reducing the size of the data transfer to the minimum. On the other hand, web servers can be configured to serve compressed content directly from disk, rather than deflating non-compressed files themselves.
|
||||
When files are precompiled, Sprockets also creates a "gzipped":http://en.wikipedia.org/wiki/Gzip (.gz) version of your assets. Web servers are typically configured to use a moderate compression ratio as a compromise, but since precompilation happens once, Sprockets uses the maximum compression ratio, thus reducing the size of the data transfer to the minimum. On the other hand, web servers can be configured to serve compressed content directly from disk, rather than deflating non-compressed files themselves.
|
||||
|
||||
Nginx is able to do this automatically enabling +gzip_static+:
|
||||
|
||||
|
|
|
@ -215,7 +215,7 @@ TIP: You may want to "put your git branch name in your shell prompt":http://qugs
|
|||
|
||||
h3. Helping to Resolve Existing Issues
|
||||
|
||||
As a next step beyond reporting issues, you can help the core team resolve existing issues. If you check the "Everyone's Issues":https://github.com/rails/rails/issues?sort=created&direction=desc&state=open&page=1 list in GitHub Issues, you'll find lots of issues already requiring attention. What can you do for these? Quite a bit, actually:
|
||||
As a next step beyond reporting issues, you can help the core team resolve existing issues. If you check the "Everyone's Issues":https://github.com/rails/rails/issues list in GitHub Issues, you'll find lots of issues already requiring attention. What can you do for these? Quite a bit, actually:
|
||||
|
||||
h4. Verifying Bug Reports
|
||||
|
||||
|
|
|
@ -308,6 +308,14 @@ manually with the application.
|
|||
* The +test+ environment is used when running automated tests.
|
||||
* The +production+ environment is used when you deploy your application for the world to use.
|
||||
|
||||
TIP: You don't have to update the database configurations manually. If you look at the
|
||||
options of the application generator, you will see that one of the options
|
||||
is named <tt>--database</tt>. This option allows you to choose an adapter from a
|
||||
list of the most used relational databases. You can even run the generator
|
||||
repeatedly: <tt>cd .. && rails new blog --database=mysql</tt>. When you confirm the overwriting
|
||||
of the +config/database.yml+ file, your application will be configured for MySQL
|
||||
instead of SQLite. Detailed examples of the common database connections are below.
|
||||
|
||||
h5. Configuring an SQLite3 Database
|
||||
|
||||
Rails comes with built-in support for "SQLite3":http://www.sqlite.org, which is
|
||||
|
@ -411,14 +419,6 @@ development:
|
|||
|
||||
Change the username and password in the +development+ section as appropriate.
|
||||
|
||||
TIP: You don't have to update the database configurations manually. If you look at the
|
||||
options of the application generator, you will see that one of the options
|
||||
is named <tt>--database</tt>. This option allows you to choose an adapter from a
|
||||
list of the most used relational databases. You can even run the generator
|
||||
repeatedly: <tt>cd .. && rails new blog --database=mysql</tt>. When you confirm the overwriting
|
||||
of the +config/database.yml+ file, your application will be configured for MySQL
|
||||
instead of SQLite.
|
||||
|
||||
h4. Creating the Database
|
||||
|
||||
Now that you have your database configured, it's time to have Rails create an
|
||||
|
|
|
@ -231,7 +231,7 @@ end
|
|||
|
||||
Now, when you call the +books_path+ method you should get +"/en/books"+ (for the default locale). An URL like +http://localhost:3001/nl/books+ should load the Netherlands locale, then, and following calls to +books_path+ should return +"/nl/books"+ (because the locale changed).
|
||||
|
||||
If you don't want to force the use of a locale in your routes you can use an optional path scope (donated by the use brackets) like so:
|
||||
If you don't want to force the use of a locale in your routes you can use an optional path scope (denoted by the parentheses) like so:
|
||||
|
||||
<ruby>
|
||||
# config/routes.rb
|
||||
|
|
|
@ -927,7 +927,7 @@ class UserControllerTest < ActionController::TestCase
|
|||
assert_difference 'ActionMailer::Base.deliveries.size', +1 do
|
||||
post :invite_friend, :email => 'friend@example.com'
|
||||
end
|
||||
invite_email = ActionMailer::Base.deliveries.first
|
||||
invite_email = ActionMailer::Base.deliveries.last
|
||||
|
||||
assert_equal "You have been invited by me@example.com", invite_email.subject
|
||||
assert_equal 'friend@example.com', invite_email.to[0]
|
||||
|
|
Loading…
Reference in a new issue