[Rails] Re: Ajax in RoR - observe_field

2009-10-30 Thread Misiek Sz
I created clean new app to test and poke around. I got to work, but I wonder if there is still a better way to handle it and someone could point it our. So i have two models: class Project ActiveRecord::Base has_one :task end class Widget ActiveRecord::Base belongs_to :project

[Rails] Re: Ajax in RoR - observe_field

2009-10-29 Thread Leonardo Mateo
On Thu, Oct 29, 2009 at 2:23 AM, Misiek Sz rails-mailing-l...@andreas-s.net wrote: Leonardo Mateo wrote: On Sun, Oct 25, 2009 at 3:23 PM, Misiek Sz rails-mailing-l...@andreas-s.net wrote: saved when the form is submitted? OK, now the situation is clearer for me. There's something you're not

[Rails] Re: Ajax in RoR - observe_field

2009-10-29 Thread Misiek Sz
I totally get what you are saying. But in practice its not as easy. So when you say So you need to modify your view to accomplish this. You mean in my view of student information include a hidden field with name education_plan[student_id] or there is a way to set the params (in students for

[Rails] Re: Ajax in RoR - observe_field

2009-10-28 Thread Misiek Sz
Leonardo Mateo wrote: On Sun, Oct 25, 2009 at 3:23 PM, Misiek Sz rails-mailing-l...@andreas-s.net wrote: saved when the form is submitted? OK, now the situation is clearer for me. There's something you're not getting from associations, let's see if with the example you get it more clear.

[Rails] Re: Ajax in RoR - observe_field

2009-10-25 Thread Misiek Sz
Leonardo Mateo wrote: On Sat, Oct 24, 2009 at 7:09 PM, Misiek Sz rails-mailing-l...@andreas-s.net wrote: made to the get_student_info method where student info is pulled and �tr � �%= observe_field(:st_id, :frequency = 0.25, :update = � �td%= f.label :service_code %/td EducationPlan

[Rails] Re: Ajax in RoR - observe_field

2009-10-25 Thread Marnen Laibow-Koser
Misiek Sz wrote: [...] Thanks. Why is it nil if the method is part of the controller? Because you haven't assigned a value to @education_plan ! This doesn't happen automatically. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/.

[Rails] Re: Ajax in RoR - observe_field

2009-10-25 Thread Leonardo Mateo
On Sun, Oct 25, 2009 at 2:11 PM, Misiek Sz rails-mailing-l...@andreas-s.net wrote: Leonardo Mateo wrote: On Sat, Oct 24, 2009 at 7:09 PM, Misiek Sz rails-mailing-l...@andreas-s.net wrote: made to the get_student_info method where student info is pulled and �tr � �%= observe_field(:st_id,

[Rails] Re: Ajax in RoR - observe_field

2009-10-25 Thread Leonardo Mateo
On Sun, Oct 25, 2009 at 2:33 PM, Marnen Laibow-Koser rails-mailing-l...@andreas-s.net wrote: Misiek Sz wrote: [...] Thanks. Why is it nil if the method is part of the controller? Because you haven't assigned a value to @education_plan !  This doesn't happen automatically. Yes, this looks

[Rails] Re: Ajax in RoR - observe_field

2009-10-25 Thread Misiek Sz
THank you for helping me out. So, I went through association guide, but still I can't get it to work. My concept is this. Display a form to create a new EducationPLan. On the form have a text box and when the value is entered it doesn't create an association yet, but returns student record(if

[Rails] Re: Ajax in RoR - observe_field

2009-10-25 Thread Leonardo Mateo
On Sun, Oct 25, 2009 at 3:23 PM, Misiek Sz rails-mailing-l...@andreas-s.net wrote: THank you for helping me out. So, I went through association guide, but still I can't get it to work. My concept is this. Display a form to create a new EducationPLan. On the form have a text box and when the

[Rails] Re: Ajax in RoR - observe_field

2009-10-24 Thread Leonardo Mateo
On Sat, Oct 24, 2009 at 7:09 PM, Misiek Sz rails-mailing-l...@andreas-s.net wrote: Hey, I'm trying to achieve something relatively simple and missing something that is probably very simple, which I'm loosing my head over. My situation is the following: I have two tables: -education_plans