On 8/9/07, andreim <andreim-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
>
> Hi,
>
> I want to write a method that acts like actionview''s form_for
method.
> Meaning:
>
> <% fancy_div do |div| %>
> ruby is awesome
> </div>
>
> should produce something like:
>
> <div class="fancy">
> <div class="inner">
> ruby is awesome
> </div>
> </div>
>
> I tried
>
> def test
> return "<div>#{yield"}</div>"
> 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
http://railscasts.com/episodes/40
HTH
Daniel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---