ruby on rails 3 - Display partial unless content_for was defined? -


what want is, show default sidebar content unless current view has else display in sidebar.

how this? (rails3)

content_for?(:sidebar) ? yield(:sidebar) : render(:partial => "shared/default_sidebar")  

Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -