File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,8 @@ def index
40
40
def show
41
41
content_type = content_type_from_controller ( self . class )
42
42
return redirect_to root_path unless valid_content_types . map ( &:name ) . include? ( content_type . name )
43
- @content = content_type . find ( params [ :id ] )
43
+ @content = content_type . find_by ( id : params [ :id ] )
44
+ return redirect_to ( root_path , notice : "You don't have permission to view that content." ) if @content . nil?
44
45
@serialized_content = ContentSerializer . new ( @content )
45
46
46
47
return redirect_to ( root_path ) if @content . user . nil? # deleted user's content
Original file line number Diff line number Diff line change @@ -4,7 +4,9 @@ def index
4
4
end
5
5
6
6
def show
7
- @user = User . find ( params [ :id ] )
7
+ @user = User . find_by ( id : params [ :id ] )
8
+ return redirect_to ( root_path , notice : 'That user does not exist.' ) if @user . nil?
9
+
8
10
@content = @user . public_content . select { |type , list | list . any? }
9
11
@tabs = @content . keys
10
12
@stream = @user . content_change_events . order ( 'updated_at desc' ) . limit ( 100 ) . group_by do |cce |
You can’t perform that action at this time.
0 commit comments