| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is a common pattern in the Rails community that when people want to
:xa
use any kind of helper that is defined inside app/helpers they includes
the helper module inside the controller like:
module UserHelper
def my_user_helper
# ...
end
end
class UsersController < ApplicationController
include UserHelper
def index
render inline: my_user_helper
end
end
This has problem because the helper can't access anything that is
defined in the view level context class.
Also all public methods of the helper become available in the controller
what can lead to undesirable methods being routed and behaving as
actions.
Also if you helper depends on other helpers or even Action View helpers
you need to include each one of these dependencies in your controller
otherwise your helper is not going to work.
We already have a helpers proxy at controller class level but that proxy
doesn't have access to the instance variables defined in the
controller.
With this new instance level helper proxy users can reuse helpers in the
controller without having to include the modules and with access to
instance variables defined in the controller.
class UsersController < ApplicationController
def index
render inline: helpers.my_user_helper
end
end
|
|
|
|
|
|
|
|
|
| |
There were a lot of protected instance variables in
AbsctractController::Rendering that were related to Action Controller
and Action View.
Moving to ActionController::Base's protected instance list we make it
closer to where they are really defined.
|
| |
|
|
|
|
|
| |
this means the reader doesn't need to lock, but does have the added cost
of a new object created for every controller
|
|\
| |
| | |
Remove dead code
|
| | |
|
| |
| |
| |
| |
| |
| | |
Since all controller instances are required to have a request and
response object, RackDelegation is no longer needed (we always have to
delegate to the response)
|
|/
|
|
| |
these ivars don't exist anymore, so we can remove them from the list
|
|
|
|
|
|
|
| |
Actions are processed through `dispatch`, so they should have the
request set on them before any user land code can be executed. Lets
stop setting _env on the controller, and give access to it through the
`env` method.
|
|\
| |
| |
| | |
Add documentation to get a running custom base controller [ci skip]
|
|/ |
|
| |
|
|
|
|
| |
skip]
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
New default: the template digest is automatically included in your ETags.
When you call `fresh_when @post`, the digest for `posts/show.html.erb`
is mixed in so future changes to the HTML will blow HTTP caches for you.
This makes it easy to HTTP-cache many more of your actions.
If you render a different template, you can now pass the `:template`
option to include its digest instead:
fresh_when @post, template: 'widgets/show'
Pass `template: false` to skip the lookup. To turn this off entirely, set:
config.action_controller.etag_with_template_digest = false
|
|
|
|
| |
ref #14062
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
constant.
`view_assigns` can use the precalculated sets and remove instance
variables without allocating any extra arrays
|
|
|
|
|
|
|
|
|
| |
Fixing the typo which is formed a not required link. Check
here http://api.rubyonrails.org/classes/ActionController/Base.html
under paramters section
keeping it under tt tag
gets reverted here ec8ef1e1055c4e1598da13f49d30261f07f4a9b4
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This reverts commit 7de994fa215e9f4c2856d85034bc4dd7b65d0c01.
|
| |
|
| |
|
|
|
|
| |
We don't need them. They'll be loaded automaticly if AV will be included
|
|
|
|
|
|
| |
Make it clearer
[ci skip]
|
| |
|
| |
|
| |
|
|
|
|
| |
This interface should be use when implementing renderers.
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
actionview/README.rdoc
activerecord/lib/active_record/migration.rb
guides/source/development_dependencies_install.md
guides/source/getting_started.md
|
| |
| |
| |
| |
| |
| |
| | |
This reverts commit 70d6e16fbad75b89dd1798ed697e7732b8606fa3, reversing
changes made to ea4db3bc078fb3093ecdddffdf4f2f4ff3e1e8f9.
Seems to be a code merge done by mistake.
|
|/ |
|
|
|
|
|
| |
[skip ci] Fixing the typo which is formed a not required link. Check here http://api.rubyonrails.org/classes/ActionController/Base.html under paramters section
keeping it under tt tag
|
| |
|
| |
|
| |
|
|\
| |
| | |
Integrate strong_parameters in Rails 4
|
| | |
|
| | |
|