Active_admin, paperclipa - problem z zapisaniem nazwy pliku do BD

Mam mały problem z zapisem wysyłanego obrazka przez paperclipa do bazy danych. Obrazki ładnie się zapisują, jednak w momencie zapisu do bazy danych wartość dla pola image jest ustawiania na nil.
Siedzę już jakiś czas nad tym ale nadeszła pora poradzić się mądrzejszych głów, gdzie leży problem i jako go rozwiązać :slight_smile:

[code]Model
class GalleryImage < ActiveRecord::Base
belongs_to :gallery_album
attr_accessible :description, :image, :title, :gallery_album_id
attr_accessor :image_file_name
has_attached_file :image, :styles => { :thumb => [“200x200#”, :png] },
:url => “/img/upl/:id_:style.:extension”,
:path => “:rails_root/public/img/upl/:id_:style.:extension”
validates_attachment_presence :image, :message => “Musi byc obrazek”
end

Migracja
class CreateGalleryImages < ActiveRecord::Migration
def change
create_table :gallery_images do |t|
t.string :title
t.text :description
t.string :image
t.references :gallery_album
t.timestamps
end
add_index :gallery_images, :gallery_album_id
end
end

Active Admin
ActiveAdmin.register GalleryImage do
form :html => { :encytpe => “multipart/form-data” } do |f|
f.inputs “Details” do
f.input :gallery_album_id, :as => :select, :collection => GalleryAlbum.all
f.input :title
f.input :description
f.input :image
end
f.buttons
end
end[/code]

[quote=thoughtbot]The basics of paperclip are quite simple: Declare that your model has an attachment with the has_attached_file method, and give it a name.

Paperclip will wrap up up to four attributes (all prefixed with that attachment’s name, so you can have multiple attachments per model if you wish) and give them a friendly front end. These attributes are:

_file_name
_file_size
_content_type
_updated_at
By default, only _file_name is required for paperclip to operate. You’ll need to add _content_type in case you want to use content type validation.[/quote]
W migracji uzywasz

t.string :image

zamiast

t.string :image_file_name

To też już sprawdzałem i niestety też nie działa.

Edit
Temat można zamknąć. Ożeniłem carrierwavea z activeadmin i zadziałało z marszu.