Where to put partials shared by the whole application in Rails?

Yuval Karmi picture Yuval Karmi · Mar 5, 2010 · Viewed 17k times · Source

Where would I go about placing partial files shared by more than one model? I have a page called crop.html.erb that is used for one model - Photo. Now I would like to use it for another model called User as well.

I could copy and paste the code but that's not very DRY, so I figured I would move it into a partial.

Since it's shared between two models - where would I place that partial?

Thanks!

Answer

John Topley picture John Topley · Mar 5, 2010

The Rails convention is to put shared partials in /app/views/shared.