Skip to content

Instantly share code, notes, and snippets.

@kakobotasso
Created January 3, 2013 03:24
Show Gist options
  • Save kakobotasso/4440495 to your computer and use it in GitHub Desktop.
Save kakobotasso/4440495 to your computer and use it in GitHub Desktop.
def index
@produto = Produto.find_by_slug(params[:produto])
nvisitas = @produto.nvisitas ||= 0
nvisitas += 1
if @produto.update_attribute(:nvisitas, nvisitas)
@produto
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment