The pull request with all the code.

perhaps some instance variables for these two variables, and then putting them in their own private method that you call a` before_action` on.  DRY's it up a bit