Class: Thredded::TopicPreviewsController

Inherits:
ApplicationController show all
Includes:
NewTopicParams, RenderPreview
Defined in:
app/controllers/thredded/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/topic_previews_controller.rb', line 11

def preview
  form = Thredded::TopicForm.new(new_topic_params)
  authorize_creating form.topic
  @post = form.post
  @post.postable = form.topic
  render_preview
end