Associate post with crop from crop show page

Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>
This commit is contained in:
google-labs-jules[bot]
2026-05-01 11:35:58 +00:00
parent 9833801a42
commit 4643fbd92e
4 changed files with 22 additions and 1 deletions

View File

@@ -21,6 +21,10 @@ class PostsController < ApplicationController
def new
@post = Post.new
@forum = Forum.find_by(id: params[:forum_id])
if params[:crop_id]
@crop = Crop.friendly.find(params[:crop_id])
@post.body = "[#{@crop.name}](crop)"
end
respond_with(@post)
end