If you have a partial called with or without local parameters, example :
= render :partial => 'user/new'
= render :partial => 'user/new', :locals => { :show_ad => true }
And you don’t want the partial to break when the local isn’t assigned, you can access it through the local_assigns variable :
- if local_assigns[:show_ad]
= render :partial => "ad"