Commit Graph

580 Commits

Author SHA1 Message Date
Rafael Mendonça França
44ff0313c1 Merge pull request #18775 from yasyf/issue_5122
Fallback to RAILS_RELATIVE_URL_ROOT in `url_for`
2015-03-03 17:19:42 -03:00
Aaron Patterson
12f2fc56aa Merge pull request #15806 from tgxworld/partition_routes_during_setup
Partition routes during setup.
2015-03-02 15:02:14 -08:00
Richard Schneeman
f069b41321 Merge pull request #18434 from brainopia/change_filter_on_rails_info_routes
Change filter on /rails/info/routes to use an actual path regexp from rails
2015-02-26 12:59:43 -06:00
Guo Xiang Tan
89edfbd3a4 Partition routes during setup.
Partitioning of all the routes is currently being done during the
first request. Since there is no need to clear the cache for
`partitioned_routes` when adding a new route. We can move the
partitioning of the routes during setup time.
2015-02-26 12:18:20 +08:00
Yves Senn
71fc789239 add CHANGELOG for f6e293ec54f02f83cdb37502bea117f66f87bcae. [ci skip] 2015-02-25 18:03:20 +01:00
Yasyf Mohamedali
6c14252d2c Fallback to RAILS_RELATIVE_URL_ROOT in url_for.
Fixed an issue where the `RAILS_RELATIVE_URL_ROOT` environment
variable is not prepended to the path when `url_for` is called.
If `SCRIPT_NAME` (used by Rack) is set, it takes precedence.
2015-02-24 16:04:27 -05:00
Rafael Mendonça França
6976e1da07 Merge pull request #19060 from iainbeeston/deprecate-skip-action-callback
Deprecate `AbstractController::Callbacks#skip_action_callback`
2015-02-24 13:33:16 -03:00
Iain Beeston
3fbc632843 Deprecate AbstractController::Callbacks#skip_action_callback
As part of #19029, in future `skip_before_action`, `skip_after_action` and
`skip_around_action` will raise an ArgumentError if the specified
callback does not exist. `skip_action_callback` calls all three of these
methods and will almost certainly result in an ArgumentError. If anyone
wants to remove all three callbacks then they can still call the three
individual methods. Therefore let's deprecate `skip_action_callback` now
and remove it when #19029 is merged.
2015-02-24 08:17:24 +00:00
brainopia
321db4aa2e Change filter on /rails/info/routes to use an actual path regexp from rails
Change filter on /rails/info/routes to use an actual path regexp from rails
and not approximate javascript version. Oniguruma supports much more
extensive list of features than javascript regexp engine.

Fixes #18402.
2015-02-23 19:57:01 +03:00
Yves Senn
e71f5dad4e some indenting and punctuation fixes. [ci skip] 2015-02-23 16:54:40 +01:00
Carlos Antonio da Silva
08d9c7532c Fix changelog indent [ci skip] 2015-02-20 20:52:20 -02:00
David Ilizarov
7f5cf3a3da Aliased the ActionDispatch::Request#uuid method with ActionDispatch::Request#request_id 2015-02-20 20:43:39 -02:00
Rafael Mendonça França
fb876b8a2c Merge pull request #18917 from lautis/non-string-csrf-token
Handle non-string authenticity tokens
2015-02-18 19:37:24 -02:00
Arthur Neves
2ed39424db Implement http_cache_forever to ActionController
Add http_cache_forever to ActionController, so we can cache results
forever.
Things like static pages are a good candidate for this type of caching.

This cache only controls caching headers, so it is up to the browser to
cache those requests.
2015-02-15 11:36:36 -05:00
Ville Lautanala
bf067b41e5 Handle non-string authenticity tokens
Non-string authenticity tokens raised NoMethodError when decoding the
masked token.
2015-02-12 22:24:45 +02:00
Rafael Mendonça França
76f6524538 Merge pull request #11790 from printercu/patch-3
ActionController#translate supports symbols
2015-02-12 15:39:17 -02:00
yuuji.yaginuma
697688663f fix typo in fresh_when example [ci skip] 2015-02-12 16:54:01 +09:00
claudiob
050fda0206 Accept a collection in fresh_when and stale?
The methods `fresh_when` and `stale?` from ActionController::ConditionalGet
accept a single record as a short form for a hash. For instance

```ruby
  def show
    @article = Article.find(params[:id])
    fresh_when(@article)
  end
```

is just a short form for:

```ruby
  def show
    @article = Article.find(params[:id])
    fresh_when(etag: @article, last_modified: @article.created_at)
  end
```

This commit extends `fresh_when` and `stale?` to also accept a collection
of records, so that a short form similar to the one above can be used in
an `index` action. After this commit, the following code:

```ruby
def index
  @article = Article.all
  fresh_when(etag: @articles, last_modified: @articles.maximum(:created_at))
end
```

can be simply written as:

```ruby
def index
  @article = Article.all
  fresh_when(@articles)
end
```
2015-02-10 17:08:44 -08:00
Terence Sun
b9c63b0aae Explicitly ignored wildcard verbs from head_routes
In match_head_routes, deleted the routes in which request.request_method was empty (matches all HTTP verbs) when responding to a HEAD request. This prevents catch-all routes (such as Racks) from intercepting the HEAD request.

Fixes #18698
2015-02-08 12:03:56 -05:00
Rafael Mendonça França
35e2255b7a Merge pull request #18771 from kirs/deprecate-xhr
Migrating xhr methods to keyword arguments syntax
2015-02-05 18:27:47 -02:00
Kir Shatrov
b19999f3a7 Migrating xhr methods to keyword arguments syntax
in `ActionController::TestCase` and
`ActionDispatch::Integration`

