mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-10 16:54:38 -04:00
Merge pull request #4593 from Growstuff/planting-photos
Try planting filtering
This commit is contained in:
@@ -118,6 +118,8 @@ class PhotosController < ApplicationController
|
||||
{ crops: @crop.id }
|
||||
elsif params[:planting_id]
|
||||
{ planting_id: @planting.id }
|
||||
elsif params[:planting_slug]
|
||||
{ plantings: @planting.id }
|
||||
else
|
||||
{}
|
||||
end
|
||||
@@ -126,5 +128,6 @@ class PhotosController < ApplicationController
|
||||
def set_crop_and_planting
|
||||
@crop = Crop.find params[:crop_slug] if params[:crop_slug]
|
||||
@planting = Planting.find params[:planting_id] if params[:planting_id]
|
||||
@planting ||= Planting.find params[:planting_slug] if params[:planting_slug]
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user