試圖建立一個靜態頁面,但我得到以下錯誤:Rails的模板丟失的錯誤
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"
我的路線:
get '/adminpanel' => 'pages#show_admin_panel'
行動在頁面控制器:
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>
錯誤消息告訴你到底需要知道什麼。消息說它正在使用什麼文件名來嘗試查找模板?什麼是你的模板的實際名稱? – 2014-11-24 17:10:09