Re: [Rails] undefined method `build_

2016-01-02 Thread fugee ohu
On Saturday, January 2, 2016 at 7:38:13 PM UTC-5, James Jelinek wrote: > > If a user has many schools you would want > > current_user.schools.new(school_params) > > Unfortunately I don't know how your associations are setup so I'm taking a > guess at this. 👍🏻 > > On Jan 2, 2016, at 6:32 PM, fugee

Re: [Rails] undefined method `build_

2016-01-02 Thread fugee ohu
that's a reference to the new action, i'm asking about the create action where create_association is used, not build_association On Saturday, January 2, 2016 at 7:38:13 PM UTC-5, James Jelinek wrote: > > If a user has many schools you would want > > current_user.schools.new(school_params) > > Unf

Re: [Rails] undefined method `build_

2016-01-02 Thread fugee ohu
On Saturday, January 2, 2016 at 7:38:13 PM UTC-5, James Jelinek wrote: > > If a user has many schools you would want > > current_user.schools.new(school_params) > > Unfortunately I don't know how your associations are setup so I'm taking a > guess at this. 👍🏻 > > On Jan 2, 2016, at 6:32 PM, fugee

Re: [Rails] undefined method `build_

2016-01-02 Thread fugee ohu
On Saturday, January 2, 2016 at 7:38:13 PM UTC-5, James Jelinek wrote: > > If a user has many schools you would want > > current_user.schools.new(school_params) > > Unfortunately I don't know how your associations are setup so I'm taking a > guess at this. 👍🏻 > > On Jan 2, 2016, at 6:32 PM, fugee

Re: [Rails] undefined method `build_

2016-01-02 Thread jelinek
If a user has many schools you would want current_user.schools.new(school_params) Unfortunately I don't know how your associations are setup so I'm taking a guess at this. 👍🏻 > On Jan 2, 2016, at 6:32 PM, fugee ohu wrote: > > what should the create action be > @school = current_user.crea

Re: [Rails] undefined method `build_

2016-01-02 Thread fugee ohu
what should the create action be @school = current_user.create_school(school_params) On Saturday, January 2, 2016 at 4:45:20 PM UTC-5, Colin Law wrote: > > On 2 January 2016 at 20:51, fugee ohu > > wrote: > > def create > > @school = current_user.build_school(school_params) > > >

Re: [Rails] undefined method `build_

2016-01-02 Thread fugee ohu
what should the create action be? i tried @school = current_user.build_school(school_params) On Saturday, January 2, 2016 at 4:45:20 PM UTC-5, Colin Law wrote: > > On 2 January 2016 at 20:51, fugee ohu > > wrote: > > def create > > @school = current_user.build_school(school_params)

Re: [Rails] undefined method `build_

2016-01-02 Thread fugee ohu
Sorry Colin I fell asleep Here's how I worked it out <%= form_for(@school) do |school_form| %> <% school_form.fields_for :profiles do |f| %> On Saturday, January 2, 2016 at 4:45:20 PM UTC-5, Colin Law wrote: > > On 2 January 2016 at 20:51, fugee ohu > > wrote: > > def create > > @school

Re: [Rails] undefined method `build_

2016-01-02 Thread jelinek
No, you've mentioned top posting and your dislike of it countless times. 🌶 > On Jan 2, 2016, at 4:38 PM, Colin Law wrote: > >> On 2 January 2016 at 22:21, wrote: >> Why not kindly pointing out the error and offer a suggestion to assist the >> OP instead? > > Because one learns more by workin

Re: [Rails] undefined method `build_

2016-01-02 Thread Colin Law
On 2 January 2016 at 22:21, wrote: > Why not kindly pointing out the error and offer a suggestion to assist the OP > instead? Because one learns more by working out the error for oneself. If the OP goes and looks at the documentation that he thought said that he should be able to do this then

Re: [Rails] undefined method `build_

2016-01-02 Thread jelinek
Why not kindly pointing out the error and offer a suggestion to assist the OP instead? Yes. I'm top posting. > On Jan 2, 2016, at 3:44 PM, Colin Law wrote: > >> On 2 January 2016 at 20:51, fugee ohu wrote: >> def create >>@school = current_user.build_school(school_params) >> >> causes

Re: [Rails] undefined method `build_

2016-01-02 Thread Colin Law
On 2 January 2016 at 20:51, fugee ohu wrote: > def create > @school = current_user.build_school(school_params) > > causes the above error my models are users has_one profile, profile has_many > schools, profile belongs_to user, school belongs_to profile What makes you think that current_use

[Rails] undefined method `build_

2016-01-02 Thread fugee ohu
def create @school = current_user.build_school(school_params) causes the above error my models are users has_one profile, profile has_many schools, profile belongs_to user, school belongs_to profile -- You received this message because you are subscribed to the Google Groups "Ruby on Rai