2
我知道这已被问及之前,我发现了很多类似于我的问题,但答案似乎是相同的'一个错字',但我看着我代码时间和时间再次,并不能指出错误/错字,我开始认为它不仅仅是一个错字:这是我的代码与文件名的确切拼写:Rails3:路由错误未初始化的常量SiteConfiguration
我创建了以下表迁移:
015_create_site_configurations.rb
class CreateSiteConfigurations < ActiveRecord::Migration
def self.up
create_table "site_configurations" do |t|
t.column :config_type, :string
t.column :value, :string
end
end
def self.down
drop_table "site_configurations"
end
end
01这里
控制器该类
manage_site_configurations_controller.rb
class ManageSiteConfigurationsController < AdminController
active_scaffold :site_configurations do |config|
config.columns = [:config_type, :value]
config.create.columns = [:config_type, :value]
end
end
因为即时通讯使用这种用于ActiveScaffold是从application.rb中
def self.active_scaffold_controller_for(klass)
return ManageUsersController if klass == User
return ManagePagesController if klass == Page
return ManageSiteConfigurationsController if klass == SiteConfiguration
return "#{klass}ScaffoldController".constantize rescue super
end
一个片段,这就是我用于我的路线
resources :manage_site_configurations do as_routes end
我真的很感激,如果有人可以指出错误了..