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

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

mod rewrite - Doing external redirect. .htaccess NS flag not working. How to achieve similar results? -