nikolalsvk / render_async

render_async lets you include pages asynchronously with AJAX
https://rubygems.org/gems/render_async/
MIT License
1.08k stars 75 forks source link

Bug: Using with haml #86

Closed jonatasrancan closed 5 years ago

jonatasrancan commented 5 years ago

Hi.

I'm working in a project that uses haml, isntead of erb. When I added render_async to the project, I started getting this error undefined method 'haml_tag'.

I looked at the render_async code, and didn't find anything that might cause that conflict. You can check the error here https://github.com/jonatasrancan/bug-render-async

Just start the app and try to access the root page, the error will show up. Then remove render_async, from the gem file, and the app will work normally.

Any idea on why this is happening?

jonatasrancan commented 5 years ago

I tracked the problem to this line https://github.com/renderedtext/render_async/blob/master/lib/render_async.rb#L6

The simple act of just call ActionView::Base will mess up the haml gem.

I still investigating, to find a workaround

Update: The real problem is between https://github.com/k0kubun/hamlit and render_async

nikolalsvk commented 5 years ago

Hi @jonatasrancan, thanks for submitting the issue!

I've tried running the example app you posted on GitHub but I'm getting the same error about haml_tag not being defined. I'm investigating what could be the issue here.

Thank you for posting the repo and investigating this bug 👏

jonatasrancan commented 5 years ago

Hi @nikolalsvk

I found this issue https://github.com/k0kubun/hamlit/issues/71#issuecomment-224018926 it might be related with the problem.

Some how when we include the render_async helpers on ActionView::Base it is messing up with the haml helpers.

jonatasrancan commented 5 years ago

@nikolalsvk

In the end, it was just a bad gem combination.

If you use haml and haml-rails with render_async, everything works fine.

If you are using hamlit you should use hamlit-rails. And hamlit doesn't implement haml_tag helper, so adding render_async in combination with hamlit and haml-rails just brought to light a problem that could explode anytime.

Fell free to close this issue.

nikolalsvk commented 5 years ago

Oh OK, thank you for looking into this issue @jonatasrancan and thank you for using render_async. Please report if you find any more issues :)

I'll close this issue since it's not related to render_async.