app/helpers/alchemy/admin/contents_helper.rb in alchemy_cms-2.2.rc14 vs app/helpers/alchemy/admin/contents_helper.rb in alchemy_cms-2.2.rc15
- old
+ new
@@ -73,19 +73,20 @@
#
# Optionally you can pass a label:
#
# <%= render_create_content_link(element, 'file', :label => 'Add a file') %>
#
- def render_create_content_link(element, content_name, options = {})
+ def render_create_content_link(element, content_name, options = {}, options_for_content = {})
defaults = {
:label => t('Add %{name}', :name => t(content_name, :scope => :content_names))
}
options = defaults.merge(options)
link_to(render_icon(:create) + options[:label], alchemy.admin_contents_path(
:content => {
:name => content_name,
:element_id => element.id
- }
+ },
+ :options => options_for_content.to_json
),
:method => :post,
:remote => true,
:id => "add_content_for_element_#{element.id}",
:class => 'button new_content_link'