BrowserAction
Inherits Lucky::SecureHeaders::SetXSSGuard < Lucky::SecureHeaders::SetSniffGuard < Lucky::SecureHeaders::SetFrameGuard < Shield::PasswordResetPipes < Shield::EmailConfirmationPipes < Shield::LoginPipes < Shield::PasswordResetHelpers < Shield::EmailConfirmationHelpers < Shield::LoginHelpers < Shield::ActionPipes < Shield::ActionHelpers < Lucille::ActionHelpers < Lucky::Paginator::BackendHelpers < Lucky::ProtectFromForgery < Habitat::SettingsHelpers < Habitat::TempConfig < Shield::BrowserAction < Lucky::Action < Lucky::VerifyAcceptsFormat < Lucky::Redirectable < Habitat::SettingsHelpers < Habitat::TempConfig < Lucky::RequestBodyLimit < Lucky::ActionPipes < Lucky::ParamHelpers < Lucky::Renderable < Lucky::Routable < Lucky::Exposable < Lucky::RequestTypeHelpers < Lucky::ActionDelegates < Reference < Object
Constants
Class methods
Instance methods
The number of records to display per page. Defaults to 25
You can override this in your actions
Example
abstract class BrowserAction < Lucky::Action
include Lucky::Paginator::BackendHelpers
# Set to a new static value
def paginator_per_page : Int32
50 # defaults to 25
end
# Or you could allow setting the number from a param
def paginator_per_page : Int32
params.get?(:per_page).try(&.to_i) || 25
end
end
Redirects the browser to the page that issued the request (the referrer) if possible, otherwise redirects to the provided default fallback location.
The referrer information is pulled from the 'Referer' header on the request. This is an optional header, and if the request is missing this header the fallback will be used.
redirect_back fallback: "/users"
A redirect status can be specified
redirect_back fallback: "/home", status: 301
External referrers are ignored by default. It is determined by comparing the referer header to the request host. They can be explicitly allowed if necessary
redirect_back fallback: "/home", allow_external: true
If the referer path matches the current request path, the fallback will be used to avoid redirecting back to the same page.