Old syntax:

    `xhr :get, :create, params: { id: 1 }`

New syntax example:

    `get :create, params: { id: 1 }, xhr: true`
2015-02-01 16:07:42 +03:00
Yves Senn
afe402dac7 unify CHANGELOG format. [ci skip] 2015-01-31 11:54:00 +01:00
Rafael Mendonça França
0eb3ba0e65 Improve CHANGELOG 2015-01-29 11:52:10 -02:00
Kir Shatrov
baf14ae513 Switch to kwargs in ActionController::TestCase and ActionDispatch::Integration
Non-kwargs requests are deprecated now.
Guides are updated as well.

`post url, nil, nil, { a: 'b' }` doesn't make sense.
`post url, params: { y: x }, session: { a: 'b' }` would be an explicit way to do the same
2015-01-29 14:44:46 +02:00
Tekin Suleyman
db870f222e Preserve default url options when generating URLs
Fixes an issue that would cause default_url_options to be lost when generating
URLs with fewer positional arguments than parameters in the route definition.
2015-01-28 21:15:52 +00:00
Rafael Mendonça França
7d9c5c1653 Add CHANGELOG entry 2015-01-28 18:50:01 -02:00
brainopia
656628961c Add ActionController::Base.render 2015-01-22 01:02:13 +03:00
brainopia
801e399e42 Add ActionController::Renderer
Render arbitrary templates outside of controller actions
2015-01-22 01:02:11 +03:00
brainopia
685142e4f4 Support :assigns option when rendering with controllers/mailers. 2015-01-22 00:25:50 +03:00
Yves Senn
a7621d7d53 formatting pass over CHANGELOGs. [ci skip] 2015-01-10 12:17:57 +01:00
Yves Senn
a94f8e71d2 Merge pull request #18423 from jone/remove-default-header
Default headers, removed in controller actions, will not be reapplied to the test response
2015-01-09 17:01:31 +01:00
Jonas Baumann
0739480f45 Default headers, removed in controller actions, will not be reapplied to the test response. 2015-01-09 16:55:02 +01:00
Abdelkader Boudih
7644a99d90 Deprecate all *_filter callbacks in favor of *_action callbacks 2015-01-08 20:52:36 +00:00
David Heinemeier Hansson
9af5f33a16 Fix the example (for realz) 2015-01-08 11:18:06 -08:00
David Heinemeier Hansson
6b9a973154 Fix the example 2015-01-08 11:17:03 -08:00
Josef Šimánek
0074bbb07b Add prepend option to protect_from_forgery. 2015-01-08 19:47:19 +01:00
brainopia
08d3f0e3b3 Remove ActionController::HideActions (closes #18336) 2015-01-06 23:40:45 +03:00
Carlos Antonio da Silva
afd5e9a7ff Remove respond_to/respond_with placeholder methods
This functionality has been extracted to the responders gem.
2015-01-04 18:22:09 -02:00
Rafael Mendonça França
92e27d30d8 Remove deprecated assertion files 2015-01-04 11:58:42 -03:00
Rafael Mendonça França
34e380764e Remove deprecated usage of string keys in URL helpers 2015-01-04 11:58:42 -03:00
Rafael Mendonça França
e4e1fd7ade Remove deprecated only_path option on *_path helpers 2015-01-04 11:58:42 -03:00
Rafael Mendonça França
2cc91c37bc Remove deprecated NamedRouteCollection#helpers 2015-01-04 11:58:42 -03:00
Rafael Mendonça França
1f3b0a8609 Remove deprecated support to define routes with :to option that
doesn't contain `#`
2015-01-04 11:58:41 -03:00
Rafael Mendonça França
4b19d5b7bc Remove deprecated ActionDispatch::Response#to_ary 2015-01-04 11:58:41 -03:00
Rafael Mendonça França
7676659633 Remove deprecated ActionDispatch::Request#deep_munge 2015-01-04 11:58:41 -03:00
Rafael Mendonça França
7fe7973cd8 Remove deprecated ActionDispatch::Http::Parameters#symbolized_path_parameters 2015-01-04 11:58:41 -03:00
Rafael Mendonça França
e4cfd353a4 Remove deprecated option use_route in controller tests 2015-01-04 11:58:41 -03:00
Rafael Mendonça França
2d743b528c Merge pull request #17978 from kommen/fixed-pr-14903
Ensure append_info_to_payload is called even if an exception is raised.

Conflicts:
	actionpack/CHANGELOG.md
2015-01-02 14:16:15 -03:00
Robin Dupret
7ef7f1cc15 Correctly use the response's status code calling head
Commit 20fece1 introduced the `_status_code` method to fix calls to
`head :ok`. This method has been added on both ActionController::Metal
and ActionDispatch::Response.

As for the latter, this method is just equivalent to the `response_code`
one so commit aefec3c removed it from the `Reponse` object so call to
the `_status_code` method on an ActionController::Base instance would be
handled by the `Metal` class (which `Base` inherits from) but the status
code is not updated according to the response at this level.

The fix is to actually rely on `response_code` for ActionController::Base
instances but this method doesn't exist for bare Metal controllers so we
need to define it.
2014-12-31 16:37:35 +01:00
Prathamesh Sonpatki
75757c5c3b Remove single space response body for head request
- The single space response was added due to a bug in safari
  in cb0f8fda96
  and
  807df4fcf0.
- This was removed from the `render nothing: true` in
  https://github.com/rails/rails/pull/14883.
- Removing it from response of :head also. As :head is more obvious
  alternative to call `render nothing:
  true`(http://guides.rubyonrails.org/layouts_and_rendering.html#using-head-to-build-header-only-responses),
  removing it from head method also.
- Closes #18253.
2014-12-30 20:50:23 +05:30