Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion Passing blocks to view helpers

View Parsed - Show only message text

MIME-Version: 1.0
Received: by 10.151.6.2 with SMTP id j2mr905994ybi.26.1234645293907; Sat, 14 
	Feb 2009 13:01:33 -0800 (PST)
Date: Sat, 14 Feb 2009 13:01:33 -0800 (PST)
X-IP: 173.79.130.201
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-us) 
	AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1,gzip(gfe),gzip(gfe)
Message-ID: <ed88a45a-aa99-45b8-9ada-8eebb3cf8071@z28g2000prd.googlegroups.com>
Subject: Passing blocks to view helpers
From: Greg DeVore <greg.dev...@gmail.com>
To: StaticMatic <staticmatic@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Just getting started with staticmatic and I am having a little trouble
passing blocks to view helpers.  I have this helper:

  def quote_block(&block)
    output = "<blockquote><div>"
    output << yield
    output << "</div></blockquote>"
    output
  end

In my view I have:

= quote_block { "<p>ScreenSteps has been a huge factor in my success
in my position.</p>"}

That works.

What I would like to do is something like this:

= quote_block do
  %p "ScreenSteps has been a huge factor in my success in my
position."

But I can't get that to work. Staticmatic doesn't seem to recognize
that I am passing a block unless I use the {}.

Any ideas?

Thanks,

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google