app/controllers/phcpress/article/posts_controller.rb in phcpress-51.0.0 vs app/controllers/phcpress/article/posts_controller.rb in phcpress-52.0.0
- old
+ new
@@ -9,11 +9,11 @@
before_action :set_paper_trail_whodunnit
before_action :set_article_post, only: [:show, :edit, :update, :destroy]
# Article Index
def index
- @article_posts = Phcpress::Article::Post.where(org_id: current_user.org_id)
+ @article_posts = Phcpress::Article::Post.all
end
# Article Show
def show
@article_post = Phcpress::Article::Post.friendly.find(params[:id])
@@ -31,11 +31,10 @@
# POST
def create
@article_post = Phcpress::Article::Post.new(article_post_params)
@article_post.user_id = current_user.id
- @article_post.org_id = current_user.org_id
if @article_post.save
redirect_to article_posts_url, notice: 'Post was successfully created.'
else
render :new
end
@@ -63,10 +62,10 @@
@article_post = Phcpress::Article::Post.find(params[:id])
end
# Only allow a trusted parameter "white list" through.
def article_post_params
- params.require(:article_post).permit(:psttittle, :psttext, :pststatus, :pstimage, :remove_pstimage, :slug, :user_id, :org_id, category_ids: [])
+ params.require(:article_post).permit(:post_tittle, :post_text, :post_status, :post_image, :remove_post_image, :slug, :user_id, category_ids: [])
end
end
end