Re: [Rails] Saving a nested object to a whole collection of objects at once.

2016-10-18 Thread Colin Law
On 18 October 2016 at 15:47, Chris Vukin wrote: > thanks for the heads up, I'll change the methods to use the @plant.farm > > We'd like to apply the same feeding to all plants in a farm.. so maybe > something along the lines of: @farm.plants.feed ? We want to be able to > feed all the plants in t

Re: [Rails] Saving a nested object to a whole collection of objects at once.

2016-10-18 Thread Chris Vukin
thanks for the heads up, I'll change the methods to use the @plant.farm We'd like to apply the same feeding to all plants in a farm.. so maybe something along the lines of: @farm.plants.feed ? We want to be able to feed all the plants in the farm with the same feed(like a saved recipe for a fee

Re: [Rails] Saving a nested object to a whole collection of objects at once.

2016-10-18 Thread Colin Law
On 18 October 2016 at 14:27, Chris Vukin wrote: > thank you for your reply Colin, here's what we're trying to do: > > The app has a farm model and each farm has nested plant models, nested > under each plant is a feeding model. Say a farm has 16 plants, we'd like to > be able to feed all the plan

Re: [Rails] Saving a nested object to a whole collection of objects at once.

2016-10-18 Thread Chris Vukin
thank you for your reply Colin, here's what we're trying to do: The app has a farm model and each farm has nested plant models, nested under each plant is a feeding model. Say a farm has 16 plants, we'd like to be able to feed all the plants at once and not create a new feeding for each plant b

Re: [Rails] associations - one to many

2016-10-18 Thread Chris Lerum
Your line: params.require(:product).permit(:title, :template, :price, :msrp, :enddate) needs to be: params.require(:product).permit(:title, :template, :price, :msrp, :enddate, :category_id) On Tuesday, October 4, 2016 at 3:15:26 PM UTC-4, Joe Guerra wrote: > > Still unsure of what to do... this

Re: [Rails] Saving a nested object to a whole collection of objects at once.

2016-10-18 Thread Colin Law
On 18 October 2016 at 00:29, Chris Vukin wrote: > Hello, I'm wondering about how to accomplish saving the same nested form > on an entire collection of objects that the form is nested under.. I'm not > finding much when googling around, is this something that is possible with > rails? > Could yo