Sha256: 8d1ab7c5d3cc8af0cefddf6a79e99ab7ee33dc4ed4e5d5a3c37f90b130fdea47

Contents?: true

Size: 716 Bytes

Versions: 8

Compression:

Stored size: 716 Bytes

Contents

module MuckContentsHelper
  
  # share is an optional share object that can be used to pre populate the form.
  # options:
  #     html options for form:
  #     :html => {:id => 'a form'}
  def content_form(content = nil, options = {}, &block)
    content ||= Content.new
    options[:html] = {} if options[:html].nil?
    raw_block_to_partial('contents/form', options.merge(:content => content), &block)
  end
  
  # content uses friendly_id but we want the param in the form to use the number id
  def get_content_form_url(content, parent)
    if content.new_record?
      contents_path(make_muck_parent_params(parent))
    else
      content_path(content.id, make_muck_parent_params(parent))
    end
  end
  
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
muck-contents-0.1.8 app/helpers/muck_contents_helper.rb
muck-contents-0.1.7 app/helpers/muck_contents_helper.rb
muck-contents-0.1.6 app/helpers/muck_contents_helper.rb
muck-contents-0.1.5 app/helpers/muck_contents_helper.rb
muck-contents-0.1.4 app/helpers/muck_contents_helper.rb
muck-contents-0.1.1 app/helpers/muck_contents_helper.rb
muck-contents-0.1.2 app/helpers/muck_contents_helper.rb
muck-contents-0.1.3 app/helpers/muck_contents_helper.rb