HAML Issues
bhaberer opened this issue · comments
I'm having trouble converting an existing project over to haml.
After adding the haml gem to my environment.rb and converting all my erb files to haml per the README caveat (Re HAML clashing with ERB) I'm now getting the following issue on any pages with a facebook_sign_(in||out)_link call.
NoMethodError in Home#index
Showing app/views/layouts/application.html.haml where line #19 raised:
undefined method `<<' for #Haml::Helpers::ErrorReturn:0xb63fbc98
Extracted source (around line #19):
16: .fb_card_info
17: - if current_user_admin?
18: = link_to 'A', admin_path, :class => 'sign_out', :style => 'float: right;'
19: = facebook_sign_out_link :user, :v => '2', :size => :small
20: %span= current_user.name
21: - else
22: = facebook_sign_in_link :user, :v => '2', :size => :small
If you know what might be causing this, or if I need to do anything beyond simply removing all ERB files from my project, please let me know.
It works fine with Haml 2.x. In Haml 3.x you need to update "facebook_sign_in_link method" in lib/devise_facebook_connectable/view_helpers.rb and most likely change "<<" in line 68 to "+".
Changing the method to + on the various relevant lines didn't do anything, but down ranking the version of the HAML gem to 2.2.24 seems to have done the trick.
Thanks for the tip!
Here's a patch that solves the problem of running this gem with Haml 3: szimek/devise_facebook_connectable@133fabb
I can confirm that this fixes the issue, I've been using it for a few days.
Thanks Szimek.