begin29
12/9/2016 - 5:51 PM

check if local variable is defined in view

check if local variable is defined in view

render "shared/header", { :headline => "Welcome", :person => person }

# shared/header
<% if local_assigns.has_key? :headline %>
  Headline: <%= headline %>
<% end %>