I’m trying to build out an app and I started getting confused when to use a partial as opposed to simply refactoring code. In other words, when should I use ‘render’ and ‘render partial: ……..”
And if I put something in the “shared” folder under “views” does that make it a partial? Not sure when to use these different folders. Thanks a whole bunch!
Normally you use ‘render’ for just move some html codes, like “footer”.
If you want the partial with its own layout or pass variables in it. We will use ‘render :partial’
Reference: http://guides.rubyonrails.org/layouts_and_rendering.html#using-partials