There is no big difference between them. I prefer the first example. But sometimes u should render this partial within concrete layout. And u should type <%= render partial: "shared/header", layout: 'something'%>
. Also note that explicitly specifying :partial
is required when passing additional options such as :layout
. So it depends on situation. If u want to render just partial without any extra options then just use first example or use second one if u want to pass some extra options like layout
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…