Writing actionview wrappers?

Hi,

I want to write a method that acts like actionview’s form_for method.
Meaning:

<% fancy_div do |div| %>
ruby is awesome

should produce something like:

ruby is awesome

I tried

def test
return “

#{yield”}
"
end

But this only returns the contents (the yield part) and doesn’t wrap
it around the divs.
Any suggestions?
Thanks!

–Andrei

On 8/9/07, andreim [email protected] wrote:

def test
return “

#{yield”}
"
end

But this only returns the contents (the yield part) and doesn’t wrap
it around the divs.
Any suggestions?
Thanks!

–Andrei

Check out Ryan Davies Railcasts. He’s done one on exactly this

HTH
Daniel