Module: Thredded::PostAttachments::TopicActions

Extended by:
ActiveSupport::Concern
Defined in:
lib/thredded/post_attachments.rb

Instance Method Summary collapse

Instance Method Details

#createObject



35
36
37
38
39
40
41
42
43
44
# File 'lib/thredded/post_attachments.rb', line 35

def create
  @new_topic = Thredded::TopicForm.new(self.new_topic_params)
  authorize_creating @new_topic.topic
  if @new_topic.save
    post = @new_topic.topic.posts.last
    redirect_to post_path(post, user: thredded_current_user)
  else
    render :new
  end
end