schneems
e463351969
Document the namespacing of controller actions per this discussion:
...
https://github.com/rails/journey/issues/40
2012-08-09 10:10:39 -05:00
Egor Homakov
98c18d0058
some tests
2012-08-09 17:12:11 +03:00
Egor Homakov
2a290f7f7c
introduce default_headers config
2012-08-09 16:45:30 +03:00
Aaron Patterson
37a764b8e0
use a sized buffer to prevent the queue being too large
2012-08-08 17:41:50 -07:00
David Heinemeier Hansson
b540f4c1b8
Allow data attributes to be set as a first-level option for form_for, so you can write form_for @record, data: { behavior: 'autosave' }
instead of form_for @record, html: { data: { behavior: 'autosave' } }
*DHH*
2012-08-08 16:36:46 -05:00
David Heinemeier Hansson
4154bf012d
Modernize the documentation for view caching somewhat
2012-08-08 11:25:22 -05:00
Rafael Mendonça França
5d1528740a
Deprecate button_to_function
and link_to_function
helpers.
...
We recommend the use of Unobtrusive JavaScript instead. For example:
link_to "Greeting", "#", :class => "nav_link"
$(function() {
$('.nav_link').click(function() {
// Some complex code
return false;
});
});
or
link_to "Greeting", '#', onclick: "alert('Hello world!'); return false", class: "nav_link"
for simple cases.
This reverts commit 3acdd652e9fe99481c879c84c5807a84eb9ad724.
2012-08-07 20:57:42 -03:00
David Heinemeier Hansson
7dedfded4a
Remove antiquated example code
2012-08-07 18:11:42 -05:00
David Heinemeier Hansson
42c308818b
Remove outdated examples and feature highlights
2012-08-07 18:11:42 -05:00
David Heinemeier Hansson
666d3fd0c1
Revert "Merge pull request #7033 from kron4eg/master". Not a a fan at all of what this makes ERB files look like.
...
This reverts commit 46b8bceedd3e47169c50a04c93161424909c75fb, reversing
changes made to 2f58795e783150f2e1b1f6c64e305703f0061129.
2012-08-07 11:44:24 -05:00
Artiom Di
e82ffeaa0a
Restoring the '%' trim mode for ERb templates, allowing for a leading percent sign on a line to indicate non-inserted Ruby code.
2012-08-07 12:37:56 +03:00
Prem Sichanugrist
0c4c7d94ed
Rearrange example output of javascript_include_tag
2012-08-06 16:45:59 -04:00
Prem Sichanugrist
02c9654b9b
Do not include application.js if it doesn't exists
...
Rails were including 'application.js' to the pack when using
`javascript_include_tag :all` even there's no application.js in the
public directory.
2012-08-06 16:45:10 -04:00
Rafael Mendonça França
5edfc46348
Don't use html_escape
to test the escaping
2012-08-05 21:21:14 -03:00
Rafael Mendonça França
39f4f28993
Add CHANGELOG entry for 3c731a4ad62430100ba0b65bc966aa6dc6280c5f
2012-08-05 21:12:57 -03:00
Xavier Noria
447b6a4e67
removes usage of Object#in? from the code base (the method remains defined by Active Support)
...
Selecting which key extensions to include in active_support/rails
made apparent the systematic usage of Object#in? in the code base.
After some discussion in
5ea6b0df9a
we decided to remove it and use plain Ruby, which seems enough
for this particular idiom.
In this commit the refactor has been made case by case. Sometimes
include? is the natural alternative, others a simple || is the
way you actually spell the condition in your head, others a case
statement seems more appropriate. I have chosen the one I liked
the most in each case.
2012-08-06 00:30:02 +02:00
Andrew White
c5807728d5
Revert "polymorphic_url with an array generates a query string"
...
Passing options as the last value in an array doesn't work with form_for.
This reverts commit 61c8a4d926343903593a27080216af7e4ed81268.
2012-08-04 19:02:58 +01:00
Andrew White
4059423809
Revert "Refactor passing url options via array for polymorphic_url"
...
Passing options as the last value in an array doesn't work with form_for.
This reverts commit 6be564c7a087773cb0b51c54396cc190e4f5c983.
2012-08-04 19:02:57 +01:00
Bogdan Gusiev
9e03c6aab3
RouteSet: cleanup some unneeded compexity
2012-08-04 15:11:10 +03:00
Bogdan Gusiev
d89161e7cc
Renamed _path_segments to _recall
2012-08-04 14:55:00 +03:00
Bogdan Gusiev
422b3d70d5
Simplify logical statement
2012-08-04 14:24:35 +03:00
Andrew White
067efad8af
Merge branch 'polymorphic_url_builds_query_string_with_array'
2012-08-04 11:33:30 +01:00
Andrew White
6be564c7a0
Refactor passing url options via array for polymorphic_url
...
Rather than keep the url options in record_or_hash_or_array, extract it
and reverse merge with options as it may contain important private keys
like `:routing_type`.
Closes #7259
2012-08-04 11:24:53 +01:00
Vijay Dev
3d3fa165e4
Merge branch 'master' of github.com:lifo/docrails
...
Conflicts:
activemodel/lib/active_model/secure_password.rb
activerecord/lib/active_record/associations/collection_proxy.rb
2012-08-04 15:18:35 +05:30
Vijay Dev
b51201242a
copy edits [ci skip]
2012-08-04 15:09:33 +05:30
Romain Tribes
61c8a4d926
polymorphic_url with an array generates a query string
...
Generating an URL with an array of records is now able to build a query
string if the last item of the array is a hash.
2012-08-04 10:04:05 +02:00
Santiago Pastorino
c8a613b978
Add test select_tag escapes prompt
2012-08-03 10:00:55 -03:00
Santiago Pastorino
8f8d8eb146
Use content_tag here instead of manually building HTML
2012-08-03 10:00:55 -03:00
Aaron Patterson
c391919180
make sure the body finishes rendering before checking response closure
2012-08-03 00:27:39 -04:00
Armand du Plessis
c62abed8ca
Collapsed dual checks (one for content headers and one for content) into a single check.
...
Rails includes a single character body to a head(:no_content) response to work around an old Safari bug where headers were ignored if no body sent.
This patch brings the behavior slightly closer to spec if :no_content/204 is explicity requested via a head only response.
Status comparison done on symbolic and numeric values
Not returning any content when responding with head and limited to a status code that explicitly states no content will be returned - 100..199, 204, 205, 304.
2012-08-02 16:01:08 -07:00
Rafael Mendonça França
6e523766d8
Merge pull request #7240 from steveklabnik/fix_2301
...
Fix for digest authentication bug - issue #2301 in rails/rails
2012-08-02 13:50:54 -07:00
Steve Klabnik
6beaafd0c4
Changelog entry for Digest Auth fix ( #2301 )
2012-08-02 16:46:41 -04:00
Xavier Noria
077372b20d
load active_support/deprecation in active_support/rails
2012-08-02 21:59:23 +02:00
Xavier Noria
4aee8dd486
load active_support/core_ext/module/delegation in active_support/rails
2012-08-02 21:59:23 +02:00
Xavier Noria
5e1b92044c
load active_support/core_ext/class/attribute in active_support/rails
2012-08-02 21:59:23 +02:00
Xavier Noria
64bc8447c2
load active_support/concern in active_support/rails
2012-08-02 21:59:23 +02:00
Xavier Noria
47396a9db8
load active_support/dependencies/autoload in active_support/rails
2012-08-02 21:59:23 +02:00
Xavier Noria
5ea6b0df9a
load active_support/core_ext/object/inclusion in active_support/rails
2012-08-02 21:59:22 +02:00
Xavier Noria
8f58d6e507
load active_support/core_ext/object/blank in active_support/rails
2012-08-02 21:59:22 +02:00
Xavier Noria
1a7b2e8fad
defines a private require-hub active_support/rails
...
This is a private place to put those AS features that are used
by every component. Nowadays we cherry-pick individual files
wherever they are used, but that it is not worth the effort
for stuff that is going to be loaded for sure sooner or later,
like blank?, autoload, concern, etc.
2012-08-02 21:59:22 +02:00
José Valim
7a7ec74c1c
Check validity of options[:as] just once
2012-08-02 21:49:31 +02:00
Arthur Smith
b3e2abc4b1
Fix for digest authentication bug - issue #2301 in rails/rails
2012-08-02 15:24:08 -04:00
kennyj
a8d68d89e3
Improve error handling when using partial name with hyphen. Fix #7079
2012-08-03 02:05:47 +09:00
Rafael Mendonça França
ddd804e818
Merge pull request #7204 from frodsan/update_conventions
...
Follow code conventions in metal/live
2012-07-31 18:40:10 -07:00
Santiago Pastorino
b6ab441772
html_escape should escape single quotes
...
https://www.owasp.org/index.php/XSS_%28Cross_Site_Scripting%29_Prevention_Cheat_Sheet#RULE_.231_-_HTML_Escape_Before_Inserting_Untrusted_Data_into_HTML_Element_Content
Closes #7215
2012-07-31 22:26:52 -03:00
Francesco Rodriguez
cbcfbdd078
fix punctuation in #resources and #match documentation [ci skip]
2012-07-31 14:16:46 -05:00
Robert Pankowecki
8453addedc
Update #match documentation [ci skip]
2012-07-31 20:28:02 +02:00
Robert Pankowecki
c5fcc9ad1c
Update #resources documentation [ci skip]
2012-07-31 20:22:44 +02:00
Francesco Rodriguez
829ec373dd
fix nodoc in metal/live
2012-07-30 18:06:13 -05:00
Francesco Rodriguez
5906881c96
update coding conventions in metal/live
2012-07-30 17:08:05 -05:00
Francesco Rodriguez
eae19033fb
fix typo in metal/live [ci skip]
2012-07-30 16:54:33 -05:00
Rafael Mendonça França
69f62ecaff
Merge pull request #7198 from cfcosta/refactor-cache_control_headers
...
Refactor ActionDispatch::Http::Cache::Response#cache_control_headers
2012-07-29 22:48:20 -07:00
Cainã Costa
7db29f9004
Refactor ActionDispatch::Http::Cache::Response#cache_control_headers.
2012-07-30 02:41:45 -03:00
Aaron Patterson
0899be5798
updated changelog
2012-07-29 21:43:07 -07:00
Aaron Patterson
fa3c4ea6d0
close the response when the response body is set so that normal render calls will work
2012-07-29 21:43:07 -07:00
Aaron Patterson
4509494f70
header hash is duped before being sent up the rack stack
2012-07-29 21:43:07 -07:00
Aaron Patterson
b3d1f5b630
freeze the header object
2012-07-29 21:43:06 -07:00
Aaron Patterson
619e7c8db8
make sure set_response! sets the correct response object
2012-07-29 21:43:06 -07:00
Aaron Patterson
08b107e345
adding a more docs on closing response streams
2012-07-29 21:43:06 -07:00
Aaron Patterson
dd871a3d72
pushing Buffer up to Live
2012-07-29 21:43:06 -07:00
Aaron Patterson
c83e147e47
adding some docs
2012-07-29 21:43:06 -07:00
Aaron Patterson
38cfbb8aa7
Controller actions are processed in a separate thread for live
...
responses.
Processing controller actions in a separate thread allows us to work
around the rack api - we can allow the user to set status and headers,
then block until the first bytes are written. As soon as the first
bytes are written, the main thread can return the status, headers, and
(essentially) a queue for the body.
2012-07-29 21:43:05 -07:00
Aaron Patterson
06c9e176ca
raise exceptions on header set after response committed
2012-07-29 21:43:05 -07:00
Aaron Patterson
01b812672a
make sure appropriate headers are set and deleted
2012-07-29 21:43:05 -07:00
Aaron Patterson
af0a9f9eef
added live responses which can be written and read in separate threads
2012-07-29 21:43:05 -07:00
Rafael Mendonça França
d4433a3521
ActionController::DataStreaming::FileBody doesn't respond to #close.
2012-07-29 23:38:33 -03:00
Aaron Patterson
a6bdae1c19
flushing output should write to the stream rather than mutating the response object
2012-07-29 17:02:00 -07:00
Aaron Patterson
19e68e9d47
remove dead test
2012-07-29 16:00:50 -07:00
Aaron Patterson
356787fce8
adding a buffered stream to the response object
2012-07-29 15:51:21 -07:00
Aaron Patterson
76d75f4240
initialize ivars, refactor recycle! to call initialize
2012-07-29 14:39:20 -07:00
Rafael Mendonça França
82667c84e1
Remove warning renaming the test classes to use the test convention
2012-07-29 17:47:05 -03:00
Rafael Mendonça França
6b9004a9f4
Remove deprecation warning, since scoped waas deprecated
2012-07-29 16:11:48 -03:00
Aaron Patterson
1f870a2c59
issue a warning when we cannot construct a controller
2012-07-28 20:40:27 -07:00
Aaron Patterson
f79b29a5a8
this test is not a controller test, so switch to AS::TC
2012-07-28 20:30:52 -07:00
Vladimir Strakhov
8b6301adbc
fix failure test 'test_can_wait_until_commit(ResponseTest)' in actionpack
2012-07-28 20:12:35 +04:00
Xavier Noria
b5dfc47150
adds a missing require from Active Support
...
This file uses mattr_accessor.
2012-07-28 00:58:00 +02:00
Aaron Patterson
acb6848468
threads can wait on responses to be committed
2012-07-27 15:54:23 -07:00
Francesco Rodriguez
46b24c958a
use 'HTTP_AUTHORIZATION' instead of :authorization as key when dealing with HTTP Token authentication in integration tests
2012-07-27 12:59:05 -05:00
Aaron Patterson
fee0bc5738
* Do not convert digest auth strings to symbols. CVE-2012-3424
...
Conflicts:
actionpack/lib/action_controller/metal/http_authentication.rb
2012-07-26 15:08:40 -07:00
Anatoly Makarevich
103a31391b
fix typo in documentation
2012-07-26 22:44:36 +04:00
Lucas Mazza
9a020bd8f9
Replace the flush parameter with a Hash.
2012-07-24 16:19:14 -03:00
Santiago Pastorino
14a1df1409
Add CHANGELOG entry
2012-07-23 14:37:09 -03:00
Santiago Pastorino
449039a86d
Remove ActionDispatch::Head middleware in favor of Rack::Head
...
Closes #7110 there's more work to do on rack-cache issue 69
2012-07-23 14:34:13 -03:00
kennyj
6ebfe8b996
Fix build. Bump Journey requirements to 2.0.0.
2012-07-24 02:25:38 +09:00
Andrew White
4d7a102790
Bump Journey requirements to 1.0.4
...
There are some Action Pack tests for regressions from 3.1 that require
a later version of Journey to pass so bump to the current version.
2012-07-23 07:08:38 +01:00
Rafael Mendonça França
580fa0c7be
Add one more test case to make sure that data attributes are being
...
escaped
2012-07-22 13:57:42 -03:00
Rafael Mendonça França
440a5ebd7a
Merge pull request #7123 from nashby/data-in-options
...
don't escape options in option_html_attributes method
2012-07-22 08:10:31 -07:00
Vasiliy Ermolovich
dacbcbe557
don't escape options in option_html_attributes method
...
we don't need to escape values in this method as we pass
these html attributes to `tag_options` method that handle escaping as
well.
it fixes the case when we want to pass html5 data options
2012-07-22 11:37:54 +03:00
Carlos Galdino + Rafael Mendonça França
5b9d0a6272
Remove deprecation warnings
2012-07-21 16:47:58 -03:00
Carlos Galdino + Rafael Mendonça França
0106e5fe44
Add back :disable_with
and change deprecation horizon to 4.1
2012-07-21 16:25:34 -03:00
Carlos Galdino + Rafael Mendonça França
9345a116af
Add back :confirm
and change deprecation horizon to 4.1
2012-07-21 15:20:26 -03:00
Xavier Noria
3561e85bb1
copy-edits 9674d2c
2012-07-21 07:30:53 +02:00
Xavier Noria
d7211488bd
Merge pull request #7100 from shigeya/fix_mime_responds_to_doc
...
Clarification to doc of ActionController::MimeResponse.respond_to
2012-07-20 22:19:23 -07:00
Rafael Mendonça França
f3e4d2097d
Merge pull request #7099 from f1sherman/sweeper-clean-up-if-exception-raised
...
Clean up Sweeper controller accessor when an Error is raised
2012-07-20 06:30:19 -07:00
Brian John
35fe3107a3
Clean up Sweeper controller accessor when an Error is raised
2012-07-20 05:49:45 -05:00
Andrew White
cabb4471af
Don't assume resource param is :id when using shallow routes
...
Since #5581 added support for resources with custom params we should
not assume that it is :id when using shallow resource routing.
2012-07-20 10:50:38 +01:00
Andrew White
27619e34d4
Support constraints on resource custom params when nesting
...
The Mapper looks for a :id constraint in the scope to see whether it
should apply a constraint for nested resources. Since #5581 added support
for resource params other than :id, we need to check for a constraint on
the parent resource's param name and not assume it's :id.
2012-07-20 10:50:11 +01:00
Shigeya Suzuki
9674d2c70f
Clarification to doc of ActionController::MimeResponse.respond_to
...
- #respond_to's documentation refer to .respond_to, but it was
written as just <respond_to>. Added class name for clarification.
2012-07-19 09:57:34 +09:00
Carlos Galdino
fb8a830a32
Remove :confirm
in favor of :data => { :confirm => 'Text' }
option
...
This applies to the following helpers:
`button_to`
`button_tag`
`image_submit_tag`
`link_to`
`submit_tag`
2012-07-18 10:32:17 -03:00
Sergey Pchelincev
1b5298e805
add lazy look up in abstract controller's translate method
2012-07-18 10:33:14 +03:00