Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Calling html_safe on a heredoc stalls development server

#6610

This helper works (in application_helper.rb):

  def facebook_button(options={})
    markup = ''
    markup += "<a class=\"fb_button fb_button_medium\" href=\"#{options[:link]}\">"
    markup += "<span class=\"fb_button_text\">#{options[:text]}</span>"
    markup += "</a>"

    markup.html_safe
  end

But this makes the development server stall in a way that only a kill -9 closes it:

  def facebook_button(options={})
    <<-markup
    <a class="fb_button fb_button_medium" href="#{options[:link]}">
      <span class="fb_button_text">#{options[:text]}</span>
    </a>
    markup 

    markup.html_safe
  end

I actually don't assign the heredoc :D but it shouldn't get stuck... right?

I'm on Arch Linux x86_64, using Rails 3.0.4 on REE 2011.03. I tried both WEBrick and Thin (1.2.8).

Thanks,

Bruno A.

Reported by Bruno Antunes · March 23rd, 2011 @ 05:23 PM

State: invalid
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Santiago Pastorino
    Santiago Pastorino
    • State changed from new to invalid
    • Importance changed from to Low

    You have to assign the heredoc to a var an call string methods on it.

    March 24th, 2011 @ 12:36 AM