Paperclip :: RegistrationsController#update中的错误 处理缩略图时出错。有人可以帮我这个!!! 我的注册控制器文件是,
class RegistrationsController < Devise::RegistrationsController
protected
def update_resource(resource, params)
resource.update_without_password(params)
end
端
我的应用程序控制器文件是
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
before_action :configure_permitted_paramters, if: :devise_controller?
protected
def configure_permitted_paramters
devise_parameter_sanitizer.for(:sign_up) << :fullname
devise_parameter_sanitizer.for(:account_update) << :fullname << :current_password << :avatar
end
end
有人可以帮助我摆脱错误
我的用户模型是,
has_attached_file :avatar, :styles => { :medium => "300x300>", :thumb => "100x100#" }, :default_url => "/images/:style/missing.png"
validates_attachment_content_type :avatar, :content_type => /\Aimage\/.*\Z/