aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/abstract_controller/base.rb
Commit message (Collapse)AuthorAgeFilesLines
* Deprecate `*_path` methods in mailers@schneems and @sgrif2014-07-301-0/+8
| | | | | | | | | | | Email does not support relative links since there is no implicit host. Therefore all links inside of emails must be fully qualified URLs. All path helpers are now deprecated. When removed, the error will give early indication to developers to use `*_url` methods instead. Currently if a developer uses a `*_path` helper, their tests and `mail_view` will not catch the mistake. The only way to see the error is by sending emails in production. Preventing sending out emails with non-working path's is the desired end goal of this PR. Currently path helpers are mixed-in to controllers (the ActionMailer::Base acts as a controller). All `*_url` and `*_path` helpers are made available through the same module. This PR separates this behavior into two modules so we can extend the `*_path` methods to add a Deprecation to them. Once deprecated we can use this same area to raise a NoMethodError and add an informative message directing the developer to use `*_url` instead. The module with warnings is only mixed in when a controller returns false from the newly added `supports_relative_path?`. Paired @sgrif & @schneems
* Relpace `=~ Regexp.new str` with `.include? str` in AC::Base#_valid_action_name?Viktar Basharymau2014-06-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because it is more natural way to test substring inclusion. Also, in this particular case it is much faster. In general, using `Regexp.new str` for such kind of things is dangerous. The string must be escaped, unless you know what you're doing. Example: Regexp.new "\\" # HELLO WINDOWS # RegexpError: too short escape sequence: /\/ The right way to do this is escape the string Regexp.new Regexp.escape "\\" # => /\\/ Here is the benchmark showing how faster `include?` call is. ``` require 'benchmark/ips' Benchmark.ips do |x| x.report('include?') { !"index".to_s.include? File::SEPARATOR } x.report(' !~ ') { "index" !~ Regexp.new(File::SEPARATOR) } end __END__ Calculating ------------------------------------- include? 75754 i/100ms !~ 21089 i/100ms ------------------------------------------------- include? 3172882.3 (±4.5%) i/s - 15832586 in 5.000659s !~ 322918.8 (±8.6%) i/s - 1602764 in 4.999509s ``` Extra `.to_s` call is needed to handle the case when `action_name` is `nil`. If it is omitted, some tests fail.
* Remove duplicated to_s method call.Guo Xiang Tan2014-05-251-1/+1
|
* docs, make `ActionNotFound` public API. [ci skip]Yves Senn2014-05-111-1/+2
| | | | | | | | | This is a follow up to #15058. This exception is regularly raised during development. This means it will enter the user realm. We should provide an API page to show that this exception is public API. /cc @schneems
* adding complete message in documentation [ci skip]Gaurav Sharma2014-05-111-3/+4
|
* Only accept actions without File::SEPARATOR in the name.Rafael Mendonça França2014-05-061-3/+25
| | | | | | | | | This will avoid directory traversal in implicit render. Fixes: CVE-2014-0130 Conflicts: actionpack/lib/abstract_controller/base.rb
* Get rid of extra local var that does not add to the logicCarlos Antonio da Silva2014-05-051-2/+2
| | | | There are too many "action name" variables around the process method.
* Capitalize the first letter of sentenceTatsuro Baba2013-03-181-1/+1
|
* fix uninitialized ivar warningsAaron Patterson2012-10-251-0/+10
|
* remove 'then' from conditional statementNihad Abbasov2012-10-141-2/+4
|
* copy edit[ci skip]Vijay Dev2012-05-231-1/+1
|
* Update documentation for AbstractController::BaseHenrik Hodne2012-05-201-3/+11
|
* avoid empty api pagesVijay Dev2012-04-081-2/+5
|
* AbstractController.action_methods should return a SetSantiago Pastorino2012-03-101-2/+3
|
* Fix AbstractController#controller_path docAlexey Vakhov2012-02-191-1/+1
|
* Fix AbstractController::Base#hidden_actions commentAlexey Vakhov2012-02-181-2/+2
|
* Remove extra white spaces on ActionPack docs.Sebastian Martinez2011-05-231-1/+1
|
* better styling on #available_action? docsSebastian Martinez2011-05-061-2/+2
|
* Revert to old semantics, use available_action? instead of action_method?.José Valim2011-05-061-13/+25
|
* Implicit actions named not_implemented can be renderedSantiago Pastorino2011-04-021-0/+2
|
* Make action_method? public and change implicit rendering to override it instead.José Valim2011-03-301-15/+18
|
* Rewording existing commentNeeraj Singh2010-11-301-4/+3
|
* Fix a few bugs when trying to use Head standalonewycats2010-10-101-0/+1
|
* oops, missed a uniqAaron Patterson2010-09-291-1/+1
|
* dry up action_methodsAaron Patterson2010-09-291-4/+4
|
* fixed capitalizationJoost Baaij2010-08-251-8/+8
|
* change rdoc to conform to api guidelinesJoost Baaij2010-08-251-11/+13
|
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-1/+1
| | | | 's/[ \t]*$//' -i {} \;)
* Reload action_methods in AbstractController after defining new method.Piotr Sarnacki2010-08-041-0/+12
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* ActiveRecord and ActionPack now use the new descendants implementation.José Valim2010-06-191-11/+2
|
* Missing method error doesn't specify which controller it is missing from ↵Alan Harper2010-06-101-1/+1
| | | | | | | | | [#4436 state:resolved] The error page shown when the method you are requesting on a controller doesn't specify which controller the method is missing from Signed-off-by: José Valim <jose.valim@gmail.com>
* Changes made while working on upgrading cells to Rails 3wycats2010-06-031-0/+1
|
* Clean up the config object in ActionPack. Create config_accessor which just ↵José Valim2010-04-221-13/+4
| | | | delegates to the config object, reducing the number of deprecations and add specific tests.
* Move layout lookup to views.José Valim2010-03-081-6/+0
|
* Add a method for configuring abstract controllersCarl Lerche2010-03-041-0/+4
|
* Modifying configurations on the instance of a controller should not affect ↵Carl Lerche2010-03-031-1/+1
| | | | the class
* Tweak how ActionPack handles InheritableOptionsCarl Lerche2010-03-031-0/+2
|
* Move the original config method onto AbstractControllerCarl Lerche2010-03-031-0/+8
|
* Fix controller_path returnsing an empty string in Ruby 1.8.7 [#4036 ↵José Valim2010-02-261-1/+1
| | | | status:resolved]
* Clear out AS callback method pollution in AC::Base.action_methodsJoshua Peek2010-01-171-8/+12
|
* Base#action_methods delegates to Base.action_methodsJoshua Peek2010-01-171-58/+62
|
* @_formats initialization should be AbstractController::Base.José Valim2010-01-041-0/+5
|
* controller_path is required by ActionView, so move it up to ↵José Valim2009-12-311-0/+15
| | | | AbstractController and refactor AbstractController::Layouts.
* Make ActionMailer::Base inherit from AbstractController::BaseJosé Valim2009-12-221-4/+4
| | | | Signed-off-by: Yehuda Katz <wycats@Yehuda-Katz.local>
* AC::Head now doesn't have an unfulfilled Rendering dependency, and instead ↵Yehuda Katz2009-12-201-0/+1
| | | | works just fine standalone (which means that ConditionalGet also doesn't have a Rendering dependency)
* Fix response_body warning in ACJoshua Peek2009-12-141-0/+2
|
* Relocate AbstractController exceptions into their proper parent modulesJoshua Peek2009-12-121-1/+3
|
* Create new ActionController::Middleware class that will work as a normal ↵Yehuda Katz2009-08-261-1/+0
| | | | | | Rack middleware. * This initial implementation is a bit hackish, but it uses a normal middleware API so it's future-proof when we improve the internals.
* Move AbstractController to a top-level componentYehuda Katz2009-08-061-0/+159