I have the following controller code
respond_with(@employees) do |format|
format.json { render :json => @employees.to_json(:include => :shifts) }
end
What do i have to do if i want to filter the shifts which are included? For example by a date.
I have to be able to set the filter parameters in the controller.
Edit:
I thought about using :method but it creates another variable in the json object. It has to be called “shifts”
1 Answer