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

python - Does anyone know how to configure the hunpos wrapper class on nltk? -

mysql - How to insert just year and month into date field? -