cells icon indicating copy to clipboard operation
cells copied to clipboard

All cells escaped randomly locally and always in production

Open mbajur opened this issue 8 years ago • 5 comments

Hello!

I've been using cells fo some time now in one of my projects. Encountered some error once (i can't remember what exactly it was and found a solution in one of the issues here to put

def output_buffer=(*)
end

in my master cell (edit - i replaced it with include ActionView::Context - https://github.com/hcxp/hcxp/blob/master/app/cells/application_cell.rb). I think that error was somehow related to that method being missed but can't really recall it right now. Anyway - after i added that method, my app started to randomly escape all the cells. I have no ide what it's related to but, for instance, sometimes changing something in locale files bring normal unescaped cells back. But problem comes back after next app restart.

The same thing happens on production.

My application is pretty small and can be found in here: https://github.com/hcxp/hcxp

Thanks in advanced for any clues!

mbajur avatar Dec 22 '16 22:12 mbajur

Thats more or less how it look right now:

image

And i just realized that actually not ALL of the cells are escaped but i can't really see any regularity in this.

mbajur avatar Dec 22 '16 22:12 mbajur

One last update - i've tried a lot of solutions from this thread and none of it worked. It's still the same, i just think i found the regularity - it behaves like this when i'm using a block argument (link_to do or form_tag do etc).

  • Development - works just fine
  • Production - block tags escaped

mbajur avatar Dec 23 '16 08:12 mbajur

new rails 5.1 app, gems: 'slim-rails', 'cells-rails', 'cells-slim'

= link_to '/' do
  strong ABCD

produces escaped HTML in development: <strong>ABCD</strong>

batamire avatar Oct 04 '17 13:10 batamire

Yepp, the newer versions of cells-rails do not support several helpers of Rails anymore that use global state buffering. We're sorry for the inconvenience but those few "helpers" would dramatically increase our code complexity. Maybe it's time to write our own link_to helper that's done properly, and not a disgusting hack?

apotonick avatar Oct 05 '17 02:10 apotonick

I have similar behavior even in development. Are there any workarounds? Or I should write my own version of simple_form_for? :-D

Mehonoshin avatar May 06 '18 17:05 Mehonoshin