【发布时间】:2016-06-04 17:20:56
【问题描述】:
Rails 试图找到包含 jbuilder 文件的用户文件夹,这些文件存在但不能
Missing template users/index, application/index with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :slim, :coffee, :jbuilder]}. Searched in:
* "/home/bjorn/Documents/poller/app/views"
* "/usr/lib/ruby/gems/2.3.0/gems/devise_token_auth-0.1.37/app/views"
* "/usr/lib/ruby/gems/2.3.0/gems/devise-4.0.3/app/views"
# controllers/users_controller.rb
class UsersController < ApplicationController
def index
@users = User.all
end
def show
@user = User.find(params[:id])
end
end
# routes.rb
resources :users, only: [ :index, :show ]
【问题讨论】:
标签: ruby-on-rails json jbuilder