Class: Public::AuthorsController

Inherits:
Postnhost::PublicController
  • Object
show all
Includes:
Postnhost::CanonicalFirstPageRedirect, Postnhost::LanguageSwitcher, Postnhost::PublicFooterData, Postnhost::PublicHttpCaching, Postnhost::PublicPageSize, Postnhost::PublicTemplateResolvable
Defined in:
app/controllers/postnhost/public/authors_controller.rb

Constant Summary

Constants included from Postnhost::PublicPageSize

Postnhost::PublicPageSize::PAGINATION_SLOTS

Instance Method Summary collapse

Methods included from Postnhost::PublicTemplateResolvable

#default_url_options

Instance Method Details

#showObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'app/controllers/postnhost/public/authors_controller.rb', line 16

def show
  apply_public_http_cache(@author, params[:page].to_i, template: resolve_public_template("authors/show"))
  return if performed?

  set_footer_data
  @pagy, snapshots = pagy(:offset, author_articles, limit: public_page_size, slots: pagination_slots)

  if localized_request?
    @article_variant_snapshots = snapshots
  else
    @article_snapshots = snapshots
  end

  render_public_template("authors/show")
end