Ruby on rails Rails 4活动管理问题
我有两个大问题与积极的管理 当我去编辑一个用户时,加密密码并没有显示出来,所以本质上我必须入侵我自己的网站,复制并粘贴另一个加密密码到该字段以更新用户-这与创建用户是一样的 第二个问题是我无法创建新用户。当我去创建一个用户时,什么都没有发生。我没有错。页面只是刷新,用户不保存 User.rbRuby on rails Rails 4活动管理问题,ruby-on-rails,activeadmin,Ruby On Rails,Activeadmin,我有两个大问题与积极的管理 当我去编辑一个用户时,加密密码并没有显示出来,所以本质上我必须入侵我自己的网站,复制并粘贴另一个加密密码到该字段以更新用户-这与创建用户是一样的 第二个问题是我无法创建新用户。当我去创建一个用户时,什么都没有发生。我没有错。页面只是刷新,用户不保存 User.rb ActiveAdmin.register User do controller do def permitted_params params.permit! end e
ActiveAdmin.register User do
controller do
def permitted_params
params.permit!
end
end
end
我试图销毁我安装的active admin,然后重新安装并再次生成模型,但结果相同。我正在使用Rails 4.2.1和Ruby 2.0.0
gem 'activeadmin', github: 'activeadmin'
In development.rb
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Do not eager load code on boot.
config.eager_load = false
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
# Raise an error on page load if there are pending migrations.
config.active_record.migration_error = :page_load
# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = true
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
# yet still be able to expire them through the digest params.
config.assets.digest = true
# Adds additional error checking when serving assets at runtime.
# Checks for improperly declared sprockets dependencies.
# Raises helpful error messages.
config.assets.raise_runtime_errors = true
# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
end
我尝试将config.cache_classes=false更改为true,但这也不起作用
我不知道该怎么办。有什么建议吗?我想这是一只虫子。希望能修好。谢谢。看来您的
app/admin/user.rb文件中的参数方法是非常规的,可能会给您带来问题。您需要像这样添加它们,如果您想更改/编辑密码,还需要输入:encrypted_password
ActiveAdmin.register User do
permit_params :email, :password, :password_confirmation, :encrypted_password
...
end
这是行不通的。我认为这不是正确的语法。WRT加密密码这不是编辑它的问题-这是它没有显示在字段中编辑用户时,这意味着我必须复制和粘贴另一个用户的密码,以能够更新用户。Thank.ActiveAdmin.register用户是否允许参数:email、:全名、:加密密码、:admin end我是否需要在此处定义“创建”或“新建”或其他内容?