app/controllers/phcpresspro/news/posts_controller.rb in phcpresspro-2.0.0 vs app/controllers/phcpresspro/news/posts_controller.rb in phcpresspro-2.0.1
- old
+ new
@@ -3,11 +3,11 @@
module Phcpresspro
class News::PostsController < ApplicationController
# Filters & Security
layout 'layouts/phcpresspro/newspost/news_layout'
- before_action :authenticate_user!, if: -> { defined?(Devise) }
+ before_action :require_user
before_action :set_news_post, only: [:edit, :update, :destroy]
# News Post Index
def index
@news_posts = News::Post.all
@@ -56,15 +56,9 @@
end
# Whitelist
def news_post_params
params.require(:news_post).permit(:newspsttitle, :newspsttext, :newspstexcerpts, :pststatus, :pstimage, :user_id, :category_id)
- end
-
- # Current User
- def current_user
- return unless session[:user_id]
- @current_user ||= User.find(session[:user_id])
end
end
end