我得到uninitialized constant Project::Controller
。我在SO上查看了Rails文档和帖子,但代码似乎设置正确。我正在使用rails 5.1.1
。我的页面路径工作正常,只有根路径给出错误。
路线.rb
Rails.application.routes.draw do
devise_for :admin_users, ActiveAdmin::Devise.config
ActiveAdmin.routes(self)
devise_for :users,
path: '',
path_names: {
sign_in: 'login',
sign_out: 'logout',
edit: 'profile'
},
controllers: { omniauth_callbacks: 'omniauth_callbacks' }
get 'pages/about'
root 'project/#index'
resources :project do
resources :task, only: [:show]
end
end
project_controller.rb
class ProjectController < ApplicationController
def index
@projects = Project.all
end
def show
@project = Project.find(params[:id])
@tasks = @project.tasks
end
end
答案 0 :(得分:1)
更改
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Campaign>()
.Property<string>("ExtendedDataStr")
.HasField("_extendedData");
}
到
root 'project/#index'