Skip to content

Instantly share code, notes, and snippets.

@wearethefoos
Created June 18, 2013 12:07
Show Gist options
  • Save wearethefoos/5804813 to your computer and use it in GitHub Desktop.
Save wearethefoos/5804813 to your computer and use it in GitHub Desktop.
Render templates without double render errors
# render in before_filter
before_filter
render 'template' and return
end
# Render conditional
def index
respond_to do |format|
if a
format.html { render 'a' }
elsif b
format.html { render 'b' }
else
format.html # index.html.haml
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment