Class: Weft::Defaults::NotFoundPage

Inherits:
Page
  • Object
show all
Defined in:
lib/weft/defaults/not_found_page.rb

Overview

Gem-default full-document page rendered for traditional (non-htmx) responses when a NotFound error falls through to the Page recovers chain. Thin wrapper around NotFoundComponent.

Constant Summary

Constants inherited from Page

Page::HTMX_ATTRS, Page::HTMX_SRC, Page::HTMX_SSE_ATTRS, Page::HTMX_SSE_SRC

Instance Attribute Summary

Attributes included from Weft::DSL::Attributes

#attrs

Instance Method Summary collapse

Methods inherited from Page

#add_child, inferred_routable?, inherited, inline_css, path_param_keys, redirect_url, register_css, register_script, register_stylesheet, render, resolve_page_path, scripts, stylesheets, #tag_name, #to_s, #weft_page

Methods included from Registry::Eligibility

#abstract!, #routable!, #routable?, #stale?

Methods included from Weft::DSL::Containers

behavior_for, included

Methods included from Weft::DSL::Recoveries

included

Methods included from Weft::DSL::Attributes

included

Methods included from Context::Interception

#insert_tag

Instance Method Details

#build(attributes = {}) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/weft/defaults/not_found_page.rb', line 14

def build(attributes = {})
  attributes[:title] ||= "Not found"
  super
  insert_tag(
    Weft::Defaults::NotFoundComponent,
    request_path: @attrs.request_path,
    status_code: @attrs.status_code
  )
end