Commit Graph

346 Commits

Author SHA1 Message Date
Francesco Rodriguez
fa45401b82 Remove page_cache_extension deprecated method 2013-07-01 22:09:11 -05:00
Carlos Antonio da Silva
4b97ce5eb1 Remove deprecated constants from Action Controller
ActionController::AbstractRequest  => ActionDispatch::Request
  ActionController::Request          => ActionDispatch::Request
  ActionController::AbstractResponse => ActionDispatch::Response
  ActionController::Response         => ActionDispatch::Response
  ActionController::Routing          => ActionDispatch::Routing
  ActionController::Integration      => ActionDispatch::Integration
  ActionController::IntegrationTest  => ActionDispatch::IntegrationTest
2013-07-01 22:20:23 -03:00
Carlos Antonio da Silva
dd9d869746 Merge pull request #11000 from sbeckeriv/accept_header
Fix undefined method `ref' for nil:NilClass for bad accept headers
2013-06-25 19:34:20 -03:00
Akshay Khole
444d3412b9 Fixing Issue #11083
Removing other occurrences of `the` appearing twice
2013-06-25 16:47:29 +05:30
Andrew White
37b4276dbf Fix shorthand routes where controller and action are in the scope
Merge `:action` from routing scope and assign endpoint if both `:controller`
and `:action` are present. The endpoint assignment only occurs if there is
no `:to` present in the options hash so should only affect routes using the
shorthand syntax (i.e. endpoint is inferred from the the path).

Fixes #9856
2013-06-25 06:04:26 +01:00
Piotr Sarnacki
50311f1391 Don't remove trailing slash from PATH_INFO for mounted apps
Previously when app was mounted as following:

    class Foo
      def call(env)
        [200, {}, [env['PATH_INFO']]]
      end
    end

    RackMountRailsBug::Application.routes.draw do
      mount RackTest.new => "/foo"
    end

trailing slash was removed from PATH_INFO. For example requesting

    GET /foo/bar/

on routes defined above would result in a response containing "/foo/bar"
instead of "/foo/bar/".

This commit fixes the issue.

(closes #3215)
2013-06-21 08:56:19 +02:00
Łukasz Strzałkowski
d1fb5d5949 Adjust changelog for AV & AP 2013-06-20 19:06:52 +02:00
Stephen Becker IV
8ffd139edd Fix undefined method `ref' for nil:NilClass for bad accept headers 2013-06-19 06:29:52 -07:00
Rafael Mendonça França
2d2f35ddf2 Add CHANGELOG entry for #10969
[ci skip]
2013-06-16 21:37:46 -03:00
Vasiliy Ermolovich
782cee5377 collection tags accept html attributes as the last element of collection 2013-06-16 17:58:34 +03:00
Alex Peattie
a89bdc04ba Update the HTML boolean attributes per the HTML 5.1 spec
- Add attributes `allowfullscreen`, `default`, `inert`, `sortable`,
`truespeed`, `typemustmatch`.
- Fix attribute `seamless` (previously misspelled `seemless`).
- Use `assert_dom_equal` instead of `assert_equal` in test.
2013-06-14 23:47:21 +01:00
Bryan Ricker
3c516c4b52 Allow numbers in partial name for digesting
Add failing test for template with number at the end

Use \w for RENDER_DEPENDENCY regex

Spacing

Add CHANGELOG entry
2013-05-06 18:30:29 -07:00
Rafael Mendonça França
feb44b9213 rails/master is now 4.1.0.beta 2013-04-29 13:15:24 -03:00
Rafael Mendonça França
faa2c71dee Revert "Merge pull request #10337 from eimermusic/fix_template_digestor_lookup"
This reverts commit b4239622afc4f3f73808fd0c97512f3a534e07dd, reversing
changes made to f99ce3c188f5dde57e2ff63e6a22363c62f0a4cd.

Reason: This broke the build
https://travis-ci.org/rails/rails/jobs/6629894
2013-04-25 11:14:22 -03:00
Rafael Mendonça França
b4239622af Merge pull request #10337 from eimermusic/fix_template_digestor_lookup
Fix ActionView::Digestor to correctly pass format to LookupContext

