0
votes

Trying to set up a static page, but am getting the following error:

Missing template pages/show_admin_panel, application/show_admin_panel with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :raw, :ruby, :jbuilder, :coffee]}. Searched in: * "c:/Users/Bill/Desktop/testapp/app/views" * "c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/devise-3.4.1/app/views"

My route:

get '/adminpanel' => 'pages#show_admin_panel'

Action in the pages controller:

def show_admin_panel

  @users = User.all
  respond_with(@users)

end

The view: pages/adminpanel.html.erb:

<div class="row">
  <div class="well">

    <h1 class="color">Admin Panel</h1>

  </div>
</div>
1
The error message tells you exactly what you need to know. What file name does the message say it is using to try and locate the template? And what is the actual name of your template? - Paul Richter

1 Answers

2
votes

Notice how your controller action and your error says pages/show_admin_panel (with underscores) but your view is called pages/adminpanel.html.erb (no underscores and no "show" part in the beginning).