 class SitemapController < ApplicationController

   def index
     @static_pages = [root_url, about_url, contact_url, faq_url, login_url, signup_url]
     @frequently_updated_pages = [forum_url]
     @courses = Course.all
     respond_to do |format|
       format.xml
     end
   end
 end
 class SitemapController < ApplicationController

   def index
     @static_pages = static_pages
     @courses = Course.all
     respond_to do |format|
       format.xml
     end
   end

   private

   def static_pages
     [root_url, about_url, contact_url, faq_url, login_url, signup_url].freeze
   end
 end

Move the static pages array to the private method, remove the @frequently_updated_pages
Move the static pages array to the private method, remove the @frequently_updated_pages
