liantics/craigstr — pull request #25 by liantics (2014-07-24 18:13:31+00:00)
Title: Lea user delete posts

1) Address this comment on the now-non-existent original pull request:

In app/controllers/posts_controller.rb:
> + before_action :ensure_user_can_modify_post, only: [:edit, :update, :destroy]

I recommend doing away with the before_action (We typically try to avoid them whenever possible. They are harder to reason about because they are defined far away from where they actually happen, so sometimes you can miss that they are going to get called). I recommend defining a method on user accessible_posts that returns all posts for admins, and posts for anyone else. then just finding the posts through the current_user

2) Fix a redirect bug in locations controller

3) Remove instance variables that are no longer used on posts index page