We''re supposed to use yield instead of @content_for_layout, but I can''t get yield to work in a Markaby template: yield text yield Either one of these lines results in a ''no block given'' error (but ''text @content_for_layout'' works). Anybody know how to use yield instead? Thanks, Joe -- Posted via http://www.ruby-forum.com/.
subimage interactive
2006-Aug-09 02:13 UTC
[Rails] [Markaby] yield instead of @content_for_layout?
<%= yield :text %> On 8/8/06, Joe Ruby <joeat303@yahoo.com> wrote:> > We''re supposed to use yield instead of @content_for_layout, but I can''t > get yield to work in a Markaby template: > > yield > > text yield > > Either one of these lines results in a ''no block given'' error (but ''text > @content_for_layout'' works). Anybody know how to use yield instead? > > Thanks, > Joe > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- seth at subimage interactive http://www.subimage.com/sublog/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060809/c6e39930/attachment.html
Joe Ruby wrote:> We''re supposed to use yield instead of @content_for_layout, but I can''t > get yield to work in a Markaby template: > > yield > > text yield > > Either one of these lines results in a ''no block given'' error (but ''text > @content_for_layout'' works). Anybody know how to use yield instead? > > Thanks, > JoeUse content_for_layout method. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I use yield all the time: <%= yield %> I''m on Rails 1.2.3 and Ruby 1.8.5 -- maybe your version is the issue (as I recall, ''yield'' is the newer, preferred method). ...jon On Apr 3, 7:20 am, Ilya Novoselov <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Joe Ruby wrote: > > We''re supposed to use yield instead of @content_for_layout, but I can''t > > get yield to work in a Markaby template: > > > yield > > > text yield > > > Either one of these lines results in a ''no block given'' error (but ''text > > @content_for_layout'' works). Anybody know how to use yield instead? > > > Thanks, > > Joe > > Use content_for_layout method. > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---