aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/abstract_controller
Commit message (Collapse)AuthorAgeFilesLines
* Add cancellation info to before filter docsZachary Wasserman2018-03-141-0/+12
| | | | | | | | | It is important for users to know that a render or redirect in a "before" filter causes the action to be cancelled. This was addressed in the guide, but not the API docs (http://guides.rubyonrails.org/action_controller_overview.html#filters). [ci skip]
* [Action Pack] require => require_relativeAkira Matsuda2017-10-212-2/+2
| | | | | This basically reverts e9fca7668b9eba82bcc832cb0061459703368397, d08da958b9ae17d4bbe4c9d7db497ece2450db5f, d1fe1dcf8ab1c0210a37c2a78c1ee52cf199a66d, and 68eaf7b4d5f2bb56d939f71c5ece2d61cf6680a3
* Keep `:api: plugin` methods in the doc [ci skip]Ryuta Kamizono2017-10-201-3/+3
| | | | | | | `:api:` tag was removed in 5349f231 since RDoc doesn't support `:api:` tag. But those methods are not private API, they are public API for renderers. The renderers should be able to know that they can override this method.
* Make internal methods in `AbstractController::Rendering` to privateRyuta Kamizono2017-10-021-0/+1
|
* Remove `:api:` tag that has leaked on the doc directly [ci skip]Ryuta Kamizono2017-09-302-15/+3
| | | | | | | | | | | | Currently `:api:` tag has leaked on the doc directly since RDoc doesn't support `:api:` tag directive. http://api.rubyonrails.org/v5.1/classes/AbstractController/Rendering.html So `:api: private` doesn't work as expected. We are using `:nodoc:` for the purpose. Related #13989.
* Replace unnecessary link with typewriter text [ci skip]Yoshiyuki Hirano2017-09-021-2/+2
|
* Use frozen string literal in actionpack/Kir Shatrov2017-07-2913-0/+26
|
* [Abstract Controller] require => require_relativeAkira Matsuda2017-07-012-2/+2
|
* Remove useless class checking for `ActiveSupport::Callbacks`s result_lambdafatkodima2017-06-271-1/+1
|
* Allow translate default option to accept an array similar to i18n.t. Fixes ↵Vipul A M2017-06-151-1/+1
| | | | #29441
* Add option for class_attribute default (#29270)David Heinemeier Hansson2017-05-292-7/+3
| | | | | | | | | | | | * Allow a default value to be declared for class_attribute * Convert to using class_attribute default rather than explicit setter * Removed instance_accessor option by mistake * False is a valid default value * Documentation
* Merge pull request #29072 from ↵Robin Dupret2017-05-211-0/+20
|\ | | | | | | | | dixpac/dixpac/add_documentation_for_validate_and_callback_order_of_execution Improving docs for callbacks execution order [ci skip]
| * Improving docs for callbacks execution order [ci skip]dixpac2017-05-211-0/+20
| | | | | | | | | | When define callbacks latest definition on the same callback/method overwrites previous ones.
* | Merge pull request #29134 from joshaidan/document-action-nameAlex Kitchens2017-05-191-0/+8
|\ \ | | | | | | Add documentation to accessors in AbstractController::Base
| * | Clarified description of formats [ci skip]Brian Jones2017-05-191-1/+1
| | |
| * | Added missing punctuation [ci skip]Brian Jones2017-05-181-3/+3
| | |
| * | Specify only the body of the response is returned [ci skip]Brian Jones2017-05-181-1/+1
| | |
| * | Document accessors response_body, action_name, formats [ci skip]Brian Jones2017-05-171-0/+8
| |/
* / Use recyclable cache keys (#29092)David Heinemeier Hansson2017-05-181-7/+28
|/
* Unfreeze interpolated string because it's useless.Stan Lo2017-02-191-1/+1
|
* Freeze fragment cache related instrument name.Stan Lo2017-02-071-1/+1
| | | | | | | | | | | | | ActionMailer::Base#instrument_name and ActionController::Base#instrument_name will be frequently called once caching is enabled. So it's better to freeze them instead of create new string on every call. Also, the instrument name in #instrument_fragment_cache will usually be "write_fragment.action_controller" or "read_fragment.action_controller". So freezing them might also gain some performance improvement. We have done something like this in other places: https://github.com/rails/rails/blob/master/actionview/lib/action_view/template.rb#L348
* Change ActionView ERB Handler from Erubis to ErubiJeremy Evans2017-01-251-2/+0
| | | | | | | | | | | | | | | | | | | | | | | Erubi offers the following advantages for Rails: * Works with ruby's --enable-frozen-string-literal option * Has 88% smaller memory footprint * Does no freedom patching (Erubis adds a method to Kernel) * Has simpler internals (1 file, <150 lines of code) * Has an open development model (Erubis doesn't have a public source control repository or bug tracker) * Is not dead (Erubis hasn't been updated since 2011) Erubi is a simplified fork of Erubis that contains just the parts that are generally needed (which includes the parts that Rails uses). The only intentional difference in behavior is that it does not include support for <%=== tags for debug output. That could be added to the ActionView ERB handler if it is desired. The Erubis template handler remains in a deprecated state so that code that accesses it directly does not break. It can be removed after Rails 5.1.
* Extract variant setter to process methodJon Moss2017-01-021-4/+4
| | | | | | | Provide an API interface similar to how format is handled in Controllers. In situations where variants are not needed (ex: in Action Mailer) the method will simply trigger a no-op, and will not affect end users.
* Privatize unneededly protected methods in Action PackAkira Matsuda2016-12-242-3/+3
|
* Merge pull request #26905 from bogdanvlviv/docsAndrew White2016-11-131-4/+4
|\ | | | | Add missing `+` around a some literals.
| * Add missing `+` around a some literals.bogdanvlviv2016-10-271-4/+4
| | | | | | | | | | | | Mainly around `nil` [ci skip]
* | Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-1/+1
| |
* | removes requires already present in active_support/railsXavier Noria2016-10-271-2/+0
|/
* Remove deprecated methods related to controller filtersRafael Mendonça França2016-10-091-39/+0
| | | | | | | | | | `skip_action_callback`, `skip_filter`, `before_filter`, `prepend_before_filter`, `skip_before_filter`, `append_before_filter`, `around_filter` `prepend_around_filter`, `skip_around_filter`, `append_around_filter`, `after_filter`, `prepend_after_filter`, `skip_after_filter` and `append_after_filter`.
* Fix broken comments indentation caused by rubocop auto-correct [ci skip]Ryuta Kamizono2016-09-141-6/+6
| | | | | | All indentation was normalized by rubocop auto-correct at 80e66cc4d90bf8c15d1a5f6e3152e90147f00772. But comments was still kept absolute position. This commit aligns comments with method definitions for consistency.
* Add three new rubocop rulesRafael Mendonça França2016-08-162-2/+2
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* code gardening: removes redundant selfsXavier Noria2016-08-081-1/+1
| | | | | | | | | A few have been left for aesthetic reasons, but have made a pass and removed most of them. Note that if the method `foo` returns an array, `foo << 1` is a regular push, nothing to do with assignments, so no self required.
* Modify LogSubscriber for single partial's cache message.Stan Lo2016-08-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement naive partial caching mechanism. Add test for LogSubscriber Use ActionView::Base#log_payload to store log_subscriber's payload, so we can pass cache result into it. Fixed tests Remove useless settings Check if #log_payload exists before calling it. Because other classes also includes CacheHelper but don't have is attribute Use @log_payload_for_partial_reder instead of #log_payload to carry ActionView's payload. Update test's hash syntax Add configuration to enable/disable fragment caching logging Remove unless test and add new test to ensure cache info won't effect next rendering's log Move :enable_fragment_cache_logging config from ActionView to ActionPack Apply new config to tests Update actionview's changelog Update configuration guide Improve actionview's changelog Refactor PartialRenderer#render and log tests Mute subscriber's log instead of disabling instrumentation. Fix typo, remove useless comment and use new hash syntax Improve actionpack's log_subscriber test Fix rebase mistake Apply new config to all caching intstrument actions
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-12/+12
|
* modernizes hash syntax in actionpackXavier Noria2016-08-061-1/+1
|
* applies new string literal convention in actionpack/libXavier Noria2016-08-066-19/+19
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* render_to_string Regression Outside of Real Requests in Rails 5.0.0.rc1 (#25308)Brandon Medenwald2016-06-091-1/+1
| | | | | | * Restore the functionality of PR#14129, but do so with not nil to better indicate the purpose of the conditional * Add a test when render_to_string called on ActionController::Base.new()
* Use `#performed?` to terminate controller callbacksJeff Kreeftmeijer2016-06-032-1/+8
| | | | | | | | | | | | | | | Since 69009f, `ActionController::Metal::DataStreaming#send_file` doesn't set `@_response_body` anymore. `AbstractController::Callbacks` used `@_response_body` in its callback terminator, so it failed to halt the callback cycle when using `#send_file` from a `before_action`. Instead, it now uses `#performed?` on `AbstractController::Base` and `ActionController::Metal`, which checks `response.committed?`, besides checking if `@_response_body` is set, if possible. Example application: https://gist.github.com/jeffkreeftmeijer/78ae4572f36b198e729724b0cf79ef8e
* Revert "Make sure the cache is always populated"Rafael Mendonça França2016-05-201-5/+1
| | | | | | This reverts commit 0ce7eae7418f1b9bb06b351c1f26d50c3674c0d0. Tests were broken https://travis-ci.org/rails/rails/jobs/131850726#L520
* Make sure the cache is always populatedAaron Patterson2016-05-201-1/+5
| | | | This way we don't have to make multiple calls on anonymous controllers
* Move protected instance variable to the right placeRafael Mendonça França2016-05-051-3/+1
| | | | | | | | | 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.
* Actioncable and Actionpack documentation typos [ci skip]Tom Kadwill2016-04-211-1/+1
|
* Break up a circular require between AP/AVSean Griffin2016-03-113-3/+6
| | | | | | | | | | | | | | | | | | Right now referencing the constant `AbstractController::Rendering` causes `ActionView::Base` to be loaded, and thus the load hooks for action_view are run. If that load hook references any part of action view that then references action controller (such as `ActionView::TestCase`), the constant `AbstractController::Rendering` will attempt to be autoloaded and blow up. With this change, `ActionView::LoadPaths` no longer requires `ActionView::Base` (which it had no reason to require). There was a needed class from `AbstractController::Base` in the Rendering module, which I've moved into its own file so we don't need to load all of `AbstractController::Base` there. This commit fixes https://github.com/rails/rails-controller-testing/issues/21
* Merge pull request #24091 from mcfiredrill/fix-helper-method-docsRafael França2016-03-071-1/+2
|\ | | | | clarify that helper_method makes both methods available in the view [ci skip]
| * clarify that helper_method makes both methods available in the viewTony Miller2016-03-071-1/+2
| | | | | | | | | | It's probably obvious to most, but clarify that `:helper_method` will make both of these methods available to the view.
* | Move Caching module to Abstract ControllerRafael Mendonça França2016-02-232-0/+205
|/ | | | | | Abstract Controller is the common component between Action Mailer and Action Controller so if we need to share the caching component it need to be there.
* fix permitted? conditional for `render` callsAaron Patterson2016-01-261-3/+6
|
* Fix undefined error for `ActionController::Parameters`Jon Moss2016-01-261-6/+3
|
* Merge branch '5-0-beta-sec'Aaron Patterson2016-01-251-1/+7
|\ | | | | | | | | | | | | | | | | | | | | * 5-0-beta-sec: bumping version fix version update task to deal with .beta1.1 Eliminate instance level writers for class accessors allow :file to be outside rails root, but anything else must be inside the rails view directory Don't short-circuit reject_if proc stop caching mime types globally use secure string comparisons for basic auth username / password
| * allow :file to be outside rails root, but anything else must be inside the ↵Aaron Patterson2016-01-221-1/+7
| | | | | | | | | | | | rails view directory CVE-2016-0752