Skip to content
Janko Marohnić edited this page Aug 28, 2023 · 1 revision

The title_instance_variable configuration method can be set to access the built-in page titles from your views:

# app/misc/rodauth_main.rb
class RodauthMain < Rodauth::Rails::Auth
  configure do
    title_instance_variable :@page_title
  end
end
<!-- app/views/layouts/application.html.erb -->
<!DOCTYPE html>
<html>
  <head>
    <title><%= @page_title || "Default title" %></title>
    <!-- ... -->
  </head>
  <!-- ... -->
</html>
Clone this wiki locally