mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-24 08:52:14 -04:00
Associate post with crop from crop show page
Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user