Replaced defined? by local_assigns.has_key? in partials