cells icon indicating copy to clipboard operation
cells copied to clipboard

form_for and form_tag content is escaped from cell

Open KudryashovAV opened this issue 9 years ago • 3 comments

Have an issue really similar to http://stackoverflow.com/questions/37538519/using-forms-for-with-rails-cells-gem but with erb and rails 3.

KudryashovAV avatar Aug 23 '16 07:08 KudryashovAV

Same here - I use cells + cells-erb with rails 3 and the form_tag-output is escaped - did you (or anyone else) find any fix for this in the meantime?

mayinx avatar Nov 22 '16 15:11 mayinx

in config/initializers/cells.rb you can write:

module Cell
  module Erb
    def form_tag_in_block(html_options, &block)
      content = capture(&block)
      "#{form_tag_html(html_options)}" << content.to_s << "</form>"
    end
  end
end

and it should works

KudryashovAV avatar Nov 22 '16 16:11 KudryashovAV

Awesome dude - that worked like a charm - thanks a lot!

mayinx avatar Nov 22 '16 17:11 mayinx