Hint: You should not place public methods into your application_controller
. Have an extra controller for that and check your routes.rb
and view files names:
# in app/controllers/home_controller.rb
class HomeController < ApplicationController
def index
@app_name = Cache.app_name
end
end
# in app/views/home/index.html.erb
<h1>Home of <%= @app_name %></h1>
# in config/routes.rb
root to: 'home#index'