Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion Passing blocks to view helpers
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
Greg DeVore  
View profile   Translate to Translated (View Original)
 More options 14 Feb, 21:01
From: Greg DeVore <greg.dev...@gmail.com>
Date: Sat, 14 Feb 2009 13:01:33 -0800 (PST)
Local: Sat 14 Feb 2009 21:01
Subject: Passing blocks to view helpers
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,
Greg DeVore


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

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