Sha256: 8d0316049e431ed36798f1ce8c23d2fe772b43779ca1abc580b32c4b1c90266e

Contents?: true

Size: 553 Bytes

Versions: 4

Compression:

Stored size: 553 Bytes

Contents

module Refinery
  module Contacts
    module Admin
      module ContactsHelper

        def link_to_add_fields(name, f, association)
          new_object = f.object.send(association).klass.new
          id = new_object.object_id
          fields = f.fields_for(association, new_object, :child_index=> id) do |builder|
            render(association.to_s.singularize + "_fields", :f=> builder)
          end
          link_to(name, '#', :class=> "add_fields", :data=> {:id=> id, :fields=> fields.gsub("\n", "")})
        end

      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
refinerycms-contacts-0.2.0 app/helpers/refinery/contacts/admin/contacts_helper.rb
refinerycms-contacts-0.1.2 app/helpers/refinery/contacts/admin/contacts_helper.rb
refinerycms-contacts-0.1.1 app/helpers/refinery/contacts/admin/contacts_helper.rb
refinerycms-contacts-0.1.0 app/helpers/refinery/contacts/admin/contacts_helper.rb