Skip to content

Instantly share code, notes, and snippets.

@neilmiddleton
Created February 21, 2013 13:12
Show Gist options
  • Save neilmiddleton/5004648 to your computer and use it in GitHub Desktop.
Save neilmiddleton/5004648 to your computer and use it in GitHub Desktop.
app bookmarks
def bookmark!
uri = Addressable::URI.new
uri.query_values = cleanse(params)
uri.path = request.env["REQUEST_PATH"]
session[:last_bookmark] = uri.to_s
end
def bookmark
session[:last_bookmark] ||= root_path
end
def cleanse(_params)
_params.except(:controller, :action, :authenticity_token, :commit, :class)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment