[Rails] Re: Select in partial not behaving

2009-04-12 Thread Ram
Sure.. lets take this outside! ;) It'll help if you send me the code with the flow for one action that works and one that doesnt. no promises :). On Apr 13, 10:10 am, Chris Habgood wrote: > Ok, you asked what a mop was. > > ajaxAddtoMop just makes the association between the contact and form th

[Rails] Re: Select in partial not behaving

2009-04-12 Thread Chris Habgood
Ok, you asked what a mop was. ajaxAddtoMop just makes the association between the contact and form then updates the select removing the user from the select box. I have quite a few rjs and partials to make the full CRUD operations working ajax wise inline in the form. I can go offline if you re

[Rails] Re: Select in partial not behaving

2009-04-12 Thread Ram
I meant the flow of control in the code. >From the view to the controller action, to the RJS and back to the view. I dont see a call to ajaxAddToMop. What are the names of the files with the RJS and the select_box? >if I do a delete or if I remove the >contact from the form I also do a replace li

[Rails] Re: Select in partial not behaving

2009-04-12 Thread Chris Habgood
Well it is a telecom thing. If you perform maintenance on equipment then you need a form explaining what to do and how to do it. Anyway, the partial gives me a "prompt" if I do a delete or if I remove the contact from the form I also do a replace like on an New contact and it does give me a promp

[Rails] Re: Select in partial not behaving

2009-04-12 Thread Ram
Not able to understand the flow of control. What is mop? Could you explain a bit further? This is interesting.. On Apr 12, 3:13 am, Me wrote: > Ok this is weird, I have full CRUD working for my contacts table all > doing ajax inline in my form.  the odd one is that my delete funtion > uses the s

[Rails] Re: Select in partial not behaving

2009-04-11 Thread Me
Ok this is weird, I have full CRUD working for my contacts table all doing ajax inline in my form. the odd one is that my delete funtion uses the same partial as the one above and when I do the rjs for the update on the select it DOES give me the "Prompt" to select User. Delete is the only one th

[Rails] Re: Select in partial not behaving

2009-04-11 Thread Chris Habgood
OK, I used the ID of the select and did a replace: RJS: page[:showcontact].hide page[:contactlist].show page.insert_html :bottom,'contactlist', :partial => 'ajaxAddToMop', :locals => {:contact => @contact } page[:contact_id].replace :partial => "updateContactList", :locals => {:contacts => @conta

[Rails] Re: Select in partial not behaving

2009-04-11 Thread Jaryl Sim
Hmm, hope you can post up more code, even from your controller as well. I think that instead of replacing the entire select tag, you can simply replace its contents. Firstly, give the select tag an id so that in your RJS, you can replace_html with options_for_select or whatever function you might

[Rails] Re: Select in partial not behaving

2009-04-10 Thread Chris Habgood
Ok, that select I put is the only thing in the partial. Here is the rjs: page[:contact_list].replace_html :partial => 'updateContactList', :locals => { :contact => @contact } On Fri, Apr 10, 2009 at 6:58 PM, Phlip wrote: > > Me wrote: > > I have this select in a form: > > <%= select('contact', '

[Rails] Re: Select in partial not behaving

2009-04-10 Thread Phlip
Me wrote: > I have this select in a form: > <%= select('contact', 'id', @contacts, {:prompt => 'Select Contact'} , > { :onchange => remote_function(:url => { :controller => > 'contacts', :action => "ajaxshowcontact", :id => @mop.id}, :with => > "'contactid=' + this.value" ) > } ) %> > > The