我收到以下错误消息:
Template is missing
Missing template dishes/show, application/show with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee]}. Searched in: * "C:/Sites/restaurant/app/views"
在我的dishes_controller
:
def show
@dish = Dish.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @dish }
end
end
模板没有丢失。它位于app/views/dishes/show.html.erb
输出C:\Sites\restaurant>rake routes
:
root / static_pages#home
dishes GET /dishes(.:format) dishes#index
POST /dishes(.:format) dishes#create
new_dish GET /dishes/new(.:format) dishes#new
edit_dish GET /dishes/:id/edit(.:format) dishes#edit
dish GET /dishes/:id(.:format) dishes#show
PUT /dishes/:id(.:format) dishes#update
DELETE /dishes/:id(.:format) dishes#destroy
help /help(.:format) static_pages#help
about /about(.:format) static_pages#about
contact /contact(.:format) static_pages#contact
menu /menu(.:format) static_pages#menu