Last active
August 29, 2015 13:56
-
-
Save pete-a/8928040 to your computer and use it in GitHub Desktop.
Refactor example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GET /everything | |
def index | |
@page = params[:page] ||= 1 # Set as 1 if page number not provided | |
gon.current_page = @page # Not sure I'm a fan of setting JS variables this way, but will leave for now | |
@shots = Shot.seen_by(current_user).paginate(page: @page) | |
@notifications = Notification.unseen_counts(shots: @shots, user: current_user) # Not great, but better | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment