Reputation: 7419
I can not upload images in activeadmin
class Tool::Cvt::RemoteFocu < ActiveRecord::Base
belongs_to :user
has_many :remote_focu_logs, :dependent => :destroy#, :autosave => true
accepts_nested_attributes_for :remote_focu_logs, allow_destroy: true
# New/Edit forms
form :html => { :multipart => true } do |f|
f.has_many :remote_focu_logs do |p|
p.input :snapshot, :as => :file
end
f.actions
end
permit_params :user_id, :ip, :model, :version, :setting, :comment, :result_path, :status,:remote_focu_logs_attributes, :utf8, :_method, :authenticity_token, :commit, :locale, :id
Unpermitted parameters: remote_focu_logs_attributes
Unpermitted parameters: utf8, _method, authenticity_token, commit, locale, id
(0.1ms) BEGIN
(0.1ms) ROLLBACK
Upvotes: 0
Views: 604
Reputation: 2970
Try to permit remote_focu_logs_attributes: [:id, :snapshot, :_destroy]
instead of :remote_focu_logs_attributes
Upvotes: 3