Are you familiar with content_for ?

<%= yield :list_roles -%>

<% content_for :list_roles, 'content here' -%>

or as a block

<% content_for :list_roles do %>
  content here...
<% end %>

Cheers,
Robby

On Fri, Dec 26, 2008 at 12:15 PM, Clem Rock
<[email protected]> wrote:
>
> Hello,
>    I love the concept of using <%=yield %> to automatically render
> content but there are times where I find it a bit restraining.
>
> For instance, I would like to to use the exact same partial for these 2
> methods:
>
> list_roles and create
>
> If I try to use render :partial => 'list_roles' in the create method,
> the only way I can get it to work is to create a _list_roles.html.erb
> template which seems like a bit of overkill.
>
> The only difference that the create/list_roles template is going to have
> is one extra dynamic table row.
>
> Is there anyway to increase the flexibility of the yield method?
>
> Thanks,
> Clem
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>



-- 
Robby Russell
Chief Evangelist, Partner

PLANET ARGON, LLC
design // development // hosting w/Ruby on Rails

http://www.planetargon.com/
http://www.robbyonrails.com/
aim: planetargon

+1 503 445 2457
+1 877 55 ARGON [toll free]
+1 815 642 4068 [fax]

--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to