Class: Thredded::PrivateTopicPreviewsController

Inherits:
ApplicationController show all
Includes:
NewPrivateTopicParams, RenderPreview
Defined in:
app/controllers/thredded/private_topic_previews_controller.rb

Instance Method Summary collapse

Methods included from UrlsHelper

#delete_post_path, #edit_post_path, #edit_preferences_path, #edit_preferences_url, #mark_unread_path, #permalink_path, #post_path, #post_url, #quote_post_path, #search_path, #send_private_message_path, #topic_path, #topic_url, #unread_topics_path, #user_path

Instance Method Details

#previewObject


11
12
13
14
15
16
17
# File 'app/controllers/thredded/private_topic_previews_controller.rb', line 11

def preview
  form = Thredded::PrivateTopicForm.new(new_private_topic_params)
  authorize_creating form.private_topic
  @private_post = form.post
  @private_post.postable = form.private_topic
  render_preview
end