Skip to content

Instantly share code, notes, and snippets.

@Schwad
Created September 5, 2017 13:23
Show Gist options
  • Save Schwad/a279b21a319d8c8f4035029922e53b4f to your computer and use it in GitHub Desktop.
Save Schwad/a279b21a319d8c8f4035029922e53b4f to your computer and use it in GitHub Desktop.
def blocks_double_render_error
@books = Book.all
render 'index' and return
render 'show'
@books.last.update_column(:title, 'Or am I?')
end
#=> Rendering books/index.html.haml within layouts/application
#=> Book.last.title
#=> "Surprise Surprise"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment