| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
|
| |
|
|
|
|
|
|
| |
".. with __dir__ we can restore order in the Universe." - by @fxn
Related to 5b8738c2df003a96f0e490c43559747618d10f5f
|
|
|
|
|
|
| |
assert [1, 3].includes?(2) fails with unhelpful "Asserting failed" message
assert_includes [1, 3], 2 fails with "Expected [1, 3] to include 2" which makes it easier to debug and more obvious what went wrong
|
| |
|
| |
|
|
|
|
|
| |
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
| |
ActionController::TestResponse was removed in d9fe10c and caused a test
failure on Action View as its test case still refers to it.
|
|
|
|
|
| |
We should leverage the request / response objects that the superclass
has already allocated for us.
|
|
|
|
| |
ref: https://github.com/rails/rails/pull/18763#issuecomment-72349769
|
|
|
|
|
|
| |
See comment in this patch for the rationale.
References #16468
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After this fix application config become available when calling helper outisde of view
config/application.rb
#...
config.asset_host = 'http://mycdn.com'
#...
Somewhere else
ActionController::Base.helpers.asset_path('fallback.png')
# => http://mycdn.com/assets/fallback.png
|
|
|
|
| |
Module#methods are Symbols in Ruby >= 1.9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When more than one directory for helpers is provided to a controller, it
should preserver the order of directories. Given 2 paths:
MyController.helpers_paths = ["dir1/helpers", "dir2/helpers"]
helpers from dir1 should be loaded first. Before this commit, all
helpers were mixed and then sorted alphabetically, which essentially
would require to rename helpers to get desired order.
This is a problem especially for engines, where you would like to be
able to predict accurately which engine helpers will load first.
(closes #6496)
|
| |
|
| |
|
| |
|
|
|
|
| |
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
|
|
| |
clear_helpers [#5348 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
|
| |
|
|
|
|
| |
's/[ \t]*$//' -i {} \;)
|
| |
|
|
|
|
| |
not "ActiveRecord"
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* A new module (ActiveSupport::Autoload) is provide that extends
autoloading with new behavior.
* All autoloads in modules that have extended ActiveSupport::Autoload
will be eagerly required in threadsafe environments
* Autoloads can optionally leave off the path if the path is the same
as full_constant_name.underscore
* It is possible to specify that a group of autoloads live under an
additional path. For instance, all of ActionDispatch's middlewares
are ActionDispatch::MiddlewareName, but they live under
"action_dispatch/middlewares/middleware_name"
* It is possible to specify that a group of autoloads are all found
at the same path. For instance, a number of exceptions might all
be declared there.
* One consequence of this is that testing-related constants are not
autoloaded. To get the testing helpers for a given component,
require "component_name/test_case". For instance, "action_controller/test_case".
* test_help.rb, which is automatically required by a Rails application's
test helper, requires the test_case.rb for all active components, so
this change will not be disruptive in existing or new applications.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
* Tests can be run in isolation
* Dependencies added
* A few tests modified to avoid depending on AS deps
not depended on my files they were testing
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* Rails actions are now Rack endpoints, and can be retrieved
via FooController.action(name) and called with an env
* Updated some tests that relied on the old internal
#process/#call implementation
|
|
|
|
|
|
|
|
| |
ActionView::Template is now completely independent from template
storage, which allows different back ends such as the database.
ActionView::Template's only responsibility is to take in the
template source (passed in from ActionView::Path), compile it,
and render it.
|
|
|
|
|
|
| |
ActionController::Base.helpers_dir (Sam Pohlenz) [#1424 state:committed]
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
|
| |
|
|
|
|
|
|
| |
#10839 [Josh Peek]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9234 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
|
|
|
|
| |
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8985 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
|
|
|
|
| |
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8564 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
|
|
|
|
| |
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8409 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
|
|
|
|
|
|
| |
in ApplicationController [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6221 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Check whether @flash is defined? for warnings-safety.
r4488@asus: jeremy | 2006-04-29 12:23:15 -0700
Check whether @flash is defined? for warnings-safety. Obviates nil? check.
r4489@asus: jeremy | 2006-04-29 12:45:18 -0700
Check whether @session is defined? for warnings-safety.
r4490@asus: jeremy | 2006-04-29 12:50:41 -0700
Check whether @rendering_runtime is defined? for warnings-safety.
r4491@asus: jeremy | 2006-04-29 12:55:01 -0700
Check whether @_cycles is defined? for warnings-safety.
r4492@asus: jeremy | 2006-04-29 12:59:19 -0700
Check whether instance variables are defined? for warnings-safety.
r4493@asus: jeremy | 2006-04-29 13:14:09 -0700
Add nil @template to PrototypeHelperTest to suppress unitialized instance variable warning.
r4494@asus: jeremy | 2006-04-29 13:31:34 -0700
Check whether @auto_index defined? for warnings-safety.
r4495@asus: jeremy | 2006-04-29 13:32:24 -0700
Wrap content_columns redefinitions with silence_warnings.
r4496@asus: jeremy | 2006-04-29 13:35:28 -0700
Wrap more redefinitions with silence_warnings.
r4829@asus: jeremy | 2006-07-08 10:59:20 -0700
abstract unit, fix warnings
r4830@asus: jeremy | 2006-07-08 11:06:12 -0700
Use parens to silence warning.
r4831@asus: jeremy | 2006-07-08 11:06:48 -0700
Use parens to silence warning.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4595 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
|
|
|
|
|
|
| |
correct default helper (PDFHelper in file pdf_helper.rb). Closes #2262. Do not raise an exception when default helper is missing; log a debug message instead. It's nice to delete empty helpers.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2938 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
|