Ruby Forum Ruby on Rails > [Markaby] yield instead of @content_for_layout?

Posted by Joe Ruby (Guest)
on 09.08.2006 01:02
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 by Ilya Novoselov (nullguid)
on 03.04.2007 16:20
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 by JSeidel (Guest)
on 04.04.2007 15:57
(Received via mailing list)
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...@andreas-s.net>