Reputation: 73
Good time, overflowers! I have an issue with the ActiveAdmin post submissiom. Here, below is the code from app/admin/posts.rb:
ActiveAdmin.register Post do
index do
column :title
column :slug
column :blurb
column :created_at
actions
end
form :html => { :enctype => "multipart/form-data" } do |f|
f.inputs 'Details' do
f.input :title
f.input :slug
f.input :blurb
f.input :category
f.input :content, :as => :text
end
f.inputs 'Images' do
f.input :image, :label => 'Post image', :as => :file
end
f.actions
end
end
And app/models/post.rb:
class Post < ActiveRecord::Base
belongs_to :category
end
I don't know why, but somehow when i'm trying to submit post using ActiveAdmin the result is something like this:
Post Details
Id 9
Title Empty
Slug Empty
Blurb Empty
Content Empty
Category Empty
Created At August 31, 2014 11:00
Updated At August 31, 2014 11:00
Image Empty
Any kind of help would be appreciated. Thank you for your time)
Upvotes: 0
Views: 541
Reputation: 2960
If you use Rails 4, you have to permit the params: https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters
You can see in the log/development.log file which attributes is unpermitted.
Upvotes: 1