Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

form_for and form_tag content is escaped from cell #428

Open
KudryashovAV opened this issue Aug 23, 2016 · 3 comments
Open

form_for and form_tag content is escaped from cell #428

KudryashovAV opened this issue Aug 23, 2016 · 3 comments

Comments

@KudryashovAV
Copy link

KudryashovAV commented Aug 23, 2016

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

@mayinx
Copy link

mayinx commented Nov 22, 2016

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?

@KudryashovAV
Copy link
Author

KudryashovAV commented Nov 22, 2016

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

@mayinx
Copy link

mayinx commented Nov 22, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants