RFC 9110 specifies:
The server MUST send an Upgrade header field in a 426 response
to indicate the required protocol(s)
https://httpwg.org/specs/rfc9110.html#status.426
Status 406 Not Acceptable is more appropriate because it indicates the
resource
does not have a current representation that would be acceptable
to the user agent, according to the proactive negotiation header
fields received in the request
https://httpwg.org/specs/rfc9110.html#status.406
With the proactive negociation section mentionining:
implicit characteristics, such as the client's network address
or parts of the User-Agent field.
https://httpwg.org/specs/rfc9110.html#proactive.negotiation
The `:to` option for routes can once again be a String without a
controller if the controller is implicitly provided by a nesting
`controller` or `resources` call.
form_helper API documentation using `article` instead of `post`.
This makes the docs clearer and more inline with the guides,
while also disambiguating the `method=post` added to forms
for extra clarity.
[ci skip]
Documentation previously uses post which is confusing as the
methods/verb is also post.
Before
<form action="/posts" method="post">
After
<form action="/articles" method="post">
Method
Worked through a new Rails app with scaffold of article
and checking the output of the HTML. Other HTML changes
make it more authentic:
/> => at the end of the input
This commit addresses Rails Nightly CI failure
at https://buildkite.com/rails/rails-nightly/builds/391#018ec54f-a2ef-40de-9749-6cc3ecae4ebd/1368-1376
```ruby
$ ruby -v
ruby 3.4.0dev (2024-04-09T16:29:01Z master 0107954f25) [x86_64-linux]
$ bin/test test/command/help_integration_test.rb:33
Run options: --seed 3363
F
Failure:
Rails::Command::HelpIntegrationTest#test_prints_help_via_`X:help`_command_when_running_`X`_and_`X:X`_command_is_not_defined [test/command/help_integration_test.rb:37]:
--- expected
+++ actual
@@ -1,4 +1,5 @@
-"Commands:
+"/home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.4.0+0/gems/zeitwerk-2.6.13/lib/zeitwerk/kernel.rb:34: warning: ostruct was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.5.0. Add ostruct to your Gemfile or gemspec.
+Commands:
bin/rails dev:cache # Toggle development mode caching on/off
bin/rails dev:help [COMMAND] # Describe available commands or one specific...
bin/test test/command/help_integration_test.rb:33
Finished in 0.738986s, 1.3532 runs/s, 1.3532 assertions/s.
1 runs, 1 assertions, 1 failures, 0 errors, 0 skips
$
```
This commit can be reverted once both rack and jbuilder take care of it.
Related to
https://github.com/rack/rack/pull/2166https://github.com/rails/jbuilder/issues/561
Fix: https://github.com/rails/rails/pull/51426#issuecomment-2042611790
`perform_later` is supposed to return the Job instance on success,
and `false` on error.
When the `enqueue` is automatically delayed, it's of course impossible
to predict if the actual queueing will succeed, but for backward compatibility
reasons, it's best to assume it will.
If necessary, you can hold onto the job instance and check for
`#successfully_enqueued?` after the transaction has completed.
Similar to 50515fb45f36dfad067adbdda9fee41fcb326ca9, make sure we
require `ostruct` where we use `OpenStruct`, to get the build back to
green, while we work to remove its usage on tests. (see #51510.)
Sample error:
```
Error:
ActiveRecord::Encryption::ConfigurableTest#test_installing_autofiltered_parameters_will_add_the_encrypted_attribute_as_a_filter_parameter_using_the_dot_notation:
NameError: uninitialized constant ActiveRecord::Encryption::ConfigurableTest::OpenStruct
test/cases/encryption/configurable_test.rb:45:in `block in <class:ConfigurableTest>'
```
Remove example filepaths from code blocks in guides when using the copy button.
Some code examples use commented out paths for the path where the code should be written to. These paths can be ignored in the clipboard when using the "copy" button.
`ostruct` was being implictly required by the `json` gem. But once it
was upgraded, these tests failed to initialize `OpenStruct`.
While we're trying to remove `ostruct` usage in #51510, CI is currently
failing so I'm pushing these in the mean time.
Some code examples use commented out paths for the path where the code
should be written to. These paths can be ignored in the clipboard when
using the "copy" button.
Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
Review and improve the Action View Helpers guide.
- Reorganize sections, in most cases moving most commonly used helpers up, grouping some of the formatting ones together
- Expand with more examples and a few new methods
- Link back to the API of each helper whenever possible
- Remove WIP
Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
This is useful for testing changes to how the devcontainer is generated, and will be necessary for creating a CI workflow for testing the devcontainer setup.