Skip to content

Instantly share code, notes, and snippets.

@kastner
Forked from queso/gist:16284
Created October 11, 2008 16:22
Show Gist options
  • Save kastner/16288 to your computer and use it in GitHub Desktop.
Save kastner/16288 to your computer and use it in GitHub Desktop.
########## Why does the yield output outside the content_tag block?
# Method
def submit(*args)
block_output = yield
@template.content_tag(:div, :class => "save_actions") {
super(*args) + block_output
}
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