Sha256: aa63784550fa5865da3eed05b530804a66b46c8a3c40f6b49ac207909f63d25c
Contents?: true
Size: 682 Bytes
Versions: 17
Compression:
Stored size: 682 Bytes
Contents
#require 'rails_admin/config/fields/base' module RailsAdmin::Config::Fields::Types class Uploader < RailsAdmin::Config::Fields::Types::Text RailsAdmin::Config::Fields::Types::register(:rails_uploader, self) register_instance_option(:config) do {} end register_instance_option(:partial) do :form_rails_uploader end def scope_type # Use association name if existent if bindings[:form].object_name.scan(/.*\[(.*)_attributes\]/).nil? bindings[:form].object_name else bindings[:form].object_name.scan(/.*\[(.*)_attributes\]/).to_s end end def scope_id bindings[:object].id end end end
Version data entries
17 entries across 17 versions & 1 rubygems