Permalink
Browse files

Partially addresses #97 by checking for a current user

  • Loading branch information...
1 parent 0bbb073 commit 5127cf1424aab7665cb7b51db72bfb16595f7cbe @augustf augustf committed Jun 1, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 app/controllers/groups_controller.rb
@@ -15,8 +15,9 @@ def index
# GET /groups/1.xml
def show
@group = Group.find(params[:id])
- @membership = Membership.where(:group_id => @group.id, :user_id => current_user.id).first
-
+ if current_user
+ @membership = Membership.where(:group_id => @group.id, :user_id => current_user.id).first
+ end
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @group }

0 comments on commit 5127cf1

Please sign in to comment.