Skip to content
This repository has been archived by the owner on May 25, 2018. It is now read-only.

NoMethodError: undefined method `output_buffer=' for #9

Closed
tscolari opened this issue Mar 19, 2012 · 6 comments
Closed

NoMethodError: undefined method `output_buffer=' for #9

tscolari opened this issue Mar 19, 2012 · 6 comments
Assignees
Milestone

Comments

@tscolari
Copy link

Hello, I'm getting this error message when trying to compile my .js.hamlbars file:

throw Error("NoMethodError: undefined method `output_buffer=' for #<#<Class:0x007fd1c69bc428>:0x007fd1c7e41bc8>\n  (in ........./app/assets/javascripts/ember/templates/sessions/login_box.js.hamlbars)")

My template looks like this:

.loginbox#loginbox
  = form_for(User.new, :url => user_session_path()) do |f|
    = f.label :email, :class => 'fm-lbl'
    = f.text_field :email, :class => 'fm-txt'
    = f.label :password, :class => 'fm-lbl'
    = f.password_field :password, :class => 'fm-txt'
    .remember
      = f.check_box :remember_me
      = f.label :remember_me, 'Lembrar meu login'
    = f.submit 'Entrar', :class => 'fm-sub bt-default'

I had the helpers enabled with

Hamlbars::Template.enable_rails_helpers!

because I need some assets handling helpers

@ghost ghost assigned jimsynz Mar 20, 2012
@jimsynz
Copy link
Owner

jimsynz commented Apr 11, 2012

I'm guessing that this wont work because one of the helpers you're using is trying to access the request object. Can you post the full backtrace?

@inkstak
Copy link
Contributor

inkstak commented Apr 15, 2012

I got the same.. The problem is around the form_for helper.

My template :

= form_for Foo.new do |f|
  = 'hello world'

And the top lines of the full backtrace :

actionpack (3.2.2) lib/action_view/helpers/capture_helper.rb:190:in `ensure in with_output_buffer'
actionpack (3.2.2) lib/action_view/helpers/capture_helper.rb:190:in `with_output_buffer'
haml (3.1.4) lib/haml/helpers/xss_mods.rb:109:in `with_output_buffer_with_haml_xss'
actionpack (3.2.2) lib/action_view/helpers/capture_helper.rb:40:in `capture'
haml (3.1.4) lib/haml/helpers/action_view_mods.rb:105:in `capture_with_haml'
actionpack (3.2.2) lib/action_view/helpers/form_helper.rb:606:in `fields_for'
actionpack (3.2.2) lib/action_view/helpers/form_helper.rb:377:in `form_for'
haml (3.1.4) lib/haml/helpers/action_view_mods.rb:183:in `form_for_with_haml'
haml (3.1.4) lib/haml/helpers/xss_mods.rb:132:in `form_for_with_haml_xss'
app/assets/javascripts/templates/foo/_form.js.hbs:3:in `evaluate_source'
tilt (1.3.3) lib/tilt/template.rb:209:in `instance_eval'
tilt (1.3.3) lib/tilt/template.rb:209:in `evaluate_source'
tilt (1.3.3) lib/tilt/template.rb:144:in `cached_evaluate'
tilt (1.3.3) lib/tilt/template.rb:127:in `evaluate'
hamlbars (2012.3.21) lib/hamlbars/ext/rails_helper.rb:18:in `evaluate'
hamlbars (2012.3.21) lib/hamlbars/template.rb:78:in `evaluate'

Let's investigate...

@inkstak
Copy link
Contributor

inkstak commented Apr 15, 2012

It seems the problem is already known : sstephenson/sprockets#218

@jimsynz
Copy link
Owner

jimsynz commented Apr 15, 2012

So sounds like it's just something that's unsupported due to the way the helpers are implemented. @blakink, should we just close this issue?

@tscolari
Copy link
Author

If you could take a look at https://github.com/infbio/haml_assets, they don't support handlebars, but haml on assets pipeline.
They figured out a way to render these kind of helpers on version >= 0.1.0.
I'm not sure, but I think it's this commit: https://github.com/infbio/haml_assets/commit/5c1fc8f4d401453f437df37ba3826a9e03b63cd1

@jimsynz
Copy link
Owner

jimsynz commented Dec 12, 2012

Closing because compilation has been removed from the v2.0 branch.

@jimsynz jimsynz closed this as completed Dec 12, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants