app/helpers/trestle/form_helper.rb in trestle-0.8.5 vs app/helpers/trestle/form_helper.rb in trestle-0.8.6

- old
+ new

@@ -2,10 +2,13 @@ module FormHelper def trestle_form_for(instance, options={}, &block) options[:builder] ||= Form::Builder options[:as] ||= admin.admin_name.singularize + options[:data] ||= {} + options[:data].merge!(remote: true, type: :html, behavior: "trestle-form", turbolinks: false) + form_for(instance, options) do |f| with_form(f) { yield f } end end @@ -24,8 +27,12 @@ content_for(:"#{name}_toolbar", &block) end def sidebar(&block) content_for(:sidebar, &block) + end + + def render_sidebar_as_tab? + dialog_request? && content_for?(:sidebar) end end end