Skip to content

Instantly share code, notes, and snippets.

@queso
Created October 11, 2008 15:53
Show Gist options
  • Save queso/16284 to your computer and use it in GitHub Desktop.
Save queso/16284 to your computer and use it in GitHub Desktop.
########## Why does the yield output outside the content_tag block?
# Method
def submit(*args)
@template.content_tag(:div, :class => "save_actions") {
super(*args) + (yield).to_s
}
end
# Calling Haml block
= f.submit "Sign up" do
- if @site.beta_invites?
or
= link_to "Request a beta invite", new_invite_path
### Output
or
<a href="/invites/new">Request a beta invite</a>
<div class="save_actions"><input id="user_submit" name="commit" type="submit" value="Sign up" /></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment