Tag: devise activeadmin

设计+主动管理重定向

我无法为我的应用程序设置重定向。 用户应该转到他们的个人资料(用户/节目),管理员应该去管理仪表板..我该如何设置? 目前收到以下错误: NameError in ActiveAdmin::Devise::SessionsController#create undefined local variable or method `admin’ for # 应用控制器 def after_sign_in_path_for(resource_or_scope) if admin redirect_to admin_dashboard_path else @user end end end

我使用Active Admin和Devise获得ActiveModel :: ForbiddenAttributesError

我正在开发一个我正在使用Active Admin和Devise的应用程序。 我已经修改了User和Admin Users表(通过迁移),以允许两个模型使用Device而不是Active Admin进行一次登录。 由于“超级用户”管理员可以登录并访问管理员活动。 应用程序用户无法访问Admin Active。 当我尝试创建新用户或管理员时,我遇到的问题就出现了。 我收到以下错误: ActiveModel::ForbiddenAttributesError in Admin::UsersController#create 看起来很简单,但我看不到它。 这是代码: Schema.rb ActiveRecord::Schema.define(version: 20140721134754) do create_table “active_admin_comments”, force: true do |t| t.string “namespace” t.text “body” t.string “resource_id”, null: false t.string “resource_type”, null: false t.integer “author_id” t.string “author_type” t.datetime “created_at” t.datetime “updated_at” end add_index “active_admin_comments”, [“author_type”, “author_id”], name: “index_active_admin_comments_on_author_type_and_author_id” add_index “active_admin_comments”, [“namespace”], […]