I have a link_to_remote that when clicked will put a form in a div and there are three such links. The problem taht I having is that when this form is placed with the div and the submit botton is hit, the method gets called but as soon as the program reached the @user.save line nothing happens. In other words, there is no reason why the user submitte dinto should not be saved; I have done this hundreds of times in this project, but for whatever reason, it will not save. Here is the if statement that should be executed (in submit_delivery): if @user.save redirect_to :action => ''edit_traveler_form'', :id => @user.id end and here is the code that renders the form in the div (in set_delivery): render :partial => ''editor_for_home'' , :delivery => ''home'' Here is the link_to_remote: <%= link_to_remote ''Home'', :url => { :action => ''set_delivery'', :id => @user.id, :delivery => ''home'' }, :update => ''all'' %> and finally, the form tag: <% form_tag :action => ''submit_delivery'', :id => @user.id, :delivery => params[:delivery] do -%> Just wondering if the form isn''t working because it is a link_to_remote? Thanks, ~S -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Shandy Nantz wrote:> if @user.savePut on bang a: @user.save! Then run it and look at your log? -- Phlip http://www.oreilly.com/catalog/9780596510657/ ^ assert_xpath http://tinyurl.com/yrc77g <-- assert_latest Model --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Phlip wrote:> Shandy Nantz wrote: > >> if @user.save > > Put on bang a: @user.save! > > Then run it and look at your log? > > -- > Phlip > http://www.oreilly.com/catalog/9780596510657/ > ^ assert_xpath > http://tinyurl.com/yrc77g <-- assert_latest ModelI try and do that and I get: Validation failed: Password <b style = "color:red">Password to short (Must be 5 characters long)</b>, Password <b style = "color:red">Password must be alphanumeric</b> The funny thing is, is that this is in a part of the form that''s not dealing with the password. Now do have these lines of code in my user controller: validates_format_of :password, :with => /^\w+$/, :message => ''<b style "color:red">Password must be alphanumeric</b>'' validates_length_of :password, :minimum => 5, :message => ''<b style "color:red">Password to short (Must be 5 characters long)</b>'' Not sure what''s going on? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Shandy Nantz wrote:> if @user.saveWhat''s the line above this? How do you know @user is the same as the @user in the form? (Recall that Rails effectively stopped and restarted between sending a view and collecting its responding actions.) if your @user is not the same as the one indicated by params[:id], then it has no password... -- Phlip http://www.oreilly.com/catalog/9780596510657/ ^ assert_xpath http://tinyurl.com/yrc77g <-- assert_latest Model --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hey, I''m trying to create AJAX website with Rails. I ran into the following problem: I want to add a Song to my database. There is this _form.rhtml where I can edit all Song''s attributes. Then I can click ''Create'' and I''m done. I want to switch this to AJAX. I thought about using form_remote_tag, but it seems insufficient to me. One of Song''s attributes is a list of lyrics authors. I edit this list as follows: you can enter new author in a text field and press ''Add'' or you can click ''Remove'' on any of existing authors. Unfortunately, to implement this I''d have to use another remote form and I would land with nested <form> tags, which is prohibited. So... I think that maybe I could use link_to_remote or remote_function, but... I would somehow have to pull out text field values and send them as parameters of the link_to_remote. Can I do that? And how? Thanks, Mike --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
you can change form action to different by javascript.. with : link_to "button", "#", :onclick = "document.forms.myform.action = ''/ new/action'';" OR if i am lost something: you have Song.authors model ? you can pass: hidden_field "song", "authors[]", @song.authors in this way ^. On 5 , 22:27, jasiu85 <jasi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hey, > > I''m trying to create AJAX website with Rails. I ran into the following > problem: > > I want to add a Song to my database. There is this _form.rhtml where I > can edit all Song''s attributes. Then I can click ''Create'' and I''m > done. I want to switch this to AJAX. I thought about using > form_remote_tag, but it seems insufficient to me. One of Song''s > attributes is a list of lyrics authors. I edit this list as follows: > you can enter new author in a text field and press ''Add'' or you can > click ''Remove'' on any of existing authors. Unfortunately, to implement > this I''d have to use another remote form and I would land with nested > <form> tags, which is prohibited. So... I think that maybe I could use > link_to_remote or remote_function, but... I would somehow have to pull > out text field values and send them as parameters of the > link_to_remote. Can I do that? And how? > > Thanks, > > Mike--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hmm, maybe my description was too complicated... I need this: I have an <input type="text" id="some_id"> in my page and I want to include it''s value in an XML-RPC call performed by link_to_remote. How can I do that? Regards, Mike On 6 Wrz, 00:14, "alexey.Creopolis" <alex.creopo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> you can change form action to different by javascript.. > > with : > link_to "button", "#", :onclick = "document.forms.myform.action = ''/ > new/action'';" > > OR if i am lost something: > you have Song.authors model ? > you can pass: > hidden_field "song", "authors[]", @song.authors > in this way ^. > > On 5 , 22:27, jasiu85 <jasi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hey, > > > I''m trying to create AJAX website with Rails. I ran into the following > > problem: > > > I want to add a Song to my database. There is this _form.rhtml where I > > can edit all Song''s attributes. Then I can click ''Create'' and I''m > > done. I want to switch this to AJAX. I thought about using > > form_remote_tag, but it seems insufficient to me. One of Song''s > > attributes is a list of lyrics authors. I edit this list as follows: > > you can enter new author in a text field and press ''Add'' or you can > > click ''Remove'' on any of existing authors. Unfortunately, to implement > > this I''d have to use another remote form and I would land with nested > > <form> tags, which is prohibited. So... I think that maybe I could use > > link_to_remote or remote_function, but... I would somehow have to pull > > out text field values and send them as parameters of the > > link_to_remote. Can I do that? And how? > > > Thanks, > > > Mike--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---