ruby on rails - In which folder should I put "global" shared partial templates? -
this question has answer here:
i using ruby on rails 3.0.7 , planning use partial templates. classes in application use same partials have decide located those.
is idea put "global" shared partial templates in lib
folder? if no, common practice choose folder put those? advice on how name , load folder?
the standard placing shared partials in app/views/shared
, , referencing them as
render :partial => 'shared/partial_name'
if have standard "row in list" partial (say, index page), use shared partial like:
# render single object row: render :partial => 'shared/item', :locals => { :item => @item } # or render them all: render :partial => 'shared/item', :collection => @items
Comments
Post a Comment