Conflicts:
	actionpack/CHANGELOG.md
2013-04-25 10:22:51 -03:00
Andrew White
f99ce3c188 Add support for extra options to force_ssl
This commit adds support for passing additional url options along
with a :status option and any of the flash-related options to
`redirect_to` (i.e. :flash, :alert & :notice).

Closes #7570.
2013-04-25 13:45:52 +01:00
Martin Westin
9a79c13c45 AV Digestor correctly passes format to LookupContext
ActionView::Digestor now passes arguments correctly to
LookupContext::find method. This makes cache digests
respect the format option correctly.

FixtureFinder in tests also changed to reflect this.
2013-04-25 09:52:04 +02:00
Andrew White
8227bf7ee9 Use request.fullpath to build redirect url in force_ssl
The `force_ssl` command now builds the redirect url from `request.fullpath`.
This ensures that the format is maintained and it doesn't redirect to a route
that has the same parameters but is defined earlier in `routes.rb`. Also any
optional segments are maintained.

Fixes #7528.
Fixes #9061.
Fixes #10305.
2013-04-25 08:33:21 +01:00
Lewis Marshall
ec462b4de7 Return a 405 response for unknown HTTP methods 2013-04-22 14:31:10 +01:00
Andrew White
222011dbee Add CHANGELOG entries - closes #10180, #10185 2013-04-18 17:12:40 +01:00
Rafael Mendonça França
1692732271 Merge pull request #10173 from nashby/element-attributes
options_from_collection_for_select helper takes html attributes
2013-04-16 14:02:14 -07:00
Yves Senn
c245437de7 use unified and clean formatting in CHANGELOGS. [ci skip] 2013-04-12 15:52:43 +02:00
Vasiliy Ermolovich
0778290b57 options_from_collection_for_select helper takes html attributes
as the last element of the array
2013-04-11 14:15:33 +03:00
Rafael Mendonça França
096ee1594d Improve the changelog entry [ci skip] 2013-04-05 16:43:04 -03:00
Ryan McGeary
48dc5192ef Fix explicit names on multiple file fields
If a file field tag is passed the multiple option, it is turned into an
array field (appending "[]"), but if the file field is passed an
explicit name as an option, leave the name alone (do not append "[]").

Fixes #9830
2013-04-05 15:32:56 -04:00
Sam Pohlenz
4bb26dd7b2 Add block support for the helper 2013-04-03 14:42:48 +10:30
Santiago Pastorino
f9d23b3848 Merge pull request #9978 from trevorturk/cookie-store-auto-upgrade
Cookie-base session store auto-upgrade
2013-04-01 08:10:34 -07:00
Carlos Antonio da Silva
6ee17918e1 Improve AP changelog entry about layout method with nil return
Add a note about getting the "no layout" behavior by returning "false"
to make it easier for people that might need to change their code.

Related to #8458. [ci skip]
2013-03-30 15:48:39 -03:00
Trevor Turk
274a3aa64c Allow transparent upgrading of legacy signed cookies to encrypted cookies; Automatically configure cookie-based sessions to use the best cookie jar given the app's config 2013-03-28 14:38:36 -05:00
Prathamesh Sonpatki
48a80f30bb Removed unused variable in proc
* This unused variable is already removed from the code here. d18e8b1a3839c5c214e96c7e37e0d86febe15f99

 * So removing it from CHANGELOG to be consistent with code
2013-03-28 20:43:25 +05:30
Rafael Mendonça França
e7438501d6 Merge pull request #8458 from lucisferre/improve-layout-override-fallback-behavior
Provides standard layout lookup behavior for method and proc cases

Conflicts:
	actionpack/CHANGELOG.md
