Sha256: 680c5aca45c43f909d4c6f0bd37b5090738bd93b30a243b28cccd6887e8e585f
Contents?: true
Size: 524 Bytes
Versions: 3
Compression:
Stored size: 524 Bytes
Contents
module Spina module Admin module PagesHelper def link_to_add_fields(f, association, &block) 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 '#', class: "add_fields button", data: {id: id, fields: fields.gsub("\n", "")} do block.yield end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
spina-0.6.13 | app/helpers/spina/admin/pages_helper.rb |
spina-0.6.12 | app/helpers/spina/admin/pages_helper.rb |
spina-0.6.11 | app/helpers/spina/admin/pages_helper.rb |