Re: [Rails] Re: Problem writing to database using form_for

2010-10-06 Thread radhames brito
> I think Jim is querying whether one can access the session variable > from within the model, and even if one can, whether one should. > > Oh i see, well i will test if is available in the model and if possible ill see if there a problem with it. -- You received this message because you are subs

Re: [Rails] Re: Problem writing to database using form_for

2010-10-06 Thread Colin Law
On 6 October 2010 22:07, radhames brito wrote: > > > On Tue, Oct 5, 2010 at 5:43 PM, Jim Burgess wrote: >> >> Radhames Brito wrote: >> > save it in the session hash on validation >> >> Hi, >> >> Thanks for the reply. >> Did I understand you correctly, that you are suggesting setting a >> session

Re: [Rails] Re: Problem writing to database using form_for

2010-10-06 Thread radhames brito
On Tue, Oct 5, 2010 at 5:43 PM, Jim Burgess wrote: > Radhames Brito wrote: > > save it in the session hash on validation > > Hi, > > Thanks for the reply. > Did I understand you correctly, that you are suggesting setting a > session variable in the model (where my validation is taking place) > wh

Re: [Rails] Re: Problem writing to database using form_for

2010-10-06 Thread Luke Cowell
On 2010-10-05, at 10:41 PM, Jim Burgess wrote: > >> validate do |applicant| >> errors.add_to_base("Things must check out!") unless >> applicant.check_things >> end >> >> def before_save >> applicant.non_represented_field = 123456789 >> end >> >> before_save will only be called if your valida

[Rails] Re: Problem writing to database using form_for

2010-10-05 Thread Jim Burgess
> validate do |applicant| > errors.add_to_base("Things must check out!") unless > applicant.check_things > end > > def before_save > applicant.non_represented_field = 123456789 > end > > before_save will only be called if your validations pass, so > non_represented_field will only be assig

[Rails] Re: Problem writing to database using form_for

2010-10-05 Thread Jim Burgess
Radhames Brito wrote: > save it in the session hash on validation Hi, Thanks for the reply. Did I understand you correctly, that you are suggesting setting a session variable in the model (where my validation is taking place) which I can then pass to the controller? I didn't know that that wa