| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|\
| |
| | |
wrapping i18n missing keys made optional
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
`I18n.translate` helper will wrap the missing translation keys
in a <span> tag only if `debug_missing_translation` configuration has
a truthy value. Default value is `true`. For example in `application.rb`:
# in order to turn off missing key wrapping
config.action_view.debug_missing_translation = false
|
|/
|
|
| |
Still more to do. Please assist!
|
| |
|
|
|
|
| |
[ci skip]
|
|
|
|
|
|
|
| |
This is a pass over the documentation which fills the missing gaps of
`ApplicationRecord`.
[ci skip]
|
|
|
|
| |
[ci skip]
|
|\
| |
| | |
Add `redirect_to_back_or_default`
|
| |
| |
| |
| |
| |
| |
| | |
Applications that use `redirect_to :back` can be forced to 500 by
clients that do not send the HTTP `Referer` (sic) header.
`redirect_back` requires the user to consider this possibility up front
and avoids this trivially-caused application error.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
`redirect_to :back` is a somewhat common pattern in Rails apps, but it
is not completely safe. There are a number of circumstances where HTTP
referrer information is not available on the request. This happens often
with bot traffic and occasionally to user traffic depending on browser
security settings.
When there is no referrer available on the request, `redirect_to :back`
will raise `ActionController::RedirectBackError`, usually resulting in
an application error.
`redirect_back` takes a required `fallback_location` keyword argument
that specifies the redirect when the referrer information is not
available. This prevents 500 errors caused by
`ActionController::RedirectBackError`.
|
|\ \
| |/
|/| |
Introduce ApplicationRecord, an Active Record layer supertype
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It's pretty common for folks to monkey patch `ActiveRecord::Base` to
work around an issue or introduce extra functionality. Instead of
shoving even more stuff in `ActiveRecord::Base`, `ApplicationRecord` can
hold all those custom work the apps may need.
Now, we don't wanna encourage all of the application models to inherit
from `ActiveRecord::Base`, but we can encourage all the models that do,
to inherit from `ApplicationRecord`.
Newly generated applications have `app/models/application_record.rb`
present by default. The model generators are smart enough to recognize
that newly generated models have to inherit from `ApplicationRecord`,
but only if it's present.
|
|\ \
| | |
| | | |
Fix a couple of grammatical errors in security.md
|
| |/ |
|
|/
|
|
|
| |
The previous title was misleading.
[ci skip]
|
|
|
|
|
| |
Even though this means more things to change when we bump after a
release, it's more important that our examples are directly copyable.
|
|
|
|
|
|
|
|
|
|
| |
If we use a real version, at best that'll be an onerous update required
for each release; at worst, it will encourage users to write new
migrations against an older version than they're using.
The other option would be to leave these bare, without any version
specifier. But as that's just a variant spelling of "4.2", it would seem
to raise the same concerns as above.
|
|\ |
|
|/
|
|
|
|
|
| |
Allows any Rake task to be run through `bin/rails` such as `bin/rails db:migrate`,
`bin/rails notes` etc.
The Rake tasks are appended to Rails' help output, and blend in as standard commands.
|
|\
| |
| | |
Fix paintIt method in JavaScript guides [ci skip]
|
| |
| |
| |
| |
| |
| | |
- Changed "paintIt" to "@paintIt" so that it can be called in an on
click handler.
- Closes #22568
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Before this commit, the sole presence of the Listen constant
enabled the evented file watcher (unless listen resorted to
the polling backend).
This way, applications may depend on listen for other stuff
independently of this feature. Also, allows teams with mixed
setups to decide at boot time whether the evented watcher
should be enabled for each particular instance.
|
| |
| |
| | |
Tiny typo in the testing guide; articules should be articles.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In Rails 5.1 `ActionController::TestCase` will be moved out of Rails
into it's own gem.
Please use `ActionDispatch::IntegrationTest` going foward.
Because this will be moved to a gem I used `# :stopdoc:` instead of
deleting the documentation. This will remove it from the Rails
documentation but still leave the method documented for when we move it
to a gem.
Guides have been updated to use the routing structure used in Integration
and all test examples have been updated to inherit from
`ActionDispatch::IntegrationTest` instead of `ActionController::TestCase.
Fixes #22496
|
|\
| |
| | |
fix links to code of conduct [ci skip]
|
| |
| |
| |
| | |
CoC text has been moved to the Rails website in 90bcb6d
|
|\ \
| |/
|/|
| | |
Adding Enums section to AR Querying. [ci skip]
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Those are actually shortcuts for `after_commit`.
Before:
after_commit :add_to_index_later, on: :create
after_commit :update_in_index_later, on: :update
after_commit :remove_from_index_later, on: :destroy
After:
after_create_commit :add_to_index_later
after_update_commit :update_in_index_later
after_destroy_commit :remove_from_index_later
|
|
|
| |
Fixed a typo
|
|\
| |
| | |
Modify unscoped usage guide to include chaining [ci skip]
|
| | |
|
|\ \
| | |
| | |
| | | |
Document message validation option accepts Proc [ci skip]
|
| | | |
|
|\ \ \
| | | |
| | | | |
[ci skip] add `controller:` argument to routing.md
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Passing a `Symbol` to the `to:` argument for a `get` route requires a `controller` argument to also be defined.
The documentation is missing the `controller:` argument, which leaving out raises a routing exception:
```ruby
get 'profile', to: :show
```
```
$ rake routes
ArgumentError: Missing :controller key on routes definition, please check your routes.
```
Adding the `controller:` argument maps the route correctly:
```ruby
get 'profile', to: :show, controller: 'users'
```
```
$ rake routes
profile GET /profile(.:format) users#show
```
|
|\ \ \ \
| |_|/ /
|/| | | |
Fix set_autoload_paths and set_load_path document [ci skip]
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
Add option to verify Origin header in CSRF checks
[Jeremy Daer + Rafael Mendonça França]
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Update the valgrind debugging documentation to remove the notes about being
linux only as 3.11.0[1] introduces preliminary support for Mac OSX 10.11 (El
Capitan).
[1]: http://valgrind.org/docs/manual/dist.news.html
|
| |_|_|/
|/| | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Docrails is private now (6cb1b6724c313c608cf4063fc22886faa19df9be),
anyone who does not have access right to docrails can't read
"Translating Rails Guides" in wiki of docrails.
To prevent someone from giving up to translate, publish them on Rails Guide.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Use an example from a default Rails app (4.2.5) rather than an outdated one in the Configuring Rails Components section.
I picked config.time_zone as it currently is the only 'setting for Rails' left in a default config/application.rb.
I stumbled upon this with investigating autoloading in a legacy app, which still included the example comment "# config.autoload_paths += %W(#{config.root}/extras)". Usually adding app/* directories to autoload_paths isn't necessary, so also finding this example within the current docs was a bit confusing initially.
[ci skip]
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
[ci skip]
Since the "Getting Started" guide no longer uses the scaffold generator
we should rewrite references to that in the testing guide.
The functional testing section was quite heavily based on such a
scaffold test. I changed it to use `generate scaffold_controller`
instead so that we can build up on the model foundation we already have.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This reverts commit 16ce41b7f4449d6df15df30d69aef18da6510f36.
Reason: See
https://github.com/rails/rails/commit/16ce41b7f4449d6df15df30d69aef18da6510f36#commitcomment-14475125
|
| | | | |
|
| |/ /
|/| | |
|