Sha256: 8aae85783e3e0d88d4118ca6ae1b1e2f72b27b477d03774860d9ebb3e481231c
Contents?: true
Size: 742 Bytes
Versions: 4
Compression:
Stored size: 742 Bytes
Contents
# frozen_string_literal: true module Thredded class PrivatePostPreviewsController < Thredded::ApplicationController include Thredded::RenderPreview # Preview a new post def preview @private_post = PrivatePost.new(private_post_params) @private_post.postable = PrivateTopic.friendly_find!(params[:private_topic_id]) render_preview end # Preview an update to an existing post def update @private_post = PrivatePost.find(params[:private_post_id]) @private_post.assign_attributes(private_post_params) render_preview end private def private_post_params params.require(:post) .permit(:content) .merge(user: thredded_current_user) end end end
Version data entries
4 entries across 4 versions & 1 rubygems