diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index b1e6401..c8cd616 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,4 +1,9 @@ class UsersController < ApplicationController + def show + @user = User.friendly.find(params[:id]) + @comments = @user.comments + end + def new @user = User.new end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4b0e707..1fae468 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -3,6 +3,10 @@ module ApplicationHelper bootstrap_classes[flash_type] || flash_type.to_s end + def page_header + content_for(:title) || '' + end + private def bootstrap_classes diff --git a/app/models/subcreddit.rb b/app/models/subcreddit.rb index f1aa3d1..ea37b6a 100644 --- a/app/models/subcreddit.rb +++ b/app/models/subcreddit.rb @@ -16,13 +16,12 @@ class Subcreddit < ActiveRecord::Base presence: true, format: /\A(?! )[a-z0-9 ]*(?