diff --git a/lib/sisyphus-rails.rb b/lib/sisyphus-rails.rb index ac1d30e..6652c15 100644 --- a/lib/sisyphus-rails.rb +++ b/lib/sisyphus-rails.rb @@ -1,11 +1,12 @@ require "sisyphus-rails/version" require "sisyphus-rails/engine" -require "sisyphus-rails/form_helper" +# require "sisyphus-rails/form_helper" +require "sisyphus-rails/form_tag_helper" module Sisyphus end -if defined?(ActionView::Base) - ActionView::Base.default_form_builder = Sisyphus::FormBuilder -end \ No newline at end of file +# if defined?(ActionView::Base) +# ActionView::Base.default_form_builder = Sisyphus::FormBuilder +# end \ No newline at end of file diff --git a/lib/sisyphus-rails/form_helper.rb b/lib/sisyphus-rails/form_helper.rb deleted file mode 100644 index a127a1e..0000000 --- a/lib/sisyphus-rails/form_helper.rb +++ /dev/null @@ -1,8 +0,0 @@ -module Sisyphus - class FormBuilder < ActionView::Helpers::FormBuilder - def initialize(object_name, object, template, options, block=nil) - super - @template.output_buffer << "".html_safe - end - end -end diff --git a/lib/sisyphus-rails/form_tag_helper.rb b/lib/sisyphus-rails/form_tag_helper.rb new file mode 100644 index 0000000..01c4213 --- /dev/null +++ b/lib/sisyphus-rails/form_tag_helper.rb @@ -0,0 +1,18 @@ +module ActionView + module Helpers + module FormTagHelper + + def form_tag_with_sisyphus(url_for_options = {}, options = {}, &block) + buf = ActiveSupport::SafeBuffer.new + + if options.has_key?(:id) + buf.safe_concat("") + end + + buf << form_tag_without_sisyphus(url_for_options, options, &block) + end + + alias_method_chain :form_tag, :sisyphus + end + end +end \ No newline at end of file