# typed: true # DO NOT EDIT MANUALLY # This is an autogenerated file for types exported from the `actionpack` gem. # Please instead update this file by running `bin/tapioca gem actionpack`. # :markup: markdown # # source://actionpack//lib/abstract_controller/deprecator.rb#5 module AbstractController extend ::ActiveSupport::Autoload class << self # source://actionpack//lib/abstract_controller/deprecator.rb#6 def deprecator; end # source://actionpack//lib/abstract_controller.rb#27 def eager_load!; end end end # Raised when a non-existing controller action is triggered. # # source://actionpack//lib/abstract_controller/base.rb#13 class AbstractController::ActionNotFound < ::StandardError include ::DidYouMean::Correctable # @return [ActionNotFound] a new instance of ActionNotFound # # source://actionpack//lib/abstract_controller/base.rb#16 def initialize(message = T.unsafe(nil), controller = T.unsafe(nil), action = T.unsafe(nil)); end # source://actionpack//lib/abstract_controller/base.rb#14 def action; end # source://actionpack//lib/abstract_controller/base.rb#14 def controller; end # source://actionpack//lib/abstract_controller/base.rb#25 def corrections; end end # source://actionpack//lib/abstract_controller/asset_paths.rb#6 module AbstractController::AssetPaths extend ::ActiveSupport::Concern end # # Abstract Controller Base # # AbstractController::Base is a low-level API. Nobody should be using it # directly, and subclasses (like ActionController::Base) are expected to provide # their own `render` method, since rendering means different things depending on # the context. # # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. # # source://actionpack//lib/abstract_controller/base.rb#37 class AbstractController::Base include ::ActiveSupport::Configurable extend ::ActiveSupport::Configurable::ClassMethods extend ::ActiveSupport::DescendantsTracker # Delegates to the class's ::action_methods. # # source://actionpack//lib/abstract_controller/base.rb#172 def action_methods; end # Returns the name of the action this controller is processing. # # source://activesupport/8.0.0/lib/active_support/core_ext/module/attr_internal.rb#43 def action_name; end # source://activesupport/8.0.0/lib/active_support/core_ext/module/attr_internal.rb#43 def action_name=(_arg0); end # Returns true if a method for the action is available and can be dispatched, # false otherwise. # # Notice that `action_methods.include?("foo")` may return false and # `available_action?("foo")` returns true because this method considers actions # that are also available through other means, for example, implicit render # ones. # # #### Parameters # * `action_name` - The name of an action to be tested # # @return [Boolean] # # source://actionpack//lib/abstract_controller/base.rb#187 def available_action?(action_name); end # Delegates to the class's ::controller_path. # # source://actionpack//lib/abstract_controller/base.rb#167 def controller_path; end # Returns the formats that can be processed by the controller. # # source://activesupport/8.0.0/lib/active_support/core_ext/module/attr_internal.rb#43 def formats; end # source://activesupport/8.0.0/lib/active_support/core_ext/module/attr_internal.rb#43 def formats=(_arg0); end # source://actionpack//lib/abstract_controller/base.rb#204 def inspect; end # Tests if a response body is set. Used to determine if the `process_action` # callback needs to be terminated in AbstractController::Callbacks. # # @return [Boolean] # # source://actionpack//lib/abstract_controller/base.rb#193 def performed?; end # Calls the action going through the entire Action Dispatch stack. # # The actual method that is called is determined by calling #method_for_action. # If no method can handle the action, then an AbstractController::ActionNotFound # error is raised. # # #### Returns # * `self` # # source://actionpack//lib/abstract_controller/base.rb#154 def process(action, *_arg1, **_arg2, &_arg3); end # Returns the body of the HTTP response sent by the controller. # # source://activesupport/8.0.0/lib/active_support/core_ext/module/attr_internal.rb#43 def response_body; end # source://activesupport/8.0.0/lib/active_support/core_ext/module/attr_internal.rb#43 def response_body=(_arg0); end # Actually call the method associated with the action. Override this method if # you wish to change how action methods are called, not to add additional # behavior around it. For example, you would override #send_action if you want # to inject arguments into the method. def send_action(*_arg0); end private # Takes an action name and returns the name of the method that will handle the # action. # # It checks if the action name is valid and returns false otherwise. # # See method_for_action for more information. # # #### Parameters # * `action_name` - An action name to find a method name for # # # #### Returns # * `string` - The name of the method that handles the action # * false - No valid method name could be found. # # Raise `AbstractController::ActionNotFound`. # # source://actionpack//lib/abstract_controller/base.rb#258 def _find_action_name(action_name); end # If the action name was not found, but a method called "action_missing" was # found, #method_for_action will return "_handle_action_missing". This method # calls #action_missing with the current action name. # # source://actionpack//lib/abstract_controller/base.rb#238 def _handle_action_missing(*args); end # Checks if the action name is valid and returns false otherwise. # # @return [Boolean] # # source://actionpack//lib/abstract_controller/base.rb#295 def _valid_action_name?(action_name); end # Returns true if the name can be considered an action because it has a method # defined in the controller. # # #### Parameters # * `name` - The name of an action to be tested # # @return [Boolean] # # source://actionpack//lib/abstract_controller/base.rb#215 def action_method?(name); end # Takes an action name and returns the name of the method that will handle the # action. In normal cases, this method returns the same name as it receives. By # default, if #method_for_action receives a name that is not an action, it will # look for an #action_missing method and return "_handle_action_missing" if one # is found. # # Subclasses may override this method to add additional conditions that should # be considered an action. For instance, an HTTP controller with a template # matching the action name is considered to exist. # # If you override this method to handle additional cases, you may also provide a # method (like `_handle_method_missing`) to handle the case. # # If none of these conditions are true, and `method_for_action` returns `nil`, # an `AbstractController::ActionNotFound` exception will be raised. # # #### Parameters # * `action_name` - An action name to find a method name for # # # #### Returns # * `string` - The name of the method that handles the action # * `nil` - No method name could be found. # # source://actionpack//lib/abstract_controller/base.rb#286 def method_for_action(action_name); end # Call the action. Override this in a subclass to modify the behavior around # processing an action. This, and not #process, is the intended way to override # action dispatching. # # Notice that the first argument is the method to be dispatched which is **not** # necessarily the same as the action name. # # source://actionpack//lib/abstract_controller/base.rb#225 def process_action(*_arg0, **_arg1, &_arg2); end class << self # Returns the value of attribute abstract. # # source://actionpack//lib/abstract_controller/base.rb#54 def abstract; end # Define a controller as abstract. See internal_methods for more details. # # source://actionpack//lib/abstract_controller/base.rb#58 def abstract!; end # Returns the value of attribute abstract. # # source://actionpack//lib/abstract_controller/base.rb#54 def abstract?; end # A list of method names that should be considered actions. This includes all # public instance methods on a controller, less any internal methods (see # internal_methods), adding back in any methods that are internal, but still # exist on the class itself. # # #### Returns # * `Set` - A set of all methods that should be considered actions. # # source://actionpack//lib/abstract_controller/base.rb#97 def action_methods; end # action_methods are cached and there is sometimes a need to refresh them. # ::clear_action_methods! allows you to do that, so next time you run # action_methods, they will be recalculated. # # source://actionpack//lib/abstract_controller/base.rb#112 def clear_action_methods!; end # Returns the full controller name, underscored, without the ending Controller. # # class MyApp::MyPostsController < AbstractController::Base # # end # # MyApp::MyPostsController.controller_path # => "my_app/my_posts" # # #### Returns # * `String` # # source://actionpack//lib/abstract_controller/base.rb#127 def controller_path; end # source://actionpack//lib/abstract_controller/base.rb#137 def eager_load!; end # source://actionpack//lib/abstract_controller/base.rb#62 def inherited(klass); end # A list of all internal methods for a controller. This finds the first abstract # superclass of a controller, and gets a list of all public instance methods on # that abstract class. Public instance methods of a controller would normally be # considered action methods, so methods declared on abstract classes are being # removed. (ActionController::Metal and ActionController::Base are defined as # abstract) # # source://actionpack//lib/abstract_controller/base.rb#77 def internal_methods; end # Refresh the cached action_methods when a new action_method is added. # # source://actionpack//lib/abstract_controller/base.rb#132 def method_added(name); end # Returns true if the given controller is capable of rendering a path. A # subclass of `AbstractController::Base` may return false. An Email controller # for example does not support paths, only full URLs. # # @return [Boolean] # # source://actionpack//lib/abstract_controller/base.rb#200 def supports_path?; end end end # source://actionpack//lib/abstract_controller/caching.rb#6 module AbstractController::Caching include ::AbstractController::Caching::ConfigMethods extend ::ActiveSupport::Concern extend ::ActiveSupport::Autoload include GeneratedInstanceMethods include ::AbstractController::Caching::Fragments mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::AbstractController::Caching::Fragments::ClassMethods mixes_in_class_methods ::AbstractController::Caching::ClassMethods mixes_in_class_methods ::AbstractController::Caching::ConfigMethods # source://actionpack//lib/abstract_controller/caching.rb#54 def view_cache_dependencies; end private # Convenience accessor. # # source://actionpack//lib/abstract_controller/caching.rb#60 def cache(key, options = T.unsafe(nil), &block); end module GeneratedClassMethods def _view_cache_dependencies; end def _view_cache_dependencies=(value); end def _view_cache_dependencies?; end def fragment_cache_keys; end def fragment_cache_keys=(value); end def fragment_cache_keys?; end end module GeneratedInstanceMethods def _view_cache_dependencies; end def _view_cache_dependencies=(value); end def _view_cache_dependencies?; end def fragment_cache_keys; end def fragment_cache_keys=(value); end def fragment_cache_keys?; end end end # source://actionpack//lib/abstract_controller/caching.rb#48 module AbstractController::Caching::ClassMethods # source://actionpack//lib/abstract_controller/caching.rb#49 def view_cache_dependency(&dependency); end end # source://actionpack//lib/abstract_controller/caching.rb#14 module AbstractController::Caching::ConfigMethods # source://actionpack//lib/abstract_controller/caching.rb#15 def cache_store; end # source://actionpack//lib/abstract_controller/caching.rb#19 def cache_store=(store); end private # @return [Boolean] # # source://actionpack//lib/abstract_controller/caching.rb#24 def cache_configured?; end end # # Abstract Controller Caching Fragments # # Fragment caching is used for caching various blocks within views without # caching the entire action as a whole. This is useful when certain elements of # an action change frequently or depend on complicated state while other parts # rarely change or can be shared amongst multiple parties. The caching is done # using the `cache` helper available in the Action View. See # ActionView::Helpers::CacheHelper for more information. # # While it's strongly recommended that you use key-based cache expiration (see # links in CacheHelper for more information), it is also possible to manually # expire caches. For example: # # expire_fragment('name_of_cache') # # source://actionpack//lib/abstract_controller/caching/fragments.rb#21 module AbstractController::Caching::Fragments extend ::ActiveSupport::Concern include GeneratedInstanceMethods mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::AbstractController::Caching::Fragments::ClassMethods # Given a key (as described in `expire_fragment`), returns a key array suitable # for use in reading, writing, or expiring a cached fragment. All keys begin # with `:views`, followed by `ENV["RAILS_CACHE_ID"]` or # `ENV["RAILS_APP_VERSION"]` if set, followed by any controller-wide key prefix # values, ending with the specified `key` value. # # source://actionpack//lib/abstract_controller/caching/fragments.rb#68 def combined_fragment_cache_key(key); end # Removes fragments from the cache. # # `key` can take one of three forms: # # * String - This would normally take the form of a path, like # `pages/45/notes`. # * Hash - Treated as an implicit call to `url_for`, like `{ controller: # 'pages', action: 'notes', id: 45}` # * Regexp - Will remove any fragment that matches, so `%r{pages/\d*/notes}` # might remove all notes. Make sure you don't use anchors in the regex (`^` # or `$`) because the actual filename matched looks like # `./cache/filename/path.cache`. Note: Regexp expiration is only supported # on caches that can iterate over all keys (unlike memcached). # # # `options` is passed through to the cache store's `delete` method (or # `delete_matched`, for Regexp keys). # # source://actionpack//lib/abstract_controller/caching/fragments.rb#131 def expire_fragment(key, options = T.unsafe(nil)); end # Check if a cached fragment from the location signified by `key` exists (see # `expire_fragment` for acceptable formats). # # @return [Boolean] # # source://actionpack//lib/abstract_controller/caching/fragments.rb#105 def fragment_exist?(key, options = T.unsafe(nil)); end # source://actionpack//lib/abstract_controller/caching/fragments.rb#144 def instrument_fragment_cache(name, key, &block); end # Reads a cached fragment from the location signified by `key` (see # `expire_fragment` for acceptable formats). # # source://actionpack//lib/abstract_controller/caching/fragments.rb#93 def read_fragment(key, options = T.unsafe(nil)); end # Writes `content` to the location signified by `key` (see `expire_fragment` for # acceptable formats). # # source://actionpack//lib/abstract_controller/caching/fragments.rb#80 def write_fragment(key, content, options = T.unsafe(nil)); end module GeneratedClassMethods def fragment_cache_keys; end def fragment_cache_keys=(value); end def fragment_cache_keys?; end end module GeneratedInstanceMethods def fragment_cache_keys; end def fragment_cache_keys=(value); end def fragment_cache_keys?; end end end # source://actionpack//lib/abstract_controller/caching/fragments.rb#38 module AbstractController::Caching::Fragments::ClassMethods # Allows you to specify controller-wide key prefixes for cache fragments. Pass # either a constant `value`, or a block which computes a value each time a cache # key is generated. # # For example, you may want to prefix all fragment cache keys with a global # version identifier, so you can easily invalidate all caches. # # class ApplicationController # fragment_cache_key "v1" # end # # When it's time to invalidate all fragments, simply change the string constant. # Or, progressively roll out the cache invalidation using a computed value: # # class ApplicationController # fragment_cache_key do # @account.id.odd? ? "v1" : "v2" # end # end # # source://actionpack//lib/abstract_controller/caching/fragments.rb#58 def fragment_cache_key(value = T.unsafe(nil), &key); end end # # Abstract Controller Callbacks # # Abstract Controller provides hooks during the life cycle of a controller # action. Callbacks allow you to trigger logic during this cycle. Available # callbacks are: # # * `after_action` # * `append_after_action` # * `append_around_action` # * `append_before_action` # * `around_action` # * `before_action` # * `prepend_after_action` # * `prepend_around_action` # * `prepend_before_action` # * `skip_after_action` # * `skip_around_action` # * `skip_before_action` # # source://actionpack//lib/abstract_controller/callbacks.rb#24 module AbstractController::Callbacks extend ::ActiveSupport::Concern include GeneratedInstanceMethods include ::ActiveSupport::Callbacks mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods mixes_in_class_methods ::ActiveSupport::DescendantsTracker mixes_in_class_methods ::AbstractController::Callbacks::ClassMethods private # Override `AbstractController::Base#process_action` to run the `process_action` # callbacks around the normal behavior. # # source://actionpack//lib/abstract_controller/callbacks.rb#259 def process_action(*_arg0, **_arg1, &_arg2); end module GeneratedClassMethods def __callbacks; end def __callbacks=(value); end end module GeneratedInstanceMethods def __callbacks; end end end # source://actionpack//lib/abstract_controller/callbacks.rb#39 class AbstractController::Callbacks::ActionFilter # @return [ActionFilter] a new instance of ActionFilter # # source://actionpack//lib/abstract_controller/callbacks.rb#40 def initialize(filters, conditional_key, actions); end # @return [Boolean] # # source://actionpack//lib/abstract_controller/callbacks.rb#46 def after(controller); end # @return [Boolean] # # source://actionpack//lib/abstract_controller/callbacks.rb#46 def around(controller); end # @return [Boolean] # # source://actionpack//lib/abstract_controller/callbacks.rb#46 def before(controller); end # @return [Boolean] # # source://actionpack//lib/abstract_controller/callbacks.rb#46 def match?(controller); end end # source://actionpack//lib/abstract_controller/callbacks.rb#74 module AbstractController::Callbacks::ClassMethods # Take callback names and an optional callback proc, normalize them, then call # the block with each callback. This allows us to abstract the normalization # across several methods that use it. # # #### Parameters # * `callbacks` - An array of callbacks, with an optional options hash as the # last parameter. # * `block` - A proc that should be added to the callbacks. # # # #### Block Parameters # * `name` - The callback to be added. # * `options` - A hash of options to be used when adding the callback. # # source://actionpack//lib/abstract_controller/callbacks.rb#120 def _insert_callbacks(callbacks, block = T.unsafe(nil)); end # source://actionpack//lib/abstract_controller/callbacks.rb#98 def _normalize_callback_option(options, from, to); end # If `:only` or `:except` are used, convert the options into the `:if` and # `:unless` options of ActiveSupport::Callbacks. # # The basic idea is that `:only => :index` gets converted to `:if => proc {|c| # c.action_name == "index" }`. # # Note that `:only` has priority over `:if` in case they are used together. # # only: :index, if: -> { true } # the :if option will be ignored. # # Note that `:if` has priority over `:except` in case they are used together. # # except: :index, if: -> { true } # the :except option will be ignored. # # #### Options # * `only` - The callback should be run only for this action. # * `except` - The callback should be run for all actions except this action. # # source://actionpack//lib/abstract_controller/callbacks.rb#93 def _normalize_callback_options(options); end # source://actionpack//lib/abstract_controller/callbacks.rb#231 def after_action(*names, &blk); end # source://actionpack//lib/abstract_controller/callbacks.rb#231 def append_after_action(*names, &blk); end # source://actionpack//lib/abstract_controller/callbacks.rb#231 def append_around_action(*names, &blk); end # source://actionpack//lib/abstract_controller/callbacks.rb#231 def append_before_action(*names, &blk); end # source://actionpack//lib/abstract_controller/callbacks.rb#231 def around_action(*names, &blk); end # source://actionpack//lib/abstract_controller/callbacks.rb#231 def before_action(*names, &blk); end # source://actionpack//lib/abstract_controller/callbacks.rb#237 def prepend_after_action(*names, &blk); end # source://actionpack//lib/abstract_controller/callbacks.rb#237 def prepend_around_action(*names, &blk); end # source://actionpack//lib/abstract_controller/callbacks.rb#237 def prepend_before_action(*names, &blk); end # source://actionpack//lib/abstract_controller/callbacks.rb#245 def skip_after_action(*names); end # source://actionpack//lib/abstract_controller/callbacks.rb#245 def skip_around_action(*names); end # source://actionpack//lib/abstract_controller/callbacks.rb#245 def skip_before_action(*names); end end # source://actionpack//lib/abstract_controller/collector.rb#8 module AbstractController::Collector # source://actionpack//lib/abstract_controller/collector.rb#12 def atom(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def bmp(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def css(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def csv(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def gif(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def gzip(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def html(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def ics(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def jpeg(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def js(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def json(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def m4a(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def mp3(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def mp4(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def mpeg(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def multipart_form(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def ogg(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def otf(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def pdf(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def png(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def rss(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def svg(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def text(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def tiff(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def ttf(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def url_encoded_form(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def vcf(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def vtt(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def webm(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def webp(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def woff(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def woff2(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def xml(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def yaml(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/collector.rb#12 def zip(*_arg0, **_arg1, &_arg2); end private # source://actionpack//lib/abstract_controller/collector.rb#27 def method_missing(symbol, *_arg1, **_arg2, &_arg3); end class << self # source://actionpack//lib/abstract_controller/collector.rb#9 def generate_method_for_mime(mime); end end end # source://actionpack//lib/abstract_controller/rendering.rb#10 class AbstractController::DoubleRenderError < ::AbstractController::Error # @return [DoubleRenderError] a new instance of DoubleRenderError # # source://actionpack//lib/abstract_controller/rendering.rb#13 def initialize(message = T.unsafe(nil)); end end # source://actionpack//lib/abstract_controller/rendering.rb#11 AbstractController::DoubleRenderError::DEFAULT_MESSAGE = T.let(T.unsafe(nil), String) # source://actionpack//lib/abstract_controller/error.rb#6 class AbstractController::Error < ::StandardError; end # source://actionpack//lib/abstract_controller/helpers.rb#9 module AbstractController::Helpers extend ::ActiveSupport::Concern extend ::AbstractController::Helpers::Resolution include GeneratedInstanceMethods mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::AbstractController::Helpers::ClassMethods # source://actionpack//lib/abstract_controller/helpers.rb#28 def _helpers; end module GeneratedClassMethods def _helper_methods; end def _helper_methods=(value); end def _helper_methods?; end end module GeneratedInstanceMethods def _helper_methods; end def _helper_methods=(value); end def _helper_methods?; end end end # source://actionpack//lib/abstract_controller/helpers.rb#64 module AbstractController::Helpers::ClassMethods include ::AbstractController::Helpers::Resolution # Sets the attribute _helpers # # @param value the value to set the attribute _helpers to. # # source://actionpack//lib/abstract_controller/helpers.rb#76 def _helpers=(_arg0); end # source://actionpack//lib/abstract_controller/helpers.rb#218 def _helpers_for_modification; end # Clears up all existing helpers in this class, only keeping the helper with the # same name as this class. # # source://actionpack//lib/abstract_controller/helpers.rb#209 def clear_helpers; end # Includes the given modules in the template class. # # Modules can be specified in different ways. All of the following calls include # `FooHelper`: # # # Module, recommended. # helper FooHelper # # # String/symbol without the "helper" suffix, camel or snake case. # helper "Foo" # helper :Foo # helper "foo" # helper :foo # # The last two assume that `"foo".camelize` returns "Foo". # # When strings or symbols are passed, the method finds the actual module object # using String#constantize. Therefore, if the module has not been yet loaded, it # has to be autoloadable, which is normally the case. # # Namespaces are supported. The following calls include `Foo::BarHelper`: # # # Module, recommended. # helper Foo::BarHelper # # # String/symbol without the "helper" suffix, camel or snake case. # helper "Foo::Bar" # helper :"Foo::Bar" # helper "foo/bar" # helper :"foo/bar" # # The last two assume that `"foo/bar".camelize` returns "Foo::Bar". # # The method accepts a block too. If present, the block is evaluated in the # context of the controller helper module. This simple call makes the `wadus` # method available in templates of the enclosing controller: # # helper do # def wadus # "wadus" # end # end # # Furthermore, all the above styles can be mixed together: # # helper FooHelper, "woo", "bar/baz" do # def wadus # "wadus" # end # end # # source://actionpack//lib/abstract_controller/helpers.rb#198 def helper(*args, &block); end # Declare a controller method as a helper. For example, the following # makes the `current_user` and `logged_in?` controller methods available # to the view: # # class ApplicationController < ActionController::Base # helper_method :current_user, :logged_in? # # private # def current_user # @current_user ||= User.find_by(id: session[:user]) # end # # def logged_in? # current_user != nil # end # end # # In a view: # # <% if logged_in? -%>Welcome, <%= current_user.name %><% end -%> # # #### Parameters # * `method[, method]` - A name or names of a method on the controller to be # made available on the view. # # source://actionpack//lib/abstract_controller/helpers.rb#128 def helper_method(*methods); end # When a class is inherited, wrap its helper module in a new module. This # ensures that the parent class's module can be changed independently of the # child class's. # # source://actionpack//lib/abstract_controller/helpers.rb#68 def inherited(klass); end private # source://actionpack//lib/abstract_controller/helpers.rb#237 def default_helper_module!; end # source://actionpack//lib/abstract_controller/helpers.rb#226 def define_helpers_module(klass, helpers = T.unsafe(nil)); end end # source://actionpack//lib/abstract_controller/helpers.rb#32 module AbstractController::Helpers::Resolution # source://actionpack//lib/abstract_controller/helpers.rb#48 def all_helpers_from_path(path); end # source://actionpack//lib/abstract_controller/helpers.rb#57 def helper_modules_from_paths(paths); end # source://actionpack//lib/abstract_controller/helpers.rb#33 def modules_for_helpers(modules_or_helper_prefixes); end end # source://actionpack//lib/abstract_controller/logger.rb#8 module AbstractController::Logger extend ::ActiveSupport::Concern include ::ActiveSupport::Benchmarkable end # source://actionpack//lib/abstract_controller/rendering.rb#18 module AbstractController::Rendering extend ::ActiveSupport::Concern include ::ActionView::ViewPaths mixes_in_class_methods ::ActionView::ViewPaths::ClassMethods # Normalizes arguments and options, and then delegates to render_to_body and # sticks the result in `self.response_body`. # # Supported options depend on the underlying `render_to_body` implementation. # # source://actionpack//lib/abstract_controller/rendering.rb#26 def render(*args, &block); end # Performs the actual template rendering. # # source://actionpack//lib/abstract_controller/rendering.rb#50 def render_to_body(options = T.unsafe(nil)); end # Similar to #render, but only returns the rendered template as a string, # instead of setting `self.response_body`. # # If a component extends the semantics of `response_body` (as ActionController # extends it to be anything that responds to the method each), this method needs # to be overridden in order to still return a string. # # source://actionpack//lib/abstract_controller/rendering.rb#44 def render_to_string(*args, &block); end # Returns `Content-Type` of rendered content. # # source://actionpack//lib/abstract_controller/rendering.rb#54 def rendered_format; end # This method should return a hash with assigns. You can overwrite this # configuration per controller. # # source://actionpack//lib/abstract_controller/rendering.rb#62 def view_assigns; end private # Normalize args by converting `render "foo"` to `render action: "foo"` and # `render "foo/bar"` to `render file: "foo/bar"`. # # source://actionpack//lib/abstract_controller/rendering.rb#73 def _normalize_args(action = T.unsafe(nil), options = T.unsafe(nil)); end # Normalize options. # # source://actionpack//lib/abstract_controller/rendering.rb#88 def _normalize_options(options); end # Normalize args and options. # # source://actionpack//lib/abstract_controller/rendering.rb#114 def _normalize_render(*args, &block); end # Process the rendered format. # # source://actionpack//lib/abstract_controller/rendering.rb#98 def _process_format(format); end # Process extra options. # # source://actionpack//lib/abstract_controller/rendering.rb#93 def _process_options(options); end # source://actionpack//lib/abstract_controller/rendering.rb#101 def _process_variant(options); end # source://actionpack//lib/abstract_controller/rendering.rb#121 def _protected_ivars; end # source://actionpack//lib/abstract_controller/rendering.rb#104 def _set_html_content_type; end # source://actionpack//lib/abstract_controller/rendering.rb#110 def _set_rendered_content_type(format); end # source://actionpack//lib/abstract_controller/rendering.rb#107 def _set_vary_header; end end # source://actionpack//lib/abstract_controller/rendering.rb#58 AbstractController::Rendering::DEFAULT_PROTECTED_INSTANCE_VARIABLES = T.let(T.unsafe(nil), Array) # source://actionpack//lib/abstract_controller/translation.rb#8 module AbstractController::Translation # Delegates to `I18n.localize`. # # source://actionpack//lib/abstract_controller/translation.rb#37 def l(object, **options); end # Delegates to `I18n.localize`. # # source://actionpack//lib/abstract_controller/translation.rb#37 def localize(object, **options); end # Delegates to `I18n.translate`. # # When the given key starts with a period, it will be scoped by the current # controller and action. So if you call `translate(".foo")` from # `PeopleController#index`, it will convert the call to # `I18n.translate("people.index.foo")`. This makes it less repetitive to # translate many keys within the same controller / action and gives you a simple # framework for scoping them consistently. # # source://actionpack//lib/abstract_controller/translation.rb#17 def t(key, **options); end # Delegates to `I18n.translate`. # # When the given key starts with a period, it will be scoped by the current # controller and action. So if you call `translate(".foo")` from # `PeopleController#index`, it will convert the call to # `I18n.translate("people.index.foo")`. This makes it less repetitive to # translate many keys within the same controller / action and gives you a simple # framework for scoping them consistently. # # source://actionpack//lib/abstract_controller/translation.rb#17 def translate(key, **options); end end # # URL For # # Includes `url_for` into the host class (e.g. an abstract controller or # mailer). The class has to provide a `RouteSet` by implementing the `_routes` # methods. Otherwise, an exception will be raised. # # Note that this module is completely decoupled from HTTP - the only requirement # is a valid `_routes` implementation. # # source://actionpack//lib/abstract_controller/url_for.rb#14 module AbstractController::UrlFor extend ::ActiveSupport::Concern include GeneratedInstanceMethods include ::ActionDispatch::Routing::UrlFor mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::AbstractController::UrlFor::ClassMethods # source://actionpack//lib/abstract_controller/url_for.rb#18 def _routes; end module GeneratedClassMethods def default_url_options; end def default_url_options=(value); end def default_url_options?; end end module GeneratedInstanceMethods def default_url_options; end def default_url_options=(value); end def default_url_options?; end end end # source://actionpack//lib/abstract_controller/url_for.rb#23 module AbstractController::UrlFor::ClassMethods # source://actionpack//lib/abstract_controller/url_for.rb#24 def _routes; end # source://actionpack//lib/abstract_controller/url_for.rb#28 def action_methods; end end # # Action Controller # # Action Controller is a module of Action Pack. # # Action Controller provides a base controller class that can be subclassed to # implement filters and actions to handle requests. The result of an action is # typically content generated from views. # # source://actionpack//lib/action_controller/metal/exceptions.rb#5 module ActionController extend ::ActiveSupport::Autoload class << self # See Renderers.add # # source://actionpack//lib/action_controller/metal/renderers.rb#7 def add_renderer(key, &block); end # source://actionpack//lib/action_controller/deprecator.rb#6 def deprecator; end # See Renderers.remove # # source://actionpack//lib/action_controller/metal/renderers.rb#12 def remove_renderer(key); end end end # # Action Controller API # # API Controller is a lightweight version of ActionController::Base, created for # applications that don't require all functionalities that a complete Rails # controller provides, allowing you to create controllers with just the features # that you need for API only applications. # # An API Controller is different from a normal controller in the sense that by # default it doesn't include a number of features that are usually required by # browser access only: layouts and templates rendering, flash, assets, and so # on. This makes the entire controller stack thinner, suitable for API # applications. It doesn't mean you won't have such features if you need them: # they're all available for you to include in your application, they're just not # part of the default API controller stack. # # Normally, `ApplicationController` is the only controller that inherits from # `ActionController::API`. All other controllers in turn inherit from # `ApplicationController`. # # A sample controller could look like this: # # class PostsController < ApplicationController # def index # posts = Post.all # render json: posts # end # end # # Request, response, and parameters objects all work the exact same way as # ActionController::Base. # # ## Renders # # The default API Controller stack includes all renderers, which means you can # use `render :json` and siblings freely in your controllers. Keep in mind that # templates are not going to be rendered, so you need to ensure your controller # is calling either `render` or `redirect_to` in all actions, otherwise it will # return `204 No Content`. # # def show # post = Post.find(params[:id]) # render json: post # end # # ## Redirects # # Redirects are used to move from one action to another. You can use the # `redirect_to` method in your controllers in the same way as in # ActionController::Base. For example: # # def create # redirect_to root_url and return if not_authorized? # # do stuff here # end # # ## Adding New Behavior # # In some scenarios you may want to add back some functionality provided by # ActionController::Base that is not present by default in # `ActionController::API`, for instance `MimeResponds`. This module gives you # the `respond_to` method. Adding it is quite simple, you just need to include # the module in a specific controller or in `ApplicationController` in case you # want it available in your entire application: # # class ApplicationController < ActionController::API # include ActionController::MimeResponds # end # # class PostsController < ApplicationController # def index # posts = Post.all # # respond_to do |format| # format.json { render json: posts } # format.xml { render xml: posts } # end # end # end # # Make sure to check the modules included in ActionController::Base if you want # to use any other functionality that is not provided by `ActionController::API` # out of the box. # # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. # # source://actionpack//lib/action_controller/api.rb#92 class ActionController::API < ::ActionController::Metal include ::ActionView::ViewPaths include ::AbstractController::Rendering include ::ActionDispatch::Routing::PolymorphicRoutes include ::ActionDispatch::Routing::UrlFor include ::AbstractController::UrlFor include ::ActionController::UrlFor include ::AbstractController::Logger include ::ActiveSupport::Benchmarkable include ::ActionController::Redirecting include ::ActionController::ApiRendering include ::ActionController::Rendering include ::ActionController::Renderers include ::ActionController::Renderers::All include ::ActionController::Head include ::ActionController::ConditionalGet include ::ActionController::BasicImplicitRender include ::ActionController::StrongParameters include ::ActionController::RateLimiting include ::ActionController::Caching include ::AbstractController::Caching::Fragments include ::AbstractController::Caching::ConfigMethods include ::AbstractController::Caching include ::ActionController::DataStreaming include ::ActionController::DefaultHeaders include ::ActionController::Logging include ::ActiveSupport::Callbacks include ::AbstractController::Callbacks include ::ActiveSupport::Rescuable include ::ActionController::Rescue include ::ActionController::Instrumentation include ::ActionController::ParamsWrapper extend ::ActionView::ViewPaths::ClassMethods extend ::AbstractController::UrlFor::ClassMethods extend ::ActionController::Rendering::ClassMethods extend ::ActionController::Renderers::ClassMethods extend ::ActionController::ConditionalGet::ClassMethods extend ::ActionController::RateLimiting::ClassMethods extend ::AbstractController::Caching::Fragments::ClassMethods extend ::AbstractController::Caching::ClassMethods extend ::AbstractController::Caching::ConfigMethods extend ::ActionController::DefaultHeaders::ClassMethods extend ::ActionController::Logging::ClassMethods extend ::ActiveSupport::Callbacks::ClassMethods extend ::AbstractController::Callbacks::ClassMethods extend ::ActiveSupport::Rescuable::ClassMethods extend ::ActionController::Instrumentation::ClassMethods extend ::ActionController::ParamsWrapper::ClassMethods # source://activesupport/8.0.0/lib/active_support/callbacks.rb#69 def __callbacks; end # source://activesupport/8.0.0/lib/active_support/callbacks.rb#923 def _process_action_callbacks; end # source://actionpack//lib/action_controller/metal/renderers.rb#31 def _renderers; end # source://actionpack//lib/action_controller/metal/renderers.rb#31 def _renderers=(_arg0); end # source://actionpack//lib/action_controller/metal/renderers.rb#31 def _renderers?; end # source://activesupport/8.0.0/lib/active_support/callbacks.rb#911 def _run_process_action_callbacks(&block); end # source://actionpack//lib/abstract_controller/caching.rb#44 def _view_cache_dependencies; end # source://actionpack//lib/abstract_controller/caching.rb#44 def _view_cache_dependencies=(_arg0); end # source://actionpack//lib/abstract_controller/caching.rb#44 def _view_cache_dependencies?; end # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 def _wrapper_options; end # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 def _wrapper_options=(_arg0); end # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 def _wrapper_options?; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def default_static_extension; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def default_static_extension=(value); end # source://actionpack//lib/action_dispatch/routing/url_for.rb#100 def default_url_options; end # source://actionpack//lib/action_dispatch/routing/url_for.rb#100 def default_url_options=(_arg0); end # source://actionpack//lib/action_dispatch/routing/url_for.rb#100 def default_url_options?; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def enable_fragment_cache_logging; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def enable_fragment_cache_logging=(value); end # source://actionpack//lib/action_controller/metal/conditional_get.rb#15 def etaggers; end # source://actionpack//lib/action_controller/metal/conditional_get.rb#15 def etaggers=(_arg0); end # source://actionpack//lib/action_controller/metal/conditional_get.rb#15 def etaggers?; end # source://actionpack//lib/abstract_controller/caching/fragments.rb#26 def fragment_cache_keys; end # source://actionpack//lib/abstract_controller/caching/fragments.rb#26 def fragment_cache_keys=(_arg0); end # source://actionpack//lib/abstract_controller/caching/fragments.rb#26 def fragment_cache_keys?; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def logger; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def logger=(value); end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def perform_caching; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def perform_caching=(value); end # source://actionpack//lib/abstract_controller/callbacks.rb#36 def raise_on_missing_callback_actions; end # source://actionpack//lib/abstract_controller/callbacks.rb#36 def raise_on_missing_callback_actions=(val); end # source://actionpack//lib/action_controller/metal/redirecting.rb#17 def raise_on_open_redirects; end # source://actionpack//lib/action_controller/metal/redirecting.rb#17 def raise_on_open_redirects=(val); end # source://activesupport/8.0.0/lib/active_support/rescuable.rb#15 def rescue_handlers; end # source://activesupport/8.0.0/lib/active_support/rescuable.rb#15 def rescue_handlers=(_arg0); end # source://activesupport/8.0.0/lib/active_support/rescuable.rb#15 def rescue_handlers?; end class << self # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#12 def __callbacks; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#15 def __callbacks=(new_value); end # source://activesupport/8.0.0/lib/active_support/callbacks.rb#915 def _process_action_callbacks; end # source://activesupport/8.0.0/lib/active_support/callbacks.rb#919 def _process_action_callbacks=(value); end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#12 def _renderers; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#15 def _renderers=(new_value); end # source://actionpack//lib/action_controller/metal/renderers.rb#31 def _renderers?; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#12 def _view_cache_dependencies; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#15 def _view_cache_dependencies=(new_value); end # source://actionpack//lib/abstract_controller/caching.rb#44 def _view_cache_dependencies?; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#12 def _wrapper_options; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#15 def _wrapper_options=(new_value); end # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 def _wrapper_options?; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def default_static_extension; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def default_static_extension=(value); end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#12 def default_url_options; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#15 def default_url_options=(new_value); end # source://actionpack//lib/action_dispatch/routing/url_for.rb#100 def default_url_options?; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def enable_fragment_cache_logging; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def enable_fragment_cache_logging=(value); end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#12 def etaggers; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#15 def etaggers=(new_value); end # source://actionpack//lib/action_controller/metal/conditional_get.rb#15 def etaggers?; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#12 def fragment_cache_keys; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#15 def fragment_cache_keys=(new_value); end # source://actionpack//lib/abstract_controller/caching/fragments.rb#26 def fragment_cache_keys?; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def logger; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def logger=(value); end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#12 def middleware_stack; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#15 def middleware_stack=(new_value); end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def perform_caching; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def perform_caching=(value); end # source://actionpack//lib/abstract_controller/callbacks.rb#36 def raise_on_missing_callback_actions; end # source://actionpack//lib/abstract_controller/callbacks.rb#36 def raise_on_missing_callback_actions=(val); end # source://actionpack//lib/action_controller/metal/redirecting.rb#17 def raise_on_open_redirects; end # source://actionpack//lib/action_controller/metal/redirecting.rb#17 def raise_on_open_redirects=(val); end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#12 def rescue_handlers; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#15 def rescue_handlers=(new_value); end # source://activesupport/8.0.0/lib/active_support/rescuable.rb#15 def rescue_handlers?; end # Shortcut helper that returns all the ActionController::API modules except the # ones passed as arguments: # # class MyAPIBaseController < ActionController::Metal # ActionController::API.without_modules(:UrlFor).each do |left| # include left # end # end # # This gives better control over what you want to exclude and makes it easier to # create an API controller class, instead of listing the modules required # manually. # # source://actionpack//lib/action_controller/api.rb#107 def without_modules(*modules); end end end # source://actionpack//lib/action_controller/api.rb#115 ActionController::API::MODULES = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_controller/metal/exceptions.rb#6 class ActionController::ActionControllerError < ::StandardError; end # source://actionpack//lib/action_controller/metal/allow_browser.rb#6 module ActionController::AllowBrowser extend ::ActiveSupport::Concern mixes_in_class_methods ::ActionController::AllowBrowser::ClassMethods private # source://actionpack//lib/action_controller/metal/allow_browser.rb#63 def allow_browser(versions:, block:); end end # source://actionpack//lib/action_controller/metal/allow_browser.rb#73 class ActionController::AllowBrowser::BrowserBlocker # @return [BrowserBlocker] a new instance of BrowserBlocker # # source://actionpack//lib/action_controller/metal/allow_browser.rb#80 def initialize(request, versions:); end # @return [Boolean] # # source://actionpack//lib/action_controller/metal/allow_browser.rb#84 def blocked?; end # Returns the value of attribute request. # # source://actionpack//lib/action_controller/metal/allow_browser.rb#78 def request; end # Returns the value of attribute versions. # # source://actionpack//lib/action_controller/metal/allow_browser.rb#78 def versions; end private # @return [Boolean] # # source://actionpack//lib/action_controller/metal/allow_browser.rb#105 def bot?; end # source://actionpack//lib/action_controller/metal/allow_browser.rb#121 def expanded_versions; end # source://actionpack//lib/action_controller/metal/allow_browser.rb#117 def minimum_browser_version_for_browser; end # source://actionpack//lib/action_controller/metal/allow_browser.rb#125 def normalized_browser_name; end # source://actionpack//lib/action_controller/metal/allow_browser.rb#89 def parsed_user_agent; end # @return [Boolean] # # source://actionpack//lib/action_controller/metal/allow_browser.rb#97 def unsupported_browser?; end # @return [Boolean] # # source://actionpack//lib/action_controller/metal/allow_browser.rb#93 def user_agent_version_reported?; end # @return [Boolean] # # source://actionpack//lib/action_controller/metal/allow_browser.rb#109 def version_below_minimum_required?; end # @return [Boolean] # # source://actionpack//lib/action_controller/metal/allow_browser.rb#101 def version_guarded_browser?; end end # source://actionpack//lib/action_controller/metal/allow_browser.rb#74 ActionController::AllowBrowser::BrowserBlocker::SETS = T.let(T.unsafe(nil), Hash) # source://actionpack//lib/action_controller/metal/allow_browser.rb#9 module ActionController::AllowBrowser::ClassMethods # Specify the browser versions that will be allowed to access all actions (or # some, as limited by `only:` or `except:`). Only browsers matched in the hash # or named set passed to `versions:` will be blocked if they're below the # versions specified. This means that all other browsers, as well as agents that # aren't reporting a user-agent header, will be allowed access. # # A browser that's blocked will by default be served the file in # public/406-unsupported-browser.html with a HTTP status code of "406 Not # Acceptable". # # In addition to specifically named browser versions, you can also pass # `:modern` as the set to restrict support to browsers natively supporting webp # images, web push, badges, import maps, CSS nesting, and CSS :has. This # includes Safari 17.2+, Chrome 120+, Firefox 121+, Opera 106+. # # You can use https://caniuse.com to check for browser versions supporting the # features you use. # # You can use `ActiveSupport::Notifications` to subscribe to events of browsers # being blocked using the `browser_block.action_controller` event name. # # Examples: # # class ApplicationController < ActionController::Base # # Allow only browsers natively supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has # allow_browser versions: :modern # end # # class ApplicationController < ActionController::Base # # Allow only browsers natively supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has # allow_browser versions: :modern, block: :handle_outdated_browser # # private # def handle_outdated_browser # render file: Rails.root.join("public/custom-error.html"), status: :not_acceptable # end # end # # class ApplicationController < ActionController::Base # # All versions of Chrome and Opera will be allowed, but no versions of "internet explorer" (ie). Safari needs to be 16.4+ and Firefox 121+. # allow_browser versions: { safari: 16.4, firefox: 121, ie: false } # end # # class MessagesController < ApplicationController # # In addition to the browsers blocked by ApplicationController, also block Opera below 104 and Chrome below 119 for the show action. # allow_browser versions: { opera: 104, chrome: 119 }, only: :show # end # # source://actionpack//lib/action_controller/metal/allow_browser.rb#57 def allow_browser(versions:, block: T.unsafe(nil), **options); end end # source://actionpack//lib/action_controller/api/api_rendering.rb#6 module ActionController::ApiRendering extend ::ActiveSupport::Concern include ::ActionController::Rendering mixes_in_class_methods ::ActionController::Rendering::ClassMethods # source://actionpack//lib/action_controller/api/api_rendering.rb#13 def render_to_body(options = T.unsafe(nil)); end end # source://actionpack//lib/action_controller/metal/exceptions.rb#9 class ActionController::BadRequest < ::ActionController::ActionControllerError # @return [BadRequest] a new instance of BadRequest # # source://actionpack//lib/action_controller/metal/exceptions.rb#10 def initialize(msg = T.unsafe(nil)); end end # # Action Controller Base # # Action Controllers are the core of a web request in Rails. They are made up of # one or more actions that are executed on request and then either it renders a # template or redirects to another action. An action is defined as a public # method on the controller, which will automatically be made accessible to the # web-server through Rails Routes. # # By default, only the ApplicationController in a Rails application inherits # from `ActionController::Base`. All other controllers inherit from # ApplicationController. This gives you one class to configure things such as # request forgery protection and filtering of sensitive request parameters. # # A sample controller could look like this: # # class PostsController < ApplicationController # def index # @posts = Post.all # end # # def create # @post = Post.create params[:post] # redirect_to posts_path # end # end # # Actions, by default, render a template in the `app/views` directory # corresponding to the name of the controller and action after executing code in # the action. For example, the `index` action of the PostsController would # render the template `app/views/posts/index.html.erb` by default after # populating the `@posts` instance variable. # # Unlike index, the create action will not render a template. After performing # its main purpose (creating a new post), it initiates a redirect instead. This # redirect works by returning an external `302 Moved` HTTP response that takes # the user to the index action. # # These two methods represent the two basic action archetypes used in Action # Controllers: Get-and-show and do-and-redirect. Most actions are variations on # these themes. # # ## Requests # # For every request, the router determines the value of the `controller` and # `action` keys. These determine which controller and action are called. The # remaining request parameters, the session (if one is available), and the full # request with all the HTTP headers are made available to the action through # accessor methods. Then the action is performed. # # The full request object is available via the request accessor and is primarily # used to query for HTTP headers: # # def server_ip # location = request.env["REMOTE_ADDR"] # render plain: "This server hosted at #{location}" # end # # ## Parameters # # All request parameters, whether they come from a query string in the URL or # form data submitted through a POST request are available through the `params` # method which returns a hash. For example, an action that was performed through # `/posts?category=All&limit=5` will include `{ "category" => "All", "limit" => # "5" }` in `params`. # # It's also possible to construct multi-dimensional parameter hashes by # specifying keys using brackets, such as: # # # # # A request coming from a form holding these inputs will include `{ "post" => { # "name" => "david", "address" => "hyacintvej" } }`. If the address input had # been named `post[address][street]`, the `params` would have included `{ "post" # => { "address" => { "street" => "hyacintvej" } } }`. There's no limit to the # depth of the nesting. # # ## Sessions # # Sessions allow you to store objects in between requests. This is useful for # objects that are not yet ready to be persisted, such as a Signup object # constructed in a multi-paged process, or objects that don't change much and # are needed all the time, such as a User object for a system that requires # login. The session should not be used, however, as a cache for objects where # it's likely they could be changed unknowingly. It's usually too much work to # keep it all synchronized -- something databases already excel at. # # You can place objects in the session by using the `session` method, which # accesses a hash: # # session[:person] = Person.authenticate(user_name, password) # # You can retrieve it again through the same hash: # # "Hello #{session[:person]}" # # For removing objects from the session, you can either assign a single key to # `nil`: # # # removes :person from session # session[:person] = nil # # or you can remove the entire session with `reset_session`. # # By default, sessions are stored in an encrypted browser cookie (see # ActionDispatch::Session::CookieStore). Thus the user will not be able to read # or edit the session data. However, the user can keep a copy of the cookie even # after it has expired, so you should avoid storing sensitive information in # cookie-based sessions. # # ## Responses # # Each action results in a response, which holds the headers and document to be # sent to the user's browser. The actual response object is generated # automatically through the use of renders and redirects and requires no user # intervention. # # ## Renders # # Action Controller sends content to the user by using one of five rendering # methods. The most versatile and common is the rendering of a template. # Included in the Action Pack is the Action View, which enables rendering of ERB # templates. It's automatically configured. The controller passes objects to the # view by assigning instance variables: # # def show # @post = Post.find(params[:id]) # end # # Which are then automatically available to the view: # # Title: <%= @post.title %> # # You don't have to rely on the automated rendering. For example, actions that # could result in the rendering of different templates will use the manual # rendering methods: # # def search # @results = Search.find(params[:query]) # case @results.count # when 0 then render action: "no_results" # when 1 then render action: "show" # when 2..10 then render action: "show_many" # end # end # # Read more about writing ERB and Builder templates in ActionView::Base. # # ## Redirects # # Redirects are used to move from one action to another. For example, after a # `create` action, which stores a blog entry to the database, we might like to # show the user the new entry. Because we're following good DRY principles # (Don't Repeat Yourself), we're going to reuse (and redirect to) a `show` # action that we'll assume has already been created. The code might look like # this: # # def create # @entry = Entry.new(params[:entry]) # if @entry.save # # The entry was saved correctly, redirect to show # redirect_to action: 'show', id: @entry.id # else # # things didn't go so well, do something else # end # end # # In this case, after saving our new entry to the database, the user is # redirected to the `show` method, which is then executed. Note that this is an # external HTTP-level redirection which will cause the browser to make a second # request (a GET to the show action), and not some internal re-routing which # calls both "create" and then "show" within one request. # # Learn more about `redirect_to` and what options you have in # ActionController::Redirecting. # # ## Calling multiple redirects or renders # # An action may perform only a single render or a single redirect. Attempting to # do either again will result in a DoubleRenderError: # # def do_something # redirect_to action: "elsewhere" # render action: "overthere" # raises DoubleRenderError # end # # If you need to redirect on the condition of something, then be sure to add # "return" to halt execution. # # def do_something # if monkeys.nil? # redirect_to(action: "elsewhere") # return # end # render action: "overthere" # won't be called if monkeys is nil # end # # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. # # source://actionpack//lib/action_controller/base.rb#207 class ActionController::Base < ::ActionController::Metal include ::ActionView::ViewPaths include ::AbstractController::Rendering include ::AbstractController::Translation include ::AbstractController::AssetPaths include ::AbstractController::Helpers include ::ActionController::Helpers include ::ActionDispatch::Routing::PolymorphicRoutes include ::ActionDispatch::Routing::UrlFor include ::AbstractController::UrlFor include ::ActionController::UrlFor include ::AbstractController::Logger include ::ActiveSupport::Benchmarkable include ::ActionController::Redirecting include ::ActionView::Rendering include ::ActionView::Layouts include ::ActionController::Rendering include ::ActionController::Renderers include ::ActionController::Renderers::All include ::ActionController::Head include ::ActionController::ConditionalGet include ::ActionController::EtagWithTemplateDigest include ::ActionController::EtagWithFlash include ::ActionController::Caching include ::AbstractController::Caching::Fragments include ::AbstractController::Caching::ConfigMethods include ::AbstractController::Caching include ::ActionController::MimeResponds include ::ActionController::BasicImplicitRender include ::ActionController::ImplicitRender include ::ActionController::StrongParameters include ::ActionController::ParameterEncoding include ::ActionController::Cookies include ::ActionController::Flash include ::ActionController::FormBuilder include ::ActiveSupport::Callbacks include ::AbstractController::Callbacks include ::ActionController::RequestForgeryProtection include ::ActionController::ContentSecurityPolicy include ::ActionController::PermissionsPolicy include ::ActionController::RateLimiting include ::ActionController::AllowBrowser include ::ActionController::Streaming include ::ActionController::DataStreaming include ::ActionController::HttpAuthentication::Basic::ControllerMethods include ::ActionController::HttpAuthentication::Digest::ControllerMethods include ::ActionController::HttpAuthentication::Token::ControllerMethods include ::ActionController::DefaultHeaders include ::ActionController::Logging include ::ActiveSupport::Rescuable include ::ActionController::Rescue include ::ActionController::Instrumentation include ::ActionController::ParamsWrapper extend ::ActionView::ViewPaths::ClassMethods extend ::AbstractController::Helpers::Resolution extend ::AbstractController::Helpers::ClassMethods extend ::ActionController::Helpers::ClassMethods extend ::AbstractController::UrlFor::ClassMethods extend ::ActionView::Rendering::ClassMethods extend ::ActionView::Layouts::ClassMethods extend ::ActionController::Rendering::ClassMethods extend ::ActionController::Renderers::ClassMethods extend ::ActionController::ConditionalGet::ClassMethods extend ::AbstractController::Caching::Fragments::ClassMethods extend ::AbstractController::Caching::ClassMethods extend ::AbstractController::Caching::ConfigMethods extend ::ActionController::ParameterEncoding::ClassMethods extend ::ActionController::Flash::ClassMethods extend ::ActionController::FormBuilder::ClassMethods extend ::ActiveSupport::Callbacks::ClassMethods extend ::AbstractController::Callbacks::ClassMethods extend ::ActionController::RequestForgeryProtection::ClassMethods extend ::ActionController::ContentSecurityPolicy::ClassMethods extend ::ActionController::PermissionsPolicy::ClassMethods extend ::ActionController::RateLimiting::ClassMethods extend ::ActionController::AllowBrowser::ClassMethods extend ::ActionController::HttpAuthentication::Basic::ControllerMethods::ClassMethods extend ::ActionController::DefaultHeaders::ClassMethods extend ::ActionController::Logging::ClassMethods extend ::ActiveSupport::Rescuable::ClassMethods extend ::ActionController::Instrumentation::ClassMethods extend ::ActionController::ParamsWrapper::ClassMethods # source://activesupport/8.0.0/lib/active_support/callbacks.rb#69 def __callbacks; end # source://actionpack//lib/abstract_controller/helpers.rb#13 def _helper_methods; end # source://actionpack//lib/abstract_controller/helpers.rb#13 def _helper_methods=(_arg0); end # source://actionpack//lib/abstract_controller/helpers.rb#13 def _helper_methods?; end # source://actionview/8.0.0/lib/action_view/layouts.rb#212 def _layout_conditions; end # source://actionview/8.0.0/lib/action_view/layouts.rb#212 def _layout_conditions?; end # source://activesupport/8.0.0/lib/active_support/callbacks.rb#923 def _process_action_callbacks; end # source://actionpack//lib/action_controller/metal/renderers.rb#31 def _renderers; end # source://actionpack//lib/action_controller/metal/renderers.rb#31 def _renderers=(_arg0); end # source://actionpack//lib/action_controller/metal/renderers.rb#31 def _renderers?; end # source://activesupport/8.0.0/lib/active_support/callbacks.rb#911 def _run_process_action_callbacks(&block); end # source://actionpack//lib/abstract_controller/caching.rb#44 def _view_cache_dependencies; end # source://actionpack//lib/abstract_controller/caching.rb#44 def _view_cache_dependencies=(_arg0); end # source://actionpack//lib/abstract_controller/caching.rb#44 def _view_cache_dependencies?; end # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 def _wrapper_options; end # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 def _wrapper_options=(_arg0); end # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 def _wrapper_options?; end # source://actionpack//lib/action_controller/metal/flash.rb#38 def alert; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def allow_forgery_protection; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def allow_forgery_protection=(value); end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def asset_host; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def asset_host=(value); end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def assets_dir; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def assets_dir=(value); end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def csrf_token_storage_strategy; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def csrf_token_storage_strategy=(value); end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def default_asset_host_protocol; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def default_asset_host_protocol=(value); end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def default_static_extension; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def default_static_extension=(value); end # source://actionpack//lib/action_dispatch/routing/url_for.rb#100 def default_url_options; end # source://actionpack//lib/action_dispatch/routing/url_for.rb#100 def default_url_options=(_arg0); end # source://actionpack//lib/action_dispatch/routing/url_for.rb#100 def default_url_options?; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def enable_fragment_cache_logging; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def enable_fragment_cache_logging=(value); end # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#31 def etag_with_template_digest; end # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#31 def etag_with_template_digest=(_arg0); end # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#31 def etag_with_template_digest?; end # source://actionpack//lib/action_controller/metal/conditional_get.rb#15 def etaggers; end # source://actionpack//lib/action_controller/metal/conditional_get.rb#15 def etaggers=(_arg0); end # source://actionpack//lib/action_controller/metal/conditional_get.rb#15 def etaggers?; end # source://actionpack//lib/action_controller/metal/flash.rb#12 def flash(*_arg0, **_arg1, &_arg2); end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def forgery_protection_origin_check; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def forgery_protection_origin_check=(value); end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def forgery_protection_strategy; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def forgery_protection_strategy=(value); end # source://actionpack//lib/abstract_controller/caching/fragments.rb#26 def fragment_cache_keys; end # source://actionpack//lib/abstract_controller/caching/fragments.rb#26 def fragment_cache_keys=(_arg0); end # source://actionpack//lib/abstract_controller/caching/fragments.rb#26 def fragment_cache_keys?; end # source://actionpack//lib/action_controller/metal/helpers.rb#70 def helpers_path; end # source://actionpack//lib/action_controller/metal/helpers.rb#70 def helpers_path=(_arg0); end # source://actionpack//lib/action_controller/metal/helpers.rb#70 def helpers_path?; end # source://actionpack//lib/action_controller/metal/helpers.rb#71 def include_all_helpers; end # source://actionpack//lib/action_controller/metal/helpers.rb#71 def include_all_helpers=(_arg0); end # source://actionpack//lib/action_controller/metal/helpers.rb#71 def include_all_helpers?; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def javascripts_dir; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def javascripts_dir=(value); end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def log_warning_on_csrf_failure; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def log_warning_on_csrf_failure=(value); end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def logger; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def logger=(value); end # source://actionpack//lib/action_controller/metal/flash.rb#38 def notice; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def per_form_csrf_tokens; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def per_form_csrf_tokens=(value); end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def perform_caching; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def perform_caching=(value); end # source://actionpack//lib/abstract_controller/callbacks.rb#36 def raise_on_missing_callback_actions; end # source://actionpack//lib/abstract_controller/callbacks.rb#36 def raise_on_missing_callback_actions=(val); end # source://actionpack//lib/action_controller/metal/redirecting.rb#17 def raise_on_open_redirects; end # source://actionpack//lib/action_controller/metal/redirecting.rb#17 def raise_on_open_redirects=(val); end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def relative_url_root; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def relative_url_root=(value); end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def request_forgery_protection_token; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def request_forgery_protection_token=(value); end # source://activesupport/8.0.0/lib/active_support/rescuable.rb#15 def rescue_handlers; end # source://activesupport/8.0.0/lib/active_support/rescuable.rb#15 def rescue_handlers=(_arg0); end # source://activesupport/8.0.0/lib/active_support/rescuable.rb#15 def rescue_handlers?; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def stylesheets_dir; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def stylesheets_dir=(value); end private # source://actionview/8.0.0/lib/action_view/layouts.rb#328 def _layout(lookup_context, formats); end # source://actionpack//lib/action_controller/base.rb#324 def _protected_ivars; end class << self # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#12 def __callbacks; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#15 def __callbacks=(new_value); end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#12 def _default_form_builder; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#15 def _default_form_builder=(new_value); end # source://actionpack//lib/action_controller/form_builder.rb#35 def _default_form_builder?; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#12 def _flash_types; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#15 def _flash_types=(new_value); end # source://actionpack//lib/action_controller/metal/flash.rb#10 def _flash_types?; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#12 def _helper_methods; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#15 def _helper_methods=(new_value); end # source://actionpack//lib/abstract_controller/helpers.rb#13 def _helper_methods?; end # source://actionpack//lib/abstract_controller/helpers.rb#17 def _helpers; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#12 def _layout; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#15 def _layout=(new_value); end # source://actionview/8.0.0/lib/action_view/layouts.rb#211 def _layout?; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#12 def _layout_conditions; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#15 def _layout_conditions=(new_value); end # source://actionview/8.0.0/lib/action_view/layouts.rb#212 def _layout_conditions?; end # source://activesupport/8.0.0/lib/active_support/callbacks.rb#915 def _process_action_callbacks; end # source://activesupport/8.0.0/lib/active_support/callbacks.rb#919 def _process_action_callbacks=(value); end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#12 def _renderers; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#15 def _renderers=(new_value); end # source://actionpack//lib/action_controller/metal/renderers.rb#31 def _renderers?; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#12 def _view_cache_dependencies; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#15 def _view_cache_dependencies=(new_value); end # source://actionpack//lib/abstract_controller/caching.rb#44 def _view_cache_dependencies?; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#12 def _wrapper_options; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#15 def _wrapper_options=(new_value); end # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 def _wrapper_options?; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def allow_forgery_protection; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def allow_forgery_protection=(value); end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def asset_host; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def asset_host=(value); end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def assets_dir; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def assets_dir=(value); end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def csrf_token_storage_strategy; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def csrf_token_storage_strategy=(value); end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def default_asset_host_protocol; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def default_asset_host_protocol=(value); end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def default_static_extension; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def default_static_extension=(value); end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#12 def default_url_options; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#15 def default_url_options=(new_value); end # source://actionpack//lib/action_dispatch/routing/url_for.rb#100 def default_url_options?; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def enable_fragment_cache_logging; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def enable_fragment_cache_logging=(value); end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#12 def etag_with_template_digest; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#15 def etag_with_template_digest=(new_value); end # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#31 def etag_with_template_digest?; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#12 def etaggers; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#15 def etaggers=(new_value); end # source://actionpack//lib/action_controller/metal/conditional_get.rb#15 def etaggers?; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def forgery_protection_origin_check; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def forgery_protection_origin_check=(value); end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def forgery_protection_strategy; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def forgery_protection_strategy=(value); end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#12 def fragment_cache_keys; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#15 def fragment_cache_keys=(new_value); end # source://actionpack//lib/abstract_controller/caching/fragments.rb#26 def fragment_cache_keys?; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#12 def helpers_path; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#15 def helpers_path=(new_value); end # source://actionpack//lib/action_controller/metal/helpers.rb#70 def helpers_path?; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#12 def include_all_helpers; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#15 def include_all_helpers=(new_value); end # source://actionpack//lib/action_controller/metal/helpers.rb#71 def include_all_helpers?; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def javascripts_dir; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def javascripts_dir=(value); end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def log_warning_on_csrf_failure; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def log_warning_on_csrf_failure=(value); end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def logger; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def logger=(value); end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#12 def middleware_stack; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#15 def middleware_stack=(new_value); end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def per_form_csrf_tokens; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def per_form_csrf_tokens=(value); end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def perform_caching; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def perform_caching=(value); end # source://actionpack//lib/abstract_controller/callbacks.rb#36 def raise_on_missing_callback_actions; end # source://actionpack//lib/abstract_controller/callbacks.rb#36 def raise_on_missing_callback_actions=(val); end # source://actionpack//lib/action_controller/metal/redirecting.rb#17 def raise_on_open_redirects; end # source://actionpack//lib/action_controller/metal/redirecting.rb#17 def raise_on_open_redirects=(val); end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def relative_url_root; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def relative_url_root=(value); end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def request_forgery_protection_token; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def request_forgery_protection_token=(value); end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#12 def rescue_handlers; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#15 def rescue_handlers=(new_value); end # source://activesupport/8.0.0/lib/active_support/rescuable.rb#15 def rescue_handlers?; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#115 def stylesheets_dir; end # source://activesupport/8.0.0/lib/active_support/configurable.rb#116 def stylesheets_dir=(value); end # Shortcut helper that returns all the modules included in # ActionController::Base except the ones passed as arguments: # # class MyBaseController < ActionController::Metal # ActionController::Base.without_modules(:ParamsWrapper, :Streaming).each do |left| # include left # end # end # # This gives better control over what you want to exclude and makes it easier to # create a bare controller class, instead of listing the modules required # manually. # # source://actionpack//lib/action_controller/base.rb#222 def without_modules(*modules); end end end # source://actionpack//lib/action_controller/base.rb#0 module ActionController::Base::HelperMethods # source://actionpack//lib/action_controller/metal/flash.rb#41 def alert(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/caching/fragments.rb#34 def combined_fragment_cache_key(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_controller/metal/content_security_policy.rb#13 def content_security_policy?(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_controller/metal/content_security_policy.rb#14 def content_security_policy_nonce(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_controller/metal/cookies.rb#10 def cookies(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_controller/metal/request_forgery_protection.rb#102 def form_authenticity_token(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_controller/metal/flash.rb#41 def notice(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_controller/metal/request_forgery_protection.rb#103 def protect_against_forgery?(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/abstract_controller/caching.rb#45 def view_cache_dependencies(*_arg0, **_arg1, &_arg2); end end # source://actionpack//lib/action_controller/base.rb#230 ActionController::Base::MODULES = T.let(T.unsafe(nil), Array) # Define some internal variables that should not be propagated to the view. # # source://actionpack//lib/action_controller/base.rb#318 ActionController::Base::PROTECTED_IVARS = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_controller/metal/basic_implicit_render.rb#6 module ActionController::BasicImplicitRender # source://actionpack//lib/action_controller/metal/basic_implicit_render.rb#13 def default_render; end # source://actionpack//lib/action_controller/metal/basic_implicit_render.rb#7 def send_action(method, *args); end end # # Action Controller Caching # # Caching is a cheap way of speeding up slow applications by keeping the result # of calculations, renderings, and database calls around for subsequent # requests. # # You can read more about each approach by clicking the modules below. # # Note: To turn off all caching provided by Action Controller, set # config.action_controller.perform_caching = false # # ## Caching stores # # All the caching stores from ActiveSupport::Cache are available to be used as # backends for Action Controller caching. # # Configuration examples (FileStore is the default): # # config.action_controller.cache_store = :memory_store # config.action_controller.cache_store = :file_store, '/path/to/cache/directory' # config.action_controller.cache_store = :mem_cache_store, 'localhost' # config.action_controller.cache_store = :mem_cache_store, Memcached::Rails.new('localhost:11211') # config.action_controller.cache_store = MyOwnStore.new('parameter') # # source://actionpack//lib/action_controller/caching.rb#29 module ActionController::Caching extend ::ActiveSupport::Concern include GeneratedInstanceMethods include ::AbstractController::Caching::Fragments include ::AbstractController::Caching mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::AbstractController::Caching::Fragments::ClassMethods mixes_in_class_methods ::AbstractController::Caching::ClassMethods mixes_in_class_methods ::AbstractController::Caching::ConfigMethods private # source://actionpack//lib/action_controller/caching.rb#45 def instrument_name; end # source://actionpack//lib/action_controller/caching.rb#37 def instrument_payload(key); end module GeneratedClassMethods def _view_cache_dependencies; end def _view_cache_dependencies=(value); end def _view_cache_dependencies?; end def fragment_cache_keys; end def fragment_cache_keys=(value); end def fragment_cache_keys?; end end module GeneratedInstanceMethods def _view_cache_dependencies; end def _view_cache_dependencies=(value); end def _view_cache_dependencies?; end def fragment_cache_keys; end def fragment_cache_keys=(value); end def fragment_cache_keys?; end end end # source://actionpack//lib/action_controller/metal/conditional_get.rb#9 module ActionController::ConditionalGet include ::ActionController::Head extend ::ActiveSupport::Concern include GeneratedInstanceMethods mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::ActionController::ConditionalGet::ClassMethods # Sets the `Cache-Control` header, overwriting existing directives. This method # will also ensure an HTTP `Date` header for client compatibility. # # Defaults to issuing the `private` directive, so that intermediate caches must # not cache the response. # # #### Options # # `:public` # : If true, replaces the default `private` directive with the `public` # directive. # # `:must_revalidate` # : If true, adds the `must-revalidate` directive. # # `:stale_while_revalidate` # : Sets the value of the `stale-while-revalidate` directive. # # `:stale_if_error` # : Sets the value of the `stale-if-error` directive. # # `:immutable` # : If true, adds the `immutable` directive. # # # Any additional key-value pairs are concatenated as directives. For a list of # supported `Cache-Control` directives, see the [article on # MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control). # # #### Examples # # expires_in 10.minutes # # => Cache-Control: max-age=600, private # # expires_in 10.minutes, public: true # # => Cache-Control: max-age=600, public # # expires_in 10.minutes, public: true, must_revalidate: true # # => Cache-Control: max-age=600, public, must-revalidate # # expires_in 1.hour, stale_while_revalidate: 60.seconds # # => Cache-Control: max-age=3600, private, stale-while-revalidate=60 # # expires_in 1.hour, stale_if_error: 5.minutes # # => Cache-Control: max-age=3600, private, stale-if-error=300 # # expires_in 1.hour, public: true, "s-maxage": 3.hours, "no-transform": true # # => Cache-Control: max-age=3600, public, s-maxage=10800, no-transform=true # # source://actionpack//lib/action_controller/metal/conditional_get.rb#290 def expires_in(seconds, options = T.unsafe(nil)); end # Sets an HTTP 1.1 `Cache-Control` header of `no-cache`. This means the resource # will be marked as stale, so clients must always revalidate. # Intermediate/browser caches may still store the asset. # # source://actionpack//lib/action_controller/metal/conditional_get.rb#309 def expires_now; end # Sets the `etag`, `last_modified`, or both on the response, and renders a `304 # Not Modified` response if the request is already fresh. # # #### Options # # `:etag` # : Sets a "weak" ETag validator on the response. See the `:weak_etag` option. # # `:weak_etag` # : Sets a "weak" ETag validator on the response. Requests that specify an # `If-None-Match` header may receive a `304 Not Modified` response if the # ETag matches exactly. # # : A weak ETag indicates semantic equivalence, not byte-for-byte equality, so # they're good for caching HTML pages in browser caches. They can't be used # for responses that must be byte-identical, like serving `Range` requests # within a PDF file. # # `:strong_etag` # : Sets a "strong" ETag validator on the response. Requests that specify an # `If-None-Match` header may receive a `304 Not Modified` response if the # ETag matches exactly. # # : A strong ETag implies exact equality -- the response must match byte for # byte. This is necessary for serving `Range` requests within a large video # or PDF file, for example, or for compatibility with some CDNs that don't # support weak ETags. # # `:last_modified` # : Sets a "weak" last-update validator on the response. Subsequent requests # that specify an `If-Modified-Since` header may receive a `304 Not # Modified` response if `last_modified` <= `If-Modified-Since`. # # `:public` # : By default the `Cache-Control` header is private. Set this option to # `true` if you want your application to be cacheable by other devices, such # as proxy caches. # # `:cache_control` # : When given, will overwrite an existing `Cache-Control` header. For a list # of `Cache-Control` directives, see the [article on # MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control). # # `:template` # : By default, the template digest for the current controller/action is # included in ETags. If the action renders a different template, you can # include its digest instead. If the action doesn't render a template at # all, you can pass `template: false` to skip any attempt to check for a # template digest. # # # #### Examples # # def show # @article = Article.find(params[:id]) # fresh_when(etag: @article, last_modified: @article.updated_at, public: true) # end # # This will send a `304 Not Modified` response if the request specifies a # matching ETag and `If-Modified-Since` header. Otherwise, it will render the # `show` template. # # You can also just pass a record: # # def show # @article = Article.find(params[:id]) # fresh_when(@article) # end # # `etag` will be set to the record, and `last_modified` will be set to the # record's `updated_at`. # # You can also pass an object that responds to `maximum`, such as a collection # of records: # # def index # @articles = Article.all # fresh_when(@articles) # end # # In this case, `etag` will be set to the collection, and `last_modified` will # be set to `maximum(:updated_at)` (the timestamp of the most recently updated # record). # # When passing a record or a collection, you can still specify other options, # such as `:public` and `:cache_control`: # # def show # @article = Article.find(params[:id]) # fresh_when(@article, public: true, cache_control: { no_cache: true }) # end # # The above will set `Cache-Control: public, no-cache` in the response. # # When rendering a different template than the controller/action's default # template, you can indicate which digest to include in the ETag: # # before_action { fresh_when @article, template: "widgets/show" } # # source://actionpack//lib/action_controller/metal/conditional_get.rb#137 def fresh_when(object = T.unsafe(nil), etag: T.unsafe(nil), weak_etag: T.unsafe(nil), strong_etag: T.unsafe(nil), last_modified: T.unsafe(nil), public: T.unsafe(nil), cache_control: T.unsafe(nil), template: T.unsafe(nil)); end # Cache or yield the block. The cache is supposed to never expire. # # You can use this method when you have an HTTP response that never changes, and # the browser and proxies should cache it indefinitely. # # * `public`: By default, HTTP responses are private, cached only on the # user's web browser. To allow proxies to cache the response, set `true` to # indicate that they can serve the cached response to all users. # # source://actionpack//lib/action_controller/metal/conditional_get.rb#321 def http_cache_forever(public: T.unsafe(nil)); end # Sets an HTTP 1.1 `Cache-Control` header of `no-store`. This means the resource # may not be stored in any cache. # # source://actionpack//lib/action_controller/metal/conditional_get.rb#331 def no_store; end # Sets the `etag` and/or `last_modified` on the response and checks them against # the request. If the request doesn't match the provided options, it is # considered stale, and the response should be rendered from scratch. Otherwise, # it is fresh, and a `304 Not Modified` is sent. # # #### Options # # See #fresh_when for supported options. # # #### Examples # # def show # @article = Article.find(params[:id]) # # if stale?(etag: @article, last_modified: @article.updated_at) # @statistics = @article.really_expensive_call # respond_to do |format| # # all the supported formats # end # end # end # # You can also just pass a record: # # def show # @article = Article.find(params[:id]) # # if stale?(@article) # @statistics = @article.really_expensive_call # respond_to do |format| # # all the supported formats # end # end # end # # `etag` will be set to the record, and `last_modified` will be set to the # record's `updated_at`. # # You can also pass an object that responds to `maximum`, such as a collection # of records: # # def index # @articles = Article.all # # if stale?(@articles) # @statistics = @articles.really_expensive_call # respond_to do |format| # # all the supported formats # end # end # end # # In this case, `etag` will be set to the collection, and `last_modified` will # be set to `maximum(:updated_at)` (the timestamp of the most recently updated # record). # # When passing a record or a collection, you can still specify other options, # such as `:public` and `:cache_control`: # # def show # @article = Article.find(params[:id]) # # if stale?(@article, public: true, cache_control: { no_cache: true }) # @statistics = @articles.really_expensive_call # respond_to do |format| # # all the supported formats # end # end # end # # The above will set `Cache-Control: public, no-cache` in the response. # # When rendering a different template than the controller/action's default # template, you can indicate which digest to include in the ETag: # # def show # super if stale?(@article, template: "widgets/show") # end # # @return [Boolean] # # source://actionpack//lib/action_controller/metal/conditional_get.rb#236 def stale?(object = T.unsafe(nil), **freshness_kwargs); end private # source://actionpack//lib/action_controller/metal/conditional_get.rb#336 def combine_etags(validator, options); end module GeneratedClassMethods def etaggers; end def etaggers=(value); end def etaggers?; end end module GeneratedInstanceMethods def etaggers; end def etaggers=(value); end def etaggers?; end end end # source://actionpack//lib/action_controller/metal/conditional_get.rb#18 module ActionController::ConditionalGet::ClassMethods # Allows you to consider additional controller-wide information when generating # an ETag. For example, if you serve pages tailored depending on who's logged in # at the moment, you may want to add the current user id to be part of the ETag # to prevent unauthorized displaying of cached pages. # # class InvoicesController < ApplicationController # etag { current_user&.id } # # def show # # Etag will differ even for the same invoice when it's viewed by a different current_user # @invoice = Invoice.find(params[:id]) # fresh_when etag: @invoice # end # end # # source://actionpack//lib/action_controller/metal/conditional_get.rb#33 def etag(&etagger); end end # source://actionpack//lib/action_controller/metal/content_security_policy.rb#6 module ActionController::ContentSecurityPolicy extend ::ActiveSupport::Concern include GeneratedInstanceMethods include ::AbstractController::Helpers include ::ActiveSupport::Callbacks include ::AbstractController::Callbacks mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::AbstractController::Helpers::ClassMethods mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods mixes_in_class_methods ::ActiveSupport::DescendantsTracker mixes_in_class_methods ::AbstractController::Callbacks::ClassMethods mixes_in_class_methods ::ActionController::ContentSecurityPolicy::ClassMethods private # @return [Boolean] # # source://actionpack//lib/action_controller/metal/content_security_policy.rb#74 def content_security_policy?; end # source://actionpack//lib/action_controller/metal/content_security_policy.rb#78 def content_security_policy_nonce; end # source://actionpack//lib/action_controller/metal/content_security_policy.rb#82 def current_content_security_policy; end module GeneratedClassMethods def __callbacks; end def __callbacks=(value); end def _helper_methods; end def _helper_methods=(value); end def _helper_methods?; end end module GeneratedInstanceMethods def __callbacks; end def _helper_methods; end def _helper_methods=(value); end def _helper_methods?; end end end # source://actionpack//lib/action_controller/metal/content_security_policy.rb#17 module ActionController::ContentSecurityPolicy::ClassMethods # Overrides parts of the globally configured `Content-Security-Policy` header: # # class PostsController < ApplicationController # content_security_policy do |policy| # policy.base_uri "https://www.example.com" # end # end # # Options can be passed similar to `before_action`. For example, pass `only: # :index` to override the header on the index action only: # # class PostsController < ApplicationController # content_security_policy(only: :index) do |policy| # policy.default_src :self, :https # end # end # # Pass `false` to remove the `Content-Security-Policy` header: # # class PostsController < ApplicationController # content_security_policy false, only: :index # end # # source://actionpack//lib/action_controller/metal/content_security_policy.rb#40 def content_security_policy(enabled = T.unsafe(nil), **options, &block); end # Overrides the globally configured `Content-Security-Policy-Report-Only` # header: # # class PostsController < ApplicationController # content_security_policy_report_only only: :index # end # # Pass `false` to remove the `Content-Security-Policy-Report-Only` header: # # class PostsController < ApplicationController # content_security_policy_report_only false, only: :index # end # # source://actionpack//lib/action_controller/metal/content_security_policy.rb#66 def content_security_policy_report_only(report_only = T.unsafe(nil), **options); end end # source://actionpack//lib/action_controller/metal/cookies.rb#6 module ActionController::Cookies extend ::ActiveSupport::Concern private # The cookies for the current request. See ActionDispatch::Cookies for more # information. # # source://actionpack//lib/action_controller/metal/cookies.rb#16 def cookies; end end # # Action Controller Data Streaming # # Methods for sending arbitrary data and for streaming files to the browser, # instead of rendering. # # source://actionpack//lib/action_controller/metal/data_streaming.rb#13 module ActionController::DataStreaming extend ::ActiveSupport::Concern include ::ActionController::Rendering mixes_in_class_methods ::ActionController::Rendering::ClassMethods private # Sends the given binary data to the browser. This method is similar to `render # plain: data`, but also allows you to specify whether the browser should # display the response as a file attachment (i.e. in a download dialog) or as # inline data. You may also set the content type, the file name, and other # things. # # Options: # * `:filename` - suggests a filename for the browser to use. # * `:type` - specifies an HTTP content type. Defaults to # `application/octet-stream`. You can specify either a string or a symbol # for a registered type with `Mime::Type.register`, for example `:json`. If # omitted, type will be inferred from the file extension specified in # `:filename`. If no content type is registered for the extension, the # default type `application/octet-stream` will be used. # * `:disposition` - specifies whether the file will be shown inline or # downloaded. Valid values are `"inline"` and `"attachment"` (default). # * `:status` - specifies the status code to send with the response. Defaults # to 200. # # # Generic data download: # # send_data buffer # # Download a dynamically-generated tarball: # # send_data generate_tgz('dir'), filename: 'dir.tgz' # # Display an image Active Record in the browser: # # send_data image.data, type: image.content_type, disposition: 'inline' # # See `send_file` for more information on HTTP `Content-*` headers and caching. # # source://actionpack//lib/action_controller/metal/data_streaming.rb#120 def send_data(data, options = T.unsafe(nil)); end # Sends the file. This uses a server-appropriate method (such as `X-Sendfile`) # via the `Rack::Sendfile` middleware. The header to use is set via # `config.action_dispatch.x_sendfile_header`. Your server can also configure # this for you by setting the `X-Sendfile-Type` header. # # Be careful to sanitize the path parameter if it is coming from a web page. # `send_file(params[:path])` allows a malicious user to download any file on # your server. # # Options: # * `:filename` - suggests a filename for the browser to use. Defaults to # `File.basename(path)`. # * `:type` - specifies an HTTP content type. You can specify either a string # or a symbol for a registered type with `Mime::Type.register`, for example # `:json`. If omitted, the type will be inferred from the file extension # specified in `:filename`. If no content type is registered for the # extension, the default type `application/octet-stream` will be used. # * `:disposition` - specifies whether the file will be shown inline or # downloaded. Valid values are `"inline"` and `"attachment"` (default). # * `:status` - specifies the status code to send with the response. Defaults # to 200. # * `:url_based_filename` - set to `true` if you want the browser to guess the # filename from the URL, which is necessary for i18n filenames on certain # browsers (setting `:filename` overrides this option). # # # The default `Content-Type` and `Content-Disposition` headers are set to # download arbitrary binary files in as many browsers as possible. IE versions # 4, 5, 5.5, and 6 are all known to have a variety of quirks (especially when # downloading over SSL). # # Simple download: # # send_file '/path/to.zip' # # Show a JPEG in the browser: # # send_file '/path/to.jpeg', type: 'image/jpeg', disposition: 'inline' # # Show a 404 page in the browser: # # send_file '/path/to/404.html', type: 'text/html; charset=utf-8', disposition: 'inline', status: 404 # # You can use other `Content-*` HTTP headers to provide additional information # to the client. See MDN for a [list of HTTP # headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers). # # Also be aware that the document may be cached by proxies and browsers. The # `Pragma` and `Cache-Control` headers declare how the file may be cached by # intermediaries. They default to require clients to validate with the server # before releasing cached responses. See https://www.mnot.net/cache_docs/ for an # overview of web caching and [RFC # 9111](https://www.rfc-editor.org/rfc/rfc9111.html#name-cache-control) for the # `Cache-Control` header spec. # # @raise [MissingFile] # # source://actionpack//lib/action_controller/metal/data_streaming.rb#76 def send_file(path, options = T.unsafe(nil)); end # @raise [ArgumentError] # # source://actionpack//lib/action_controller/metal/data_streaming.rb#125 def send_file_headers!(options); end end # source://actionpack//lib/action_controller/metal/data_streaming.rb#19 ActionController::DataStreaming::DEFAULT_SEND_FILE_DISPOSITION = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_controller/metal/data_streaming.rb#18 ActionController::DataStreaming::DEFAULT_SEND_FILE_TYPE = T.let(T.unsafe(nil), String) # # Action Controller Default Headers # # Allows configuring default headers that will be automatically merged into each # response. # # source://actionpack//lib/action_controller/metal/default_headers.rb#10 module ActionController::DefaultHeaders extend ::ActiveSupport::Concern mixes_in_class_methods ::ActionController::DefaultHeaders::ClassMethods end # source://actionpack//lib/action_controller/metal/default_headers.rb#13 module ActionController::DefaultHeaders::ClassMethods # source://actionpack//lib/action_controller/metal/default_headers.rb#14 def make_response!(request); end end # # Action Controller Etag With Flash # # When you're using the flash, it's generally used as a conditional on the view. # This means the content of the view depends on the flash. Which in turn means # that the ETag for a response should be computed with the content of the flash # in mind. This does that by including the content of the flash as a component # in the ETag that's generated for a response. # # source://actionpack//lib/action_controller/metal/etag_with_flash.rb#13 module ActionController::EtagWithFlash extend ::ActiveSupport::Concern include GeneratedInstanceMethods include ::ActionController::ConditionalGet mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::ActionController::ConditionalGet::ClassMethods module GeneratedClassMethods def etaggers; end def etaggers=(value); end def etaggers?; end end module GeneratedInstanceMethods def etaggers; end def etaggers=(value); end def etaggers?; end end end # # Action Controller Etag With Template Digest # # When our views change, they should bubble up into HTTP cache freshness and # bust browser caches. So the template digest for the current action is # automatically included in the ETag. # # Enabled by default for apps that use Action View. Disable by setting # # config.action_controller.etag_with_template_digest = false # # Override the template to digest by passing `:template` to `fresh_when` and # `stale?` calls. For example: # # # We're going to render widgets/show, not posts/show # fresh_when @post, template: 'widgets/show' # # # We're not going to render a template, so omit it from the ETag. # fresh_when @post, template: false # # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#25 module ActionController::EtagWithTemplateDigest extend ::ActiveSupport::Concern include GeneratedInstanceMethods include ::ActionController::ConditionalGet mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::ActionController::ConditionalGet::ClassMethods private # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#39 def determine_template_etag(options); end # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#55 def lookup_and_digest_template(template); end # Pick the template digest to include in the ETag. If the `:template` option is # present, use the named template. If `:template` is `nil` or absent, use the # default controller/action template. If `:template` is false, omit the template # digest from the ETag. # # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#49 def pick_template_for_etag(options); end module GeneratedClassMethods def etag_with_template_digest; end def etag_with_template_digest=(value); end def etag_with_template_digest?; end def etaggers; end def etaggers=(value); end def etaggers?; end end module GeneratedInstanceMethods def etag_with_template_digest; end def etag_with_template_digest=(value); end def etag_with_template_digest?; end def etaggers; end def etaggers=(value); end def etaggers?; end end end # Raised from `expect!` when an expected parameter is missing or is of an # incompatible type. # # params = ActionController::Parameters.new(a: {}) # params.expect!(:a) # # => ActionController::ExpectedParameterMissing: param is missing or the value is empty or invalid: a # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#49 class ActionController::ExpectedParameterMissing < ::ActionController::ParameterMissing; end # source://actionpack//lib/action_controller/metal/flash.rb#6 module ActionController::Flash extend ::ActiveSupport::Concern include GeneratedInstanceMethods mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::ActionController::Flash::ClassMethods private # source://actionpack//lib/action_controller/metal/flash.rb#53 def redirect_to(options = T.unsafe(nil), response_options_and_flash = T.unsafe(nil)); end module GeneratedClassMethods def _flash_types; end def _flash_types=(value); end def _flash_types?; end end module GeneratedInstanceMethods; end end # source://actionpack//lib/action_controller/metal/flash.rb#16 module ActionController::Flash::ClassMethods # source://actionpack//lib/action_controller/metal/flash.rb#47 def action_methods; end # Creates new flash types. You can pass as many types as you want to create # flash types other than the default `alert` and `notice` in your controllers # and views. For instance: # # # in application_controller.rb # class ApplicationController < ActionController::Base # add_flash_types :warning # end # # # in your controller # redirect_to user_path(@user), warning: "Incomplete profile" # # # in your view # <%= warning %> # # This method will automatically define a new method for each of the given # names, and it will be available in your views. # # source://actionpack//lib/action_controller/metal/flash.rb#34 def add_flash_types(*types); end end # # Action Controller Form Builder # # Override the default form builder for all views rendered by this controller # and any of its descendants. Accepts a subclass of # ActionView::Helpers::FormBuilder. # # For example, given a form builder: # # class AdminFormBuilder < ActionView::Helpers::FormBuilder # def special_field(name) # end # end # # The controller specifies a form builder as its default: # # class AdminAreaController < ApplicationController # default_form_builder AdminFormBuilder # end # # Then in the view any form using `form_with` or `form_for` will be an # instance of the specified form builder: # # <%= form_with(model: @instance) do |builder| %> # <%= builder.special_field(:name) %> # <% end %> # # source://actionpack//lib/action_controller/form_builder.rb#31 module ActionController::FormBuilder extend ::ActiveSupport::Concern include GeneratedInstanceMethods mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::ActionController::FormBuilder::ClassMethods # Default form builder for the controller # # source://actionpack//lib/action_controller/form_builder.rb#51 def default_form_builder; end module GeneratedClassMethods def _default_form_builder; end def _default_form_builder=(value); end def _default_form_builder?; end end module GeneratedInstanceMethods; end end # source://actionpack//lib/action_controller/form_builder.rb#38 module ActionController::FormBuilder::ClassMethods # Set the form builder to be used as the default for all forms in the views # rendered by this controller and its subclasses. # # #### Parameters # * `builder` - Default form builder, an instance of # ActionView::Helpers::FormBuilder # # source://actionpack//lib/action_controller/form_builder.rb#45 def default_form_builder(builder); end end # source://actionpack//lib/action_controller/metal/head.rb#6 module ActionController::Head # Returns a response that has no content (merely headers). The options argument # is interpreted to be a hash of header names and values. This allows you to # easily return a response that consists only of significant headers: # # head :created, location: person_path(@person) # # head :created, location: @person # # It can also be used to return exceptional conditions: # # return head(:method_not_allowed) unless request.post? # return head(:bad_request) unless valid_request? # render # # See `Rack::Utils::SYMBOL_TO_STATUS_CODE` for a full list of valid `status` # symbols. # # source://actionpack//lib/action_controller/metal/head.rb#23 def head(status, options = T.unsafe(nil)); end private # @return [Boolean] # # source://actionpack//lib/action_controller/metal/head.rb#56 def include_content?(status); end end # # Action Controller Helpers # # The Rails framework provides a large number of helpers for working with # assets, dates, forms, numbers and model objects, to name a few. These helpers # are available to all templates by default. # # In addition to using the standard template helpers provided, creating custom # helpers to extract complicated logic or reusable functionality is strongly # encouraged. By default, each controller will include all helpers. These # helpers are only accessible on the controller through `#helpers` # # In previous versions of Rails the controller will include a helper which # matches the name of the controller, e.g., `MyController` will automatically # include `MyHelper`. You can revert to the old behavior with the following: # # # config/application.rb # class Application < Rails::Application # config.action_controller.include_all_helpers = false # end # # Additional helpers can be specified using the `helper` class method in # ActionController::Base or any controller which inherits from it. # # The `to_s` method from the Time class can be wrapped in a helper method to # display a custom message if a Time object is blank: # # module FormattedTimeHelper # def format_time(time, format=:long, blank_message=" ") # time.blank? ? blank_message : time.to_fs(format) # end # end # # FormattedTimeHelper can now be included in a controller, using the `helper` # class method: # # class EventsController < ActionController::Base # helper FormattedTimeHelper # def index # @events = Event.all # end # end # # Then, in any view rendered by `EventsController`, the `format_time` method can # be called: # # <% @events.each do |event| -%> #
# <%= format_time(event.time, :short, "N/A") %> | <%= event.name %> #
# <% end -%> # # Finally, assuming we have two event instances, one which has a time and one # which does not, the output might look like this: # # 23 Aug 11:30 | Carolina Railhawks Soccer Match # N/A | Carolina Railhawks Training Workshop # # source://actionpack//lib/action_controller/metal/helpers.rb#63 module ActionController::Helpers extend ::ActiveSupport::Concern include GeneratedInstanceMethods include ::AbstractController::Helpers mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::AbstractController::Helpers::ClassMethods mixes_in_class_methods ::ActionController::Helpers::ClassMethods # Provides a proxy to access helper methods from outside the view. # # source://actionpack//lib/action_controller/metal/helpers.rb#125 def helpers; end class << self # Returns the value of attribute helpers_path. # # source://actionpack//lib/action_controller/metal/helpers.rb#66 def helpers_path; end # Sets the attribute helpers_path # # @param value the value to set the attribute helpers_path to. # # source://actionpack//lib/action_controller/metal/helpers.rb#66 def helpers_path=(_arg0); end end module GeneratedClassMethods def _helper_methods; end def _helper_methods=(value); end def _helper_methods?; end def helpers_path; end def helpers_path=(value); end def helpers_path?; end def include_all_helpers; end def include_all_helpers=(value); end def include_all_helpers?; end end module GeneratedInstanceMethods def _helper_methods; end def _helper_methods=(value); end def _helper_methods?; end def helpers_path; end def helpers_path=(value); end def helpers_path?; end def include_all_helpers; end def include_all_helpers=(value); end def include_all_helpers?; end end end # source://actionpack//lib/action_controller/metal/helpers.rb#74 module ActionController::Helpers::ClassMethods # Declares helper accessors for controller attributes. For example, the # following adds new `name` and `name=` instance methods to a controller and # makes them available to the view: # attr_accessor :name # helper_attr :name # # #### Parameters # * `attrs` - Names of attributes to be converted into helpers. # # source://actionpack//lib/action_controller/metal/helpers.rb#84 def helper_attr(*attrs); end # Provides a proxy to access helper methods from outside the view. # # Note that the proxy is rendered under a different view context. This may cause # incorrect behavior with capture methods. Consider using # [helper](rdoc-ref:AbstractController::Helpers::ClassMethods#helper) instead # when using `capture`. # # source://actionpack//lib/action_controller/metal/helpers.rb#94 def helpers; end # Override modules_for_helpers to accept `:all` as argument, which loads all # helpers in helpers_path. # # #### Parameters # * `args` - A list of helpers # # # #### Returns # * `array` - A normalized list of modules for the list of helpers provided. # # source://actionpack//lib/action_controller/metal/helpers.rb#112 def modules_for_helpers(args); end private # Extract helper names from files in `app/helpers/***/**_helper.rb` # # source://actionpack//lib/action_controller/metal/helpers.rb#119 def all_application_helpers; end end # HTTP Basic, Digest, and Token authentication. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#11 module ActionController::HttpAuthentication; end # # HTTP Basic authentication # # ### Simple Basic example # # class PostsController < ApplicationController # http_basic_authenticate_with name: "dhh", password: "secret", except: :index # # def index # render plain: "Everyone can see me!" # end # # def edit # render plain: "I'm only accessible if you know the password" # end # end # # ### Advanced Basic example # # Here is a more advanced Basic example where only Atom feeds and the XML API # are protected by HTTP authentication. The regular HTML interface is protected # by a session approach: # # class ApplicationController < ActionController::Base # before_action :set_account, :authenticate # # private # def set_account # @account = Account.find_by(url_name: request.subdomains.first) # end # # def authenticate # case request.format # when Mime[:xml], Mime[:atom] # if user = authenticate_with_http_basic { |u, p| @account.users.authenticate(u, p) } # @current_user = user # else # request_http_basic_authentication # end # else # if session_authenticated? # @current_user = @account.users.find(session[:authenticated][:user_id]) # else # redirect_to(login_url) and return false # end # end # end # end # # In your integration tests, you can do something like this: # # def test_access_granted_from_xml # authorization = ActionController::HttpAuthentication::Basic.encode_credentials(users(:dhh).name, users(:dhh).password) # # get "/notes/1.xml", headers: { 'HTTP_AUTHORIZATION' => authorization } # # assert_equal 200, status # end # # source://actionpack//lib/action_controller/metal/http_authentication.rb#69 module ActionController::HttpAuthentication::Basic extend ::ActionController::HttpAuthentication::Basic # source://actionpack//lib/action_controller/metal/http_authentication.rb#130 def auth_param(request); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#126 def auth_scheme(request); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#108 def authenticate(request, &login_procedure); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#138 def authentication_request(controller, realm, message); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#122 def decode_credentials(request); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#134 def encode_credentials(user_name, password); end # @return [Boolean] # # source://actionpack//lib/action_controller/metal/http_authentication.rb#114 def has_basic_credentials?(request); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#118 def user_name_and_password(request); end end # source://actionpack//lib/action_controller/metal/http_authentication.rb#72 module ActionController::HttpAuthentication::Basic::ControllerMethods extend ::ActiveSupport::Concern mixes_in_class_methods ::ActionController::HttpAuthentication::Basic::ControllerMethods::ClassMethods # source://actionpack//lib/action_controller/metal/http_authentication.rb#95 def authenticate_or_request_with_http_basic(realm = T.unsafe(nil), message = T.unsafe(nil), &login_procedure); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#99 def authenticate_with_http_basic(&login_procedure); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#86 def http_basic_authenticate_or_request_with(name:, password:, realm: T.unsafe(nil), message: T.unsafe(nil)); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#103 def request_http_basic_authentication(realm = T.unsafe(nil), message = T.unsafe(nil)); end end # source://actionpack//lib/action_controller/metal/http_authentication.rb#75 module ActionController::HttpAuthentication::Basic::ControllerMethods::ClassMethods # Enables HTTP Basic authentication. # # See ActionController::HttpAuthentication::Basic for example usage. # # @raise [ArgumentError] # # source://actionpack//lib/action_controller/metal/http_authentication.rb#79 def http_basic_authenticate_with(name:, password:, realm: T.unsafe(nil), **options); end end # # HTTP Digest authentication # # ### Simple Digest example # # require "openssl" # class PostsController < ApplicationController # REALM = "SuperSecret" # USERS = {"dhh" => "secret", #plain text password # "dap" => OpenSSL::Digest::MD5.hexdigest(["dap",REALM,"secret"].join(":"))} #ha1 digest password # # before_action :authenticate, except: [:index] # # def index # render plain: "Everyone can see me!" # end # # def edit # render plain: "I'm only accessible if you know the password" # end # # private # def authenticate # authenticate_or_request_with_http_digest(REALM) do |username| # USERS[username] # end # end # end # # ### Notes # # The `authenticate_or_request_with_http_digest` block must return the user's # password or the ha1 digest hash so the framework can appropriately hash to # check the user's credentials. Returning `nil` will cause authentication to # fail. # # Storing the ha1 hash: MD5(username:realm:password), is better than storing a # plain password. If the password file or database is compromised, the attacker # would be able to use the ha1 hash to authenticate as the user at this `realm`, # but would not have the user's password to try using at other sites. # # In rare instances, web servers or front proxies strip authorization headers # before they reach your application. You can debug this situation by logging # all environment variables, and check for HTTP_AUTHORIZATION, amongst others. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#189 module ActionController::HttpAuthentication::Digest extend ::ActionController::HttpAuthentication::Digest # Returns true on a valid response, false otherwise. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#215 def authenticate(request, realm, &password_procedure); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#274 def authentication_header(controller, realm); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#281 def authentication_request(controller, realm, message = T.unsafe(nil)); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#267 def decode_credentials(header); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#263 def decode_credentials_header(request); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#258 def encode_credentials(http_method, credentials, password, password_is_ha1); end # Returns the expected response for a request of `http_method` to `uri` with the # decoded `credentials` and the expected `password` Optional parameter # `password_is_ha1` is set to `true` by default, since best practice is to store # ha1 digest instead of a plain-text password. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#248 def expected_response(http_method, uri, credentials, password, password_is_ha1 = T.unsafe(nil)); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#254 def ha1(credentials, password); end # Uses an MD5 digest based on time to generate a value to be used only once. # # A server-specified data string which should be uniquely generated each time a # 401 response is made. It is recommended that this string be base64 or # hexadecimal data. Specifically, since the string is passed in the header lines # as a quoted string, the double-quote character is not allowed. # # The contents of the nonce are implementation dependent. The quality of the # implementation depends on a good choice. A nonce might, for example, be # constructed as the base 64 encoding of # # time-stamp H(time-stamp ":" ETag ":" private-key) # # where time-stamp is a server-generated time or other non-repeating value, ETag # is the value of the HTTP ETag header associated with the requested entity, and # private-key is data known only to the server. With a nonce of this form a # server would recalculate the hash portion after receiving the client # authentication header and reject the request if it did not match the nonce # from that header or if the time-stamp value is not recent enough. In this way # the server can limit the time of the nonce's validity. The inclusion of the # ETag prevents a replay request for an updated version of the resource. (Note: # including the IP address of the client in the nonce would appear to offer the # server the ability to limit the reuse of the nonce to the same client that # originally got it. However, that would break proxy farms, where requests from # a single user often go through different proxies in the farm. Also, IP address # spoofing is not that hard.) # # An implementation might choose not to accept a previously used nonce or a # previously used digest, in order to protect against a replay attack. Or, an # implementation might choose to use one-time nonces or digests for POST, PUT, # or PATCH requests, and a time-stamp for GET requests. For more details on the # issues involved see Section 4 of this document. # # The nonce is opaque to the client. Composed of Time, and hash of Time with # secret key from the Rails session secret generated upon creation of project. # Ensures the time cannot be modified by client. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#330 def nonce(secret_key, time = T.unsafe(nil)); end # Opaque based on digest of secret key # # source://actionpack//lib/action_controller/metal/http_authentication.rb#348 def opaque(secret_key); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#288 def secret_token(request); end # Returns false unless the request credentials response value matches the # expected value. First try the password as a ha1 digest password. If this # fails, then try it as a plain text password. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#222 def validate_digest_response(request, realm, &password_procedure); end # Might want a shorter timeout depending on whether the request is a PATCH, PUT, # or POST, and if the client is a browser or web service. Can be much shorter if # the Stale directive is implemented. This would allow a user to use new nonce # without prompting the user again for their username and password. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#341 def validate_nonce(secret_key, request, value, seconds_to_timeout = T.unsafe(nil)); end end # source://actionpack//lib/action_controller/metal/http_authentication.rb#192 module ActionController::HttpAuthentication::Digest::ControllerMethods # Authenticate using an HTTP Digest, or otherwise render an HTTP header # requesting the client to send a Digest. # # See ActionController::HttpAuthentication::Digest for example usage. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#197 def authenticate_or_request_with_http_digest(realm = T.unsafe(nil), message = T.unsafe(nil), &password_procedure); end # Authenticate using an HTTP Digest. Returns true if authentication is # successful, false otherwise. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#203 def authenticate_with_http_digest(realm = T.unsafe(nil), &password_procedure); end # Render an HTTP header requesting the client to send a Digest for # authentication. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#209 def request_http_digest_authentication(realm = T.unsafe(nil), message = T.unsafe(nil)); end end # # HTTP Token authentication # # ### Simple Token example # # class PostsController < ApplicationController # TOKEN = "secret" # # before_action :authenticate, except: [ :index ] # # def index # render plain: "Everyone can see me!" # end # # def edit # render plain: "I'm only accessible if you know the password" # end # # private # def authenticate # authenticate_or_request_with_http_token do |token, options| # # Compare the tokens in a time-constant manner, to mitigate # # timing attacks. # ActiveSupport::SecurityUtils.secure_compare(token, TOKEN) # end # end # end # # Here is a more advanced Token example where only Atom feeds and the XML API # are protected by HTTP token authentication. The regular HTML interface is # protected by a session approach: # # class ApplicationController < ActionController::Base # before_action :set_account, :authenticate # # private # def set_account # @account = Account.find_by(url_name: request.subdomains.first) # end # # def authenticate # case request.format # when Mime[:xml], Mime[:atom] # if user = authenticate_with_http_token { |t, o| @account.users.authenticate(t, o) } # @current_user = user # else # request_http_token_authentication # end # else # if session_authenticated? # @current_user = @account.users.find(session[:authenticated][:user_id]) # else # redirect_to(login_url) and return false # end # end # end # end # # In your integration tests, you can do something like this: # # def test_access_granted_from_xml # authorization = ActionController::HttpAuthentication::Token.encode_credentials(users(:dhh).token) # # get "/notes/1.xml", headers: { 'HTTP_AUTHORIZATION' => authorization } # # assert_equal 200, status # end # # On shared hosts, Apache sometimes doesn't pass authentication headers to FCGI # instances. If your environment matches this description and you cannot # authenticate, try this rule in your Apache setup: # # RewriteRule ^(.*)$ dispatch.fcgi [E=X-HTTP_AUTHORIZATION:%{HTTP:Authorization},QSA,L] # # source://actionpack//lib/action_controller/metal/http_authentication.rb#425 module ActionController::HttpAuthentication::Token extend ::ActionController::HttpAuthentication::Token # If token Authorization header is present, call the login procedure with the # present token and options. # # Returns the return value of `login_procedure` if a token is found. Returns # `nil` if no token is found. # # #### Parameters # # * `controller` - ActionController::Base instance for the current request. # * `login_procedure` - Proc to call if a token is present. The Proc should # take two arguments: # # authenticate(controller) { |token, options| ... } # # source://actionpack//lib/action_controller/metal/http_authentication.rb#472 def authenticate(controller, &login_procedure); end # Sets a WWW-Authenticate header to let the client know a token is desired. # # Returns nothing. # # #### Parameters # # * `controller` - ActionController::Base instance for the outgoing response. # * `realm` - String realm to use in the header. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#555 def authentication_request(controller, realm, message = T.unsafe(nil)); end # Encodes the given token and options into an Authorization header value. # # Returns String. # # #### Parameters # # * `token` - String token. # * `options` - Optional Hash of the options. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#539 def encode_credentials(token, options = T.unsafe(nil)); end # Takes `raw_params` and turns it into an array of parameters. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#507 def params_array_from(raw_params); end # This method takes an authorization body and splits up the key-value pairs by # the standardized `:`, `;`, or `\t` delimiters defined in # `AUTHN_PAIR_DELIMITERS`. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#519 def raw_params(auth); end # This removes the `"` characters wrapping the value. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#512 def rewrite_param_values(array_params); end # Parses the token and options out of the token Authorization header. The value # for the Authorization header is expected to have the prefix `"Token"` or # `"Bearer"`. If the header looks like this: # # Authorization: Token token="abc", nonce="def" # # Then the returned token is `"abc"`, and the options are `{nonce: "def"}`. # # Returns an `Array` of `[String, Hash]` if a token is present. Returns `nil` if # no token is found. # # #### Parameters # # * `request` - ActionDispatch::Request instance with the current headers. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#494 def token_and_options(request); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#502 def token_params_from(auth); end end # source://actionpack//lib/action_controller/metal/http_authentication.rb#428 ActionController::HttpAuthentication::Token::AUTHN_PAIR_DELIMITERS = T.let(T.unsafe(nil), Regexp) # source://actionpack//lib/action_controller/metal/http_authentication.rb#431 module ActionController::HttpAuthentication::Token::ControllerMethods # Authenticate using an HTTP Bearer token, or otherwise render an HTTP header # requesting the client to send a Bearer token. For the authentication to be # considered successful, `login_procedure` must not return a false value. # Typically, the authenticated user is returned. # # See ActionController::HttpAuthentication::Token for example usage. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#438 def authenticate_or_request_with_http_token(realm = T.unsafe(nil), message = T.unsafe(nil), &login_procedure); end # Authenticate using an HTTP Bearer token. Returns the return value of # `login_procedure` if a token is found. Returns `nil` if no token is found. # # See ActionController::HttpAuthentication::Token for example usage. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#446 def authenticate_with_http_token(&login_procedure); end # Render an HTTP header requesting the client to send a Bearer token for # authentication. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#452 def request_http_token_authentication(realm = T.unsafe(nil), message = T.unsafe(nil)); end end # source://actionpack//lib/action_controller/metal/http_authentication.rb#426 ActionController::HttpAuthentication::Token::TOKEN_KEY = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_controller/metal/http_authentication.rb#427 ActionController::HttpAuthentication::Token::TOKEN_REGEX = T.let(T.unsafe(nil), Regexp) # # Action Controller Implicit Render # # Handles implicit rendering for a controller action that does not explicitly # respond with `render`, `respond_to`, `redirect`, or `head`. # # For API controllers, the implicit response is always `204 No Content`. # # For all other controllers, we use these heuristics to decide whether to render # a template, raise an error for a missing template, or respond with `204 No # Content`: # # First, if we DO find a template, it's rendered. Template lookup accounts for # the action name, locales, format, variant, template handlers, and more (see # `render` for details). # # Second, if we DON'T find a template but the controller action does have # templates for other formats, variants, etc., then we trust that you meant to # provide a template for this response, too, and we raise # ActionController::UnknownFormat with an explanation. # # Third, if we DON'T find a template AND the request is a page load in a web # browser (technically, a non-XHR GET request for an HTML response) where you # reasonably expect to have rendered a template, then we raise # ActionController::MissingExactTemplate with an explanation. # # Finally, if we DON'T find a template AND the request isn't a browser page # load, then we implicitly respond with `204 No Content`. # # source://actionpack//lib/action_controller/metal/implicit_render.rb#33 module ActionController::ImplicitRender include ::ActionController::BasicImplicitRender # source://actionpack//lib/action_controller/metal/implicit_render.rb#37 def default_render; end # source://actionpack//lib/action_controller/metal/implicit_render.rb#56 def method_for_action(action_name); end private # @return [Boolean] # # source://actionpack//lib/action_controller/metal/implicit_render.rb#63 def interactive_browser_request?; end end # # Action Controller Instrumentation # # Adds instrumentation to several ends in ActionController::Base. It also # provides some hooks related with process_action. This allows an ORM like # Active Record and/or DataMapper to plug in ActionController and show related # information. # # Check ActiveRecord::Railties::ControllerRuntime for an example. # # source://actionpack//lib/action_controller/metal/instrumentation.rb#16 module ActionController::Instrumentation extend ::ActiveSupport::Concern include ::ActiveSupport::Benchmarkable include ::AbstractController::Logger mixes_in_class_methods ::ActionController::Instrumentation::ClassMethods # source://actionpack//lib/action_controller/metal/instrumentation.rb#23 def initialize(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_controller/metal/instrumentation.rb#49 def redirect_to(*_arg0); end # source://actionpack//lib/action_controller/metal/instrumentation.rb#28 def render(*_arg0); end # source://actionpack//lib/action_controller/metal/instrumentation.rb#43 def send_data(data, options = T.unsafe(nil)); end # source://actionpack//lib/action_controller/metal/instrumentation.rb#36 def send_file(path, options = T.unsafe(nil)); end def view_runtime; end def view_runtime=(_arg0); end private # Every time after an action is processed, this method is invoked with the # payload, so you can add more information. # # source://actionpack//lib/action_controller/metal/instrumentation.rb#105 def append_info_to_payload(payload); end # A hook which allows you to clean up any time, wrongly taken into account in # views, like database querying time. # # def cleanup_view_runtime # super - time_taken_in_something_expensive # end # # source://actionpack//lib/action_controller/metal/instrumentation.rb#99 def cleanup_view_runtime; end # A hook invoked every time a before callback is halted. # # source://actionpack//lib/action_controller/metal/instrumentation.rb#89 def halted_callback_hook(filter, _); end # source://actionpack//lib/action_controller/metal/instrumentation.rb#59 def process_action(*_arg0); end end # source://actionpack//lib/action_controller/metal/instrumentation.rb#109 module ActionController::Instrumentation::ClassMethods # A hook which allows other frameworks to log what happened during controller # process action. This method should return an array with the messages to be # added. # # source://actionpack//lib/action_controller/metal/instrumentation.rb#113 def log_process_action(payload); end end # source://actionpack//lib/action_controller/metal/request_forgery_protection.rb#10 class ActionController::InvalidAuthenticityToken < ::ActionController::ActionControllerError; end # source://actionpack//lib/action_controller/metal/request_forgery_protection.rb#13 class ActionController::InvalidCrossOriginRequest < ::ActionController::ActionControllerError; end # Raised when initializing Parameters with keys that aren't strings or symbols. # # ActionController::Parameters.new(123 => 456) # # => ActionController::InvalidParameterKey: all keys must be Strings or Symbols, got: Integer # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#84 class ActionController::InvalidParameterKey < ::ArgumentError; end # # Action Controller Live # # Mix this module into your controller, and all actions in that controller will # be able to stream data to the client as it's written. # # class MyController < ActionController::Base # include ActionController::Live # # def stream # response.headers['Content-Type'] = 'text/event-stream' # 100.times { # response.stream.write "hello world\n" # sleep 1 # } # ensure # response.stream.close # end # end # # There are a few caveats with this module. You **cannot** write headers after # the response has been committed (Response#committed? will return truthy). # Calling `write` or `close` on the response stream will cause the response # object to be committed. Make sure all headers are set before calling write or # close on your stream. # # You **must** call close on your stream when you're finished, otherwise the # socket may be left open forever. # # The final caveat is that your actions are executed in a separate thread than # the main thread. Make sure your actions are thread safe, and this shouldn't be # a problem (don't share state across threads, etc). # # Note that Rails includes `Rack::ETag` by default, which will buffer your # response. As a result, streaming responses may not work properly with Rack # 2.2.x, and you may need to implement workarounds in your application. You can # either set the `ETag` or `Last-Modified` response headers or remove # `Rack::ETag` from the middleware stack to address this issue. # # Here's an example of how you can set the `Last-Modified` header if your Rack # version is 2.2.x: # # def stream # response.headers["Content-Type"] = "text/event-stream" # response.headers["Last-Modified"] = Time.now.httpdate # Add this line if your Rack version is 2.2.x # ... # end # # source://actionpack//lib/action_controller/metal/live.rb#56 module ActionController::Live extend ::ActiveSupport::Concern mixes_in_class_methods ::ActionController::Live::ClassMethods # source://actionpack//lib/action_controller/test_case.rb#28 def new_controller_thread; end # source://actionpack//lib/action_controller/metal/live.rb#276 def process(name); end # source://actionpack//lib/action_controller/metal/live.rb#326 def response_body=(body); end # Sends a stream to the browser, which is helpful when you're generating exports # or other running data where you don't want the entire file buffered in memory # first. Similar to send_data, but where the data is generated live. # # Options: # * `:filename` - suggests a filename for the browser to use. # * `:type` - specifies an HTTP content type. You can specify either a string # or a symbol for a registered type with `Mime::Type.register`, for example # :json. If omitted, type will be inferred from the file extension specified # in `:filename`. If no content type is registered for the extension, the # default type 'application/octet-stream' will be used. # * `:disposition` - specifies whether the file will be shown inline or # downloaded. Valid values are 'inline' and 'attachment' (default). # # # Example of generating a csv export: # # send_stream(filename: "subscribers.csv") do |stream| # stream.write "email_address,updated_at\n" # # @subscribers.find_each do |subscriber| # stream.write "#{subscriber.email_address},#{subscriber.updated_at}\n" # end # end # # source://actionpack//lib/action_controller/metal/live.rb#355 def send_stream(filename:, disposition: T.unsafe(nil), type: T.unsafe(nil)); end private # source://actionpack//lib/action_controller/metal/live.rb#389 def log_error(exception); end # Spawn a new thread to serve up the controller in. This is to get around the # fact that Rack isn't based around IOs and we need to use a thread to stream # data from the response bodies. Nobody should call this method except in Rails # internals. Seriously! # Disable controller / rendering threads in tests. User tests can access the # database on the main thread, so they could open a txn, then the controller # thread will open a new connection and try to access data that's only visible # to the main thread's txn. This is the problem in #23483. # # source://actionpack//lib/action_controller/metal/live.rb#377 def original_new_controller_thread; end class << self # source://actionpack//lib/action_controller/metal/live.rb#385 def live_thread_pool_executor; end end end # source://actionpack//lib/action_controller/metal/live.rb#151 class ActionController::Live::Buffer < ::ActionDispatch::Response::Buffer include ::MonitorMixin # @return [Buffer] a new instance of Buffer # # source://actionpack//lib/action_controller/metal/live.rb#166 def initialize(response); end # Inform the producer/writing thread that the client has disconnected; the # reading thread is no longer interested in anything that's being written. # # See also #close. # # source://actionpack//lib/action_controller/metal/live.rb#220 def abort; end # source://actionpack//lib/action_controller/metal/live.rb#239 def call_on_error; end # Write a 'close' event to the buffer; the producer/writing thread uses this to # notify us that it's finished supplying content. # # See also #abort. # # source://actionpack//lib/action_controller/metal/live.rb#208 def close; end # Is the client still connected and waiting for content? # # The result of calling `write` when this is `false` is determined by # `ignore_disconnect`. # # @return [Boolean] # # source://actionpack//lib/action_controller/metal/live.rb#231 def connected?; end # Ignore that the client has disconnected. # # If this value is `true`, calling `write` after the client disconnects will # result in the written content being silently discarded. If this value is # `false` (the default), a ClientDisconnected exception will be raised. # # source://actionpack//lib/action_controller/metal/live.rb#164 def ignore_disconnect; end # Ignore that the client has disconnected. # # If this value is `true`, calling `write` after the client disconnects will # result in the written content being silently discarded. If this value is # `false` (the default), a ClientDisconnected exception will be raised. # # source://actionpack//lib/action_controller/metal/live.rb#164 def ignore_disconnect=(_arg0); end # source://actionpack//lib/action_controller/metal/live.rb#235 def on_error(&block); end # source://actionpack//lib/action_controller/metal/live.rb#180 def write(string); end # Same as `write` but automatically include a newline at the end of the string. # # source://actionpack//lib/action_controller/metal/live.rb#200 def writeln(string); end private # source://actionpack//lib/action_controller/metal/live.rb#255 def build_queue(queue_size); end # source://actionpack//lib/action_controller/metal/live.rb#244 def each_chunk(&block); end class << self # Returns the value of attribute queue_size. # # source://actionpack//lib/action_controller/metal/live.rb#155 def queue_size; end # Sets the attribute queue_size # # @param value the value to set the attribute queue_size to. # # source://actionpack//lib/action_controller/metal/live.rb#155 def queue_size=(_arg0); end end end # source://actionpack//lib/action_controller/metal/live.rb#59 module ActionController::Live::ClassMethods # source://actionpack//lib/action_controller/metal/live.rb#60 def make_response!(request); end end # source://actionpack//lib/action_controller/metal/live.rb#148 class ActionController::Live::ClientDisconnected < ::RuntimeError; end # source://actionpack//lib/action_controller/metal/live.rb#260 class ActionController::Live::Response < ::ActionDispatch::Response private # source://actionpack//lib/action_controller/metal/live.rb#262 def before_committed; end # source://actionpack//lib/action_controller/metal/live.rb#269 def build_buffer(response, body); end end # # Action Controller Live Server Sent Events # # This class provides the ability to write an SSE (Server Sent Event) to an IO # stream. The class is initialized with a stream and can be used to either write # a JSON string or an object which can be converted to JSON. # # Writing an object will convert it into standard SSE format with whatever # options you have configured. You may choose to set the following options: # # `:event` # : If specified, an event with this name will be dispatched on the browser. # # `:retry` # : The reconnection time in milliseconds used when attempting to send the event. # # `:id` # : If the connection dies while sending an SSE to the browser, then the # server will receive a `Last-Event-ID` header with value equal to `id`. # # After setting an option in the constructor of the SSE object, all future SSEs # sent across the stream will use those options unless overridden. # # Example Usage: # # class MyController < ActionController::Base # include ActionController::Live # # def index # response.headers['Content-Type'] = 'text/event-stream' # sse = SSE.new(response.stream, retry: 300, event: "event-name") # sse.write({ name: 'John'}) # sse.write({ name: 'John'}, id: 10) # sse.write({ name: 'John'}, id: 10, event: "other-event") # sse.write({ name: 'John'}, id: 10, event: "other-event", retry: 500) # ensure # sse.close # end # end # # Note: SSEs are not currently supported by IE. However, they are supported by # Chrome, Firefox, Opera, and Safari. # # source://actionpack//lib/action_controller/metal/live.rb#112 class ActionController::Live::SSE # @return [SSE] a new instance of SSE # # source://actionpack//lib/action_controller/metal/live.rb#115 def initialize(stream, options = T.unsafe(nil)); end # source://actionpack//lib/action_controller/metal/live.rb#120 def close; end # source://actionpack//lib/action_controller/metal/live.rb#124 def write(object, options = T.unsafe(nil)); end private # source://actionpack//lib/action_controller/metal/live.rb#134 def perform_write(json, options); end end # source://actionpack//lib/action_controller/metal/live.rb#113 ActionController::Live::SSE::PERMITTED_OPTIONS = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_controller/test_case.rb#176 class ActionController::LiveTestResponse < ::ActionController::Live::Response # Was there a server-side error? # # source://rack/3.1.8/lib/rack/response.rb#187 def error?; end # Was the URL not found? # # source://rack/3.1.8/lib/rack/response.rb#197 def missing?; end # Was the response successful? # # source://rack/3.1.8/lib/rack/response.rb#184 def success?; end end # source://actionpack//lib/action_controller/log_subscriber.rb#6 class ActionController::LogSubscriber < ::ActiveSupport::LogSubscriber # source://actionpack//lib/action_controller/log_subscriber.rb#80 def exist_fragment?(event); end # source://actionpack//lib/action_controller/log_subscriber.rb#80 def expire_fragment(event); end # source://actionpack//lib/action_controller/log_subscriber.rb#47 def halted_callback(event); end # source://actionpack//lib/action_controller/log_subscriber.rb#90 def logger; end # source://actionpack//lib/action_controller/log_subscriber.rb#26 def process_action(event); end # source://actionpack//lib/action_controller/log_subscriber.rb#80 def read_fragment(event); end # source://actionpack//lib/action_controller/log_subscriber.rb#57 def redirect_to(event); end # source://actionpack//lib/action_controller/log_subscriber.rb#62 def send_data(event); end # source://actionpack//lib/action_controller/log_subscriber.rb#52 def send_file(event); end # source://actionpack//lib/action_controller/log_subscriber.rb#9 def start_processing(event); end # source://actionpack//lib/action_controller/log_subscriber.rb#67 def unpermitted_parameters(event); end # source://actionpack//lib/action_controller/log_subscriber.rb#80 def write_fragment(event); end class << self # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#12 def log_levels; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#15 def log_levels=(new_value); end end end # source://actionpack//lib/action_controller/log_subscriber.rb#7 ActionController::LogSubscriber::INTERNAL_PARAMS = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_controller/metal/logging.rb#6 module ActionController::Logging extend ::ActiveSupport::Concern mixes_in_class_methods ::ActionController::Logging::ClassMethods end # source://actionpack//lib/action_controller/metal/logging.rb#9 module ActionController::Logging::ClassMethods # Set a different log level per request. # # # Use the debug log level if a particular cookie is set. # class ApplicationController < ActionController::Base # log_at :debug, if: -> { cookies[:debug] } # end # # source://actionpack//lib/action_controller/metal/logging.rb#17 def log_at(level, **options); end end # # Action Controller Metal # # `ActionController::Metal` is the simplest possible controller, providing a # valid Rack interface without the additional niceties provided by # ActionController::Base. # # A sample metal controller might look like this: # # class HelloController < ActionController::Metal # def index # self.response_body = "Hello World!" # end # end # # And then to route requests to your metal controller, you would add something # like this to `config/routes.rb`: # # get 'hello', to: HelloController.action(:index) # # The ::action method returns a valid Rack application for the Rails router to # dispatch to. # # ## Rendering Helpers # # By default, `ActionController::Metal` provides no utilities for rendering # views, partials, or other responses aside from some low-level setters such # as #response_body=, #content_type=, and #status=. To add the render helpers # you're used to having in a normal controller, you can do the following: # # class HelloController < ActionController::Metal # include AbstractController::Rendering # include ActionView::Layouts # append_view_path "#{Rails.root}/app/views" # # def index # render "hello/index" # end # end # # ## Redirection Helpers # # To add redirection helpers to your metal controller, do the following: # # class HelloController < ActionController::Metal # include ActionController::Redirecting # include Rails.application.routes.url_helpers # # def index # redirect_to root_url # end # end # # ## Other Helpers # # You can refer to the modules included in ActionController::Base to see other # features you can bring into your metal controller. # # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. # # source://actionpack//lib/action_controller/metal.rb#121 class ActionController::Metal < ::AbstractController::Base include ::ActionController::Testing::Functional # @return [Metal] a new instance of Metal # # source://actionpack//lib/action_controller/metal.rb#210 def initialize; end # Delegates to ActionDispatch::Response#content_type # # source://actionpack//lib/action_controller/metal.rb#204 def content_type(*_arg0, **_arg1, &_arg2); end # Delegates to ActionDispatch::Response#content_type= # # source://actionpack//lib/action_controller/metal.rb#192 def content_type=(arg); end # Delegates to the class's ::controller_name. # # source://actionpack//lib/action_controller/metal.rb#156 def controller_name; end # source://actionpack//lib/action_controller/metal.rb#249 def dispatch(name, request, response); end # Delegates to ActionDispatch::Response#headers. # # source://actionpack//lib/action_controller/metal.rb#180 def headers(*_arg0, **_arg1, &_arg2); end # Delegates to ActionDispatch::Response#location # # source://actionpack//lib/action_controller/metal.rb#200 def location(*_arg0, **_arg1, &_arg2); end # Delegates to ActionDispatch::Response#location= # # source://actionpack//lib/action_controller/metal.rb#188 def location=(arg); end # Delegates to ActionDispatch::Response#media_type # # source://actionpack//lib/action_controller/metal.rb#208 def media_type(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_controller/metal.rb#288 def middleware_stack; end # source://actionpack//lib/action_controller/metal.rb#288 def middleware_stack=(_arg0); end # source://actionpack//lib/action_controller/metal.rb#288 def middleware_stack?; end # source://actionpack//lib/action_controller/metal.rb#219 def params; end # source://actionpack//lib/action_controller/metal.rb#223 def params=(val); end # Tests if render or redirect has already happened. # # @return [Boolean] # # source://actionpack//lib/action_controller/metal.rb#245 def performed?; end # :attr_reader: request # # The ActionDispatch::Request instance for the current request. # # source://activesupport/8.0.0/lib/active_support/core_ext/module/attr_internal.rb#43 def request; end # source://activesupport/8.0.0/lib/active_support/core_ext/module/attr_internal.rb#43 def request=(_arg0); end # source://actionpack//lib/action_controller/metal.rb#284 def reset_session; end # :attr_reader: response # # The ActionDispatch::Response instance for the current response. # # source://activesupport/8.0.0/lib/active_support/core_ext/module/attr_internal.rb#43 def response; end # Assign the response and mark it as committed. No further processing will # occur. # # source://actionpack//lib/action_controller/metal.rb#268 def response=(response); end # source://actionpack//lib/action_controller/metal.rb#234 def response_body=(body); end # Delegates to ActionDispatch::Response#status # # source://actionpack//lib/action_controller/metal.rb#196 def response_code(*_arg0, **_arg1, &_arg2); end # The ActionDispatch::Request::Session instance for the current request. # See further details in the # [Active Controller Session guide](https://guides.rubyonrails.org/action_controller_overview.html#session). # # source://actionpack//lib/action_controller/metal.rb#176 def session(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_controller/metal.rb#275 def set_request!(request); end # source://actionpack//lib/action_controller/metal.rb#257 def set_response!(response); end # Delegates to ActionDispatch::Response#status # # source://actionpack//lib/action_controller/metal.rb#196 def status(*_arg0, **_arg1, &_arg2); end # Delegates to ActionDispatch::Response#status= # # source://actionpack//lib/action_controller/metal.rb#184 def status=(arg); end # source://actionpack//lib/action_controller/metal.rb#280 def to_a; end # Basic `url_for` that can be overridden for more robust functionality. # # source://actionpack//lib/action_controller/metal.rb#230 def url_for(string); end class << self # Returns a Rack endpoint for the given action name. # # source://actionpack//lib/action_controller/metal.rb#315 def action(name); end # source://actionpack//lib/action_controller/metal.rb#140 def action_encoding_template(action); end # Returns the last part of the controller's name, underscored, without the # ending `Controller`. For instance, `PostsController` returns `posts`. # Namespaces are left out, so `Admin::PostsController` returns `posts` as well. # # #### Returns # * `string` # # source://actionpack//lib/action_controller/metal.rb#130 def controller_name; end # Direct dispatch to the controller. Instantiates the controller, then executes # the action named `name`. # # source://actionpack//lib/action_controller/metal.rb#331 def dispatch(name, req, res); end # source://actionpack//lib/action_controller/metal.rb#134 def make_response!(request); end # The middleware stack used by this controller. # # By default uses a variation of ActionDispatch::MiddlewareStack which allows # for the following syntax: # # class PostsController < ApplicationController # use AuthenticationMiddleware, except: [:index, :show] # end # # Read more about [Rails middleware stack] # (https://guides.rubyonrails.org/rails_on_rack.html#action-dispatcher-middleware-stack) # in the guides. # # source://actionpack//lib/action_controller/metal.rb#310 def middleware; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#12 def middleware_stack; end # source://activesupport/8.0.0/lib/active_support/class_attribute.rb#15 def middleware_stack=(new_value); end # source://actionpack//lib/action_controller/metal.rb#288 def middleware_stack?; end # Pushes the given Rack middleware and its arguments to the bottom of the # middleware stack. # # source://actionpack//lib/action_controller/metal.rb#293 def use(*_arg0, **_arg1, &_arg2); end private # @private # # source://actionpack//lib/action_controller/metal.rb#146 def inherited(subclass); end end end # source://actionpack//lib/action_controller/metal/exceptions.rb#52 class ActionController::MethodNotAllowed < ::ActionController::ActionControllerError # @return [MethodNotAllowed] a new instance of MethodNotAllowed # # source://actionpack//lib/action_controller/metal/exceptions.rb#53 def initialize(*allowed_methods); end end # # Action Controller MiddlewareStack # # Extend ActionDispatch middleware stack to make it aware of options allowing # the following syntax in controllers: # # class PostsController < ApplicationController # use AuthenticationMiddleware, except: [:index, :show] # end # # source://actionpack//lib/action_controller/metal.rb#18 class ActionController::MiddlewareStack < ::ActionDispatch::MiddlewareStack # source://actionpack//lib/action_controller/metal.rb#31 def build(action, app = T.unsafe(nil), &block); end private # source://actionpack//lib/action_controller/metal.rb#44 def build_middleware(klass, args, block); end end # source://actionpack//lib/action_controller/metal.rb#41 ActionController::MiddlewareStack::EXCLUDE = T.let(T.unsafe(nil), Proc) # source://actionpack//lib/action_controller/metal.rb#40 ActionController::MiddlewareStack::INCLUDE = T.let(T.unsafe(nil), Proc) # source://actionpack//lib/action_controller/metal.rb#19 class ActionController::MiddlewareStack::Middleware < ::ActionDispatch::MiddlewareStack::Middleware # @return [Middleware] a new instance of Middleware # # source://actionpack//lib/action_controller/metal.rb#20 def initialize(klass, args, actions, strategy, block); end # @return [Boolean] # # source://actionpack//lib/action_controller/metal.rb#26 def valid?(action); end end # source://actionpack//lib/action_controller/metal.rb#42 ActionController::MiddlewareStack::NULL = T.let(T.unsafe(nil), Proc) # source://actionpack//lib/action_controller/metal/mime_responds.rb#8 module ActionController::MimeResponds # Without web-service support, an action which collects the data for displaying # a list of people might look something like this: # # def index # @people = Person.all # end # # That action implicitly responds to all formats, but formats can also be # explicitly enumerated: # # def index # @people = Person.all # respond_to :html, :js # end # # Here's the same action, with web-service support baked in: # # def index # @people = Person.all # # respond_to do |format| # format.html # format.js # format.xml { render xml: @people } # end # end # # What that says is, "if the client wants HTML or JS in response to this action, # just respond as we would have before, but if the client wants XML, return them # the list of people in XML format." (Rails determines the desired response # format from the HTTP Accept header submitted by the client.) # # Supposing you have an action that adds a new person, optionally creating their # company (by name) if it does not already exist, without web-services, it might # look like this: # # def create # @company = Company.find_or_create_by(name: params[:company][:name]) # @person = @company.people.create(params[:person]) # # redirect_to(person_list_url) # end # # Here's the same action, with web-service support baked in: # # def create # company = params[:person].delete(:company) # @company = Company.find_or_create_by(name: company[:name]) # @person = @company.people.create(params[:person]) # # respond_to do |format| # format.html { redirect_to(person_list_url) } # format.js # format.xml { render xml: @person.to_xml(include: @company) } # end # end # # If the client wants HTML, we just redirect them back to the person list. If # they want JavaScript, then it is an Ajax request and we render the JavaScript # template associated with this action. Lastly, if the client wants XML, we # render the created person as XML, but with a twist: we also include the # person's company in the rendered XML, so you get something like this: # #