1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

14 commits

Author SHA1 Message Date
Kir Shatrov
dfcc766163 Use frozen string literal in actionpack/ 2017-07-29 14:02:40 +03:00
Matthew Draper
87b3e226d6 Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"
This reverts commit 3420a14590, reversing
changes made to afb66a5a59.
2017-07-02 02:15:17 +09:30
Kir Shatrov
cfade1ec7e Enforce frozen string in Rubocop 2017-07-01 02:11:03 +03:00
alpaca-tc
c5f8fe9379 Fixes ActionController::Rendering#with_defaults
`env` is undefined.
2017-03-12 22:38:20 +09:00
Giorgos Vrettos
32046deced Fix malformed asset_url when rendering template with ActionController::Renderer 2017-03-06 13:12:14 +02:00
Sammy Larbi
6fccd7b629 Allow any key in Renderer environment hash
When rendering arbitrary templates, it is helpful to not overwrite `env` keys with nil if they don't match any found in the `RACK_KEY_TRANSLATION`

This allows the developer to set the environment to exactly what is needed for rendering.
2016-10-15 07:03:33 -05:00
Xavier Noria
411ccbdab2 remove redundant curlies from hash arguments 2016-08-06 19:44:11 +02:00
Xavier Noria
35b3de8021 applies new string literal convention in actionpack/test
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 18:54:50 +02:00
Jon Moss
7bd2f91773 Fix ApplicationController.renderer.defaults.merge!
Previously, users were trying to modify a frozen Hash. Includes a
regression test :)

Fixes #22975
2016-04-20 19:47:16 -04:00
Aaron Patterson
2db7304c2c create a new renderer instance on calls to for
This changes the renderer class to store the controller and defaults as
an instance variable rather than allocating a new class.  You can create
a new renderer with an new env by calling `Renderer#new` or use new
defaults by calling `Renderer#with_defaults` and saving the return value
somewhere.

Also I want to keep the `env` private since I would like to change the
keys in the future.  This commit only translates particular keys that
the user requested.
2015-09-14 15:58:12 -07:00
Aaron Patterson
8e489db9de eagerly allocate the renderer object
this means the reader doesn't need to lock, but does have the added cost
of a new object created for every controller
2015-09-14 15:29:19 -07:00
Yuki Nishijima
1bb1b9e8cb ✂️ warning from controller renderer test
rails/actionpack/test/controller/renderer_test.rb:89: warning: possible reference to past scope - defaults
2015-01-31 17:48:55 -08: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