Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8373677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:44:21+00:00 2026-06-09T14:44:21+00:00

I have methods that set a title for the browser and for the page

  • 0

I have methods that set a title for the browser and for the page itself. On my Devise pages I would like to set these two methods but am not sure how to.

My Code:

helpers/application_helper

def title # for entire application
    base_title = "Testing"
  if @title.nil?
    base_title
  else
    "#{base_title} - #{@title}"
  end
end

def page_title # for page header partial
   "#{@page_title}"
end

views/layouts/application

<!DOCTYPE html>
<html>
   <head>
      <title><%= title %></title>
      <%= csrf_meta_tag %>
      <%= favicon_link_tag %>
      <%= stylesheet_link_tag "application" %>
      <%= javascript_include_tag "application" %>
   </head>
   <body>
      <div id="container">
         <%= render "shared/page_header" %>
         <%= render "shared/flash_message" %>
         <%= yield %>
      </div>
   </body>
</html>

views/shared/_page_header

<% unless @page_title.blank? %>
  <div id="page-header">
    <span><%= @page_title %></span>
  </div>
<% end %>

Now I have a RegistrationsController to override the functionality whenever I need to but as it inherits to the DeviseController, I don’t think it can get to the Application Helper? I also tried to put this same code in the Registration Helper but that didn’t work either. What should I do?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T14:44:22+00:00Added an answer on June 9, 2026 at 2:44 pm

    Maybe you can use;

    application_helper.rb

    module ApplicationHelper
      def title(page_title)
        content_for(:title) { page_title }
      end
    end
    

    application.html.erb

    <title><%= yield :title %></title>
    

    view

    <%= title "Your page title here" %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a set of methods that do some utility work over SQL connection,
I have several methods that have a return type IEnumerable<T> . These methods are
I have a webpage that looks like: <html> <head> <title>Hi</title> </head> <body> <form name=mainForm
I have a method set up that uses jquery form for a file upload
I have a data type that contains a set and a method that expects
In C# I have methods that use [WebMethod(EnableSession = true)] I consume them in
I have async methods that returns an objects public static IEnumerable<Users.User> GetUsers(IEnumerable<string> uids, Field
I have several methods that populate a SQLCommand objects parameter collection from an object
I have some methods that are used by several classes. My idea was to
I have the following methods that are encountering some sort of failure with my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.