Commit Graph

596 Commits

Author SHA1 Message Date
Rafael Mendonça França
73aab036ee Merge pull request #20017 from eliotsykes/configurable-static-index-filename
config.static_index configures directory Index "index.html" filename
2015-05-28 18:53:00 -03:00
Mehmet Emin İNAÇ
44781b6e97 Deprecate :nothing option for render method
`head` method works similar to `render` method with `:nothing` option
2015-05-28 15:13:32 +03:00
Eliot Sykes
3ff39494cd config.static_index configures directory index "index.html" filename
Set `config.static_index` to serve a static directory index file not
named `index`. For example, to serve `main.html` instead of `index.html`
for directory requests, set `config.static_index` to `"main"`.
2015-05-28 09:41:00 +01:00
karanarora
0750330941 Spelling/typo/grammatical fixes [ci skip]
spelling fix [ci skip]

example to be consistent [ci skip]

grammatical fix

typo fixes [ci skip]
2015-05-23 03:01:33 +05:30
Prathamesh Sonpatki
daba090dec Pass over CHANGELOGS [ci skip] 2015-05-16 11:00:17 +05:30
Anton Davydov
8a40bf2081 [skip ci] Fix typos in actionpack changelog and security guide 2015-05-07 14:49:34 +03:00
Arthur Neves
6d9ad0dd92
Add changelog for rake routes default fix
[see #18392]
2015-04-27 09:18:43 -04:00
Yves Senn
cdbf685994 pass over CHANGELOGs. [ci skip] 2015-04-22 14:44:30 +02:00
Kevin McPhillips
2b8acdcd21 Override default form builder for a controller 2015-04-13 23:43:34 -04:00
Stephen Bussey
0de4a23d1c head no_content when there is no template or action performed 2015-04-05 15:46:50 -04:00
Rafael Mendonça França
5cb8e0046c Merge pull request #18939 from georgeclaghorn/variant-inquiry
Provide friendlier access to request variants
2015-03-27 16:20:52 -03:00
Arthur Neves
b6b088429c Add changelog entry for #19271 2015-03-24 15:12:47 -04:00
George Claghorn
9d9cc4777b Provide friendlier access to request variants
Closes #18933.
2015-03-24 12:49:27 -05:00
adam
b49cac80de Fix handling of empty X_FORWARDED_HOST header.
Previously, an empty X_FORWARDED_HOST header would cause
Actiondispatch::Http:URL.raw_host_with_port to return nil, causing
Actiondispatch::Http:URL.host to raise a NoMethodError.
2015-03-20 20:32:30 +00:00
Mike Naberezny
849148b35f Fix typo in Action Pack changelog. [ci skip] 2015-03-14 13:08:55 -07:00
Aaron Patterson
c2108926a4 Drop request class from RouteSet constructor.
If you would like to use a custom request class, please subclass and implemet
the `request_class` method.
2015-03-04 11:02:24 -08:00
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