And what about cases where I need the model attribute names to be
different?  For instance, in one case I might print item.name, but in
the other, item.title.  And since this markup will be similar to the
front-end display (non-admin), is there a good way to set the link_to
to be either :admin or :root?

On Feb 27, 9:35 pm, Maurício Linhares <mauricio.linha...@gmail.com>
wrote:
> Here's how it could look like ->http://pastie.org/402767
>
> And having five pages with almost the same markup is always wrong, you
> don't even need to be looking for DRYing up your code.
>
> -
> Maurício Linhareshttp://alinhavado.wordpress.com/(pt-br) 
> |http://blog.codevader.com/(en)
>
> On Sat, Feb 28, 2009 at 12:20 AM, ericindc <ericmilf...@gmail.com> wrote:
>
> > I'm working on fixing up the code in my first Rails application and
> > have come around to DRYing up the views and partials.  For the most
> > part, I'm satisfied with the DRYness of the application, but I have
> > 5-6 partials that display nearly identical XHTML, just with different
> > content, link_to paths, and images.
>
> > I know this question is entirely subjective, but would finding a way
> > to further DRY the 5-6 partials into one partial with plugs for
> > different fillers be too much?  If so, how would I go about doing
> > this?
>
> > 2 examples...
>
> >http://pastie.org/402754
> >http://pastie.org/402756
>
>
--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to