bazz
2010-Oct-13 02:56 UTC
Using Ajax (Prototype) to Update Form fields + Resulting page Simultaneously
Ok, so I found a good example online that does what I want to do. On Youtube, if you view a video that you own, there''s a button available "EDIT DETAILS" and upon clicking that it makes the Title and Description Editable text fields. I''d like to make an update button on a posts page I have and have the same thing occur, the title and content become text fields which can then be saved. I just have no idea how to do it though. Any help is greatly appreciated! -Bazz -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ram
2010-Oct-13 08:47 UTC
Re: Using Ajax (Prototype) to Update Form fields + Resulting page Simultaneously
Hi Bazz, You can try having a hidden edit form for the model on the same page, say with the div id of "form". On clicking the "Edit Details" link, use JS to hide the current div and display the "form" div instead. This div will have the complete form which will submit via AJAX. This is if you would like to have your own solution. Alternatively, you could use the in_place_editor for Rails - http://github.com/rails/in_place_editing . Good luck! On Oct 13, 7:56 am, bazz <mbazzino...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Ok, so I found a good example online that does what I want to do. > On Youtube, if you view a video that you own, there''s a button > available "EDIT DETAILS" and upon clicking that it makes the Title and > Description Editable text fields. > > I''d like to make an update button on a posts page I have and have the > same thing occur, the title and content become text fields which can > then be saved. I just have no idea how to do it though. Any help is > greatly appreciated! > > -Bazz-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
bazz
2010-Oct-14 02:34 UTC
Re: Using Ajax (Prototype) to Update Form fields + Resulting page Simultaneously
Thanks for the help Ram!! I''m going to try to implement this when I have some time. I''ll let you know how it goes :) On Oct 13, 4:47 am, Ram <yourstruly.vi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi Bazz, > > You can try having a hidden edit form for the model on the same page, > say with the div id of "form". On clicking the "Edit Details" link, > use JS to hide the current div and display the "form" div instead. > This div will have the complete form which will submit via AJAX. This > is if you would like to have your own solution. > > Alternatively, you could use the in_place_editor for Rails -http://github.com/rails/in_place_editing. > > Good luck! > > On Oct 13, 7:56 am, bazz <mbazzino...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Ok, so I found a good example online that does what I want to do. > > On Youtube, if you view a video that you own, there''s a button > > available "EDIT DETAILS" and upon clicking that it makes the Title and > > Description Editable text fields. > > > I''d like to make an update button on a posts page I have and have the > > same thing occur, the title and content become text fields which can > > then be saved. I just have no idea how to do it though. Any help is > > greatly appreciated! > > > -Bazz-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.