actionview/lib/action_view/helpers/url_helper.rb
# This helper may be included in any class that includes the
# URL helpers of a routes (routes.url_helpers). Some methods
# provided here will only work in the context of a request
# (link_to_unless_current, for instance), which must be provided
# as a method called #request on the context.
This helper may be included in any class that includes the
URL helpers of a routes (routes.url_helpers). Some methods
provided here will only work in the context of a request
(link_to_unless_current, for instance), which must be provided
as a method called #request on the context.
This helper may be included in any class that includes the URL helpers of a routes ( routes . url_helpers ) . Some methods provided here will only work in the context of a request ( link_to_unless_current for instance ) which must be provided as a method called #request on the context .
def method_for_options(options)
          if options.is_a?(Array)
            method_for_options(options.last)
          elsif options.respond_to?(:persisted?)
            options.persisted? ? :patch : :post
          elsif options.respond_to?(:to_model)
            method_for_options(options.to_model)
          end
        end
def method_for_options ( options ) if options . is_a? ( Array ) method_for_options ( options . last ) elsif options . respond_to? ( :persisted? ) options . persisted? ? :patch : :post elsif options . respond_to? ( :to_model ) method_for_options ( options . to_model ) end end
This helper may be included in any class that includes the
URL helpers of a routes (routes.url_helpers).
This helper may be included in any class that includes the URL helpers of a routes ( routes . url_helpers ) .
options
<not_specific>