This commit is contained in:
@@ -24,6 +24,9 @@ class ThreadPostsController < ApplicationController
|
||||
def create
|
||||
post = @thread.posts.new(post_params)
|
||||
if post.save
|
||||
post.thread.tap { |thread|
|
||||
thread.updated_at = post.created_at
|
||||
}.save!
|
||||
render json: post.as_json.merge(image_url: (
|
||||
if post.image.attached?
|
||||
Rails.application.routes.url_helpers.rails_blob_url(post.image, only_path: true)
|
||||
|
||||
Reference in New Issue
Block a user