2013-03-27 16:09:12 -03:00
Chris Nicola
ef27bba63d Provides standard layout lookup behavior for method and proc cases
When setting the layout either by referencing a method or supplying a
Proc there is no way to fall back to the default lookup behavior if
desired. This patch allows fallback to the layout lookup behavior when
returning nil from the proc or method.
2013-03-27 10:59:50 -07:00
Jeremy Kemper
b3e08f25ef Tender love for #9909 ❤️ 2013-03-24 22:59:36 -07:00
Trevor Turk
0190cba99c Introduce UpgradeLegacySignedCookieJar to transparently upgrade existing signed cookies generated by Rails 3 to avoid invalidating them when upgrading to Rails 4 2013-03-24 18:20:24 -05:00
Trevor Turk
a2b7c0e69d Raise an ArgumentError when a clashing named route is defined 2013-03-19 23:23:55 -05:00
schneems
334549b4a5 Fix improperly configured host in generated urls
If the host in `default_url_options` is accidentally set with a protocol such as 

```
host: "http://example.com"
``` 

then the generated url will have the protocol twice `http://http://example.com` which is not what the user intended. Likely they wanted to define a host `host: "example.com"` and a `protocol: "http://"` but did not know the convention.

This may not the most common problem, but when it happens it can go undetected for a while. I accidentally added `http://` out of habit recently only to find all the links in my emails were broken after deploying a demo site to production. Rather than allow this accident go undetected, we can fix the problem in line by properly setting the protocol and host.


I was able to find this related question on stack overflow: http://stackoverflow.com/questions/5878329/rails-3-devise-how-do-i-make-the-email-confirmation-links-use-secure-https-n where the answer was highly upvoted.

This is based off of work in #7415 cc/ @pixeltrix

ATP Action Mailer and Action Pack
2013-03-19 12:34:49 -05:00
Brad Dunbar
95332abe09 Digest auth should not 500 when given a basic header. 2013-03-18 14:50:47 -04:00
Juan Barreneche
cecbf5dd4d Include I18n fallbacks in :locale lookup context 2013-03-16 21:27:13 -03:00
Yves Senn
41a14dcd10 Http::Headers directly modifies the passed environment.
The env hash passed to `Http::Headers#new` must be in env format.
Also be aware that the passed hash is modified directly.

docs and test-cases for setting headers/env in functional tests.

Follow up to #9700.
2013-03-15 10:13:49 +01:00
Yves Senn
9af59b2468 allow headers and env to be passed in IntegrationTest.
Closes #6513.
2013-03-13 16:41:00 +01:00
Yves Senn
8945be464f Http::Headers respects headers that are not prefixed with HTTP_ 2013-03-13 16:27:47 +01:00
Yves Senn
a58e660837 Use "Fixes" in place of "Fix" in changelogs for consistency [ci skip]. 2013-03-09 20:57:17 +01:00
Olek Janiszewski
8e05a6f638 Fix incorrectly appended square brackets to a multiple select box
If an explicit name has been given and it already ends with "[]"

Before:

    select(:category, [], {}, multiple: true, name: "post[category][]")
    # => <select name="post[category][][]" ...>

After:

    select(:category, [], {}, multiple: true, name: "post[category][]")
    # => <select name="post[category][]" ...>
2013-03-08 19:01:32 +01:00
Carlos Antonio da Silva
a049631380 Move AP changelog entry to the top [ci skip] 2013-03-07 20:15:49 -03:00
Justin Coyne
73deb3af23 Allow use of assert_template with the :file option.
This worked in Rails 3.2, but was a regression in 4.0.0.beta1
2013-03-01 07:22:38 -06:00
Rafael Mendonça França
c4f2f5b9d7 Improve the CHANGELOG entry
[ci skip]
2013-02-28 18:31:46 -03:00
Rafael Mendonça França
fae2e4d05d Merge pull request #9366 from killthekitten/fix-content_for-regression
Fix for #9360 content_for regression
2013-02-28 13:28:50 -08:00
Carlos Antonio da Silva
a3894380eb Minor changelog improvement [ci skip] 2013-02-28 08:41:53 -03:00
Yves Senn
afddc0409e format: true does not override existing format constraints.
Closes #9466.

Passing `format: true` used to override the constraints: { format: /json/ }
with `/.+/`. This patch only sets the format if there is no constraint present.
2013-02-27 19:57:41 +01:00
Yves Senn
794cbf3e38 allow non-String default params in the router.
Closes #9435.

Skip valid encoding checks for non-String parameters that come
from the matched route's defaults.
2013-02-26 21:53:48 +01:00