app/controllers/phcpresspro/blog/posts_controller.rb in phcpresspro-2.0.0 vs app/controllers/phcpresspro/blog/posts_controller.rb in phcpresspro-2.0.1
- old
+ new
@@ -5,11 +5,11 @@
module Phcpresspro
class Blog::PostsController < ApplicationController
# Filters & Security
layout 'layouts/phcpresspro/blogpost/blog_layout'
- before_action :authenticate_user!, if: -> { defined?(Devise) }
+ before_action :require_user
before_action :set_blog_post, only: [:edit, :update, :destroy]
# Blog Post Index (/blog/posts)
def index
@blog_posts = Blog::Post.all
@@ -62,15 +62,9 @@
end
# Whitelist on what can be posted
def blog_post_params
params.require(:blog_post).permit(:blogpsttitle, :blogpsttext, :blogpstexcerpts, :pststatus, :pstimage, :user_id)
- end
-
- # Current User
- def current_user
- return unless session[:user_id]
- @current_user ||= User.find(session[:user_id])
end
end
end