i''ve got an in place edit text box for some of my fields. my model has validates_presence_of for the field but nothing happens. it works fine in the scaffold when using the edit page, but nowhere else. anyone have a solution to this? -- Posted via http://www.ruby-forum.com/.
There was no reply to this question but it must be a common requirement. Is there a good solution? How would one get a validates_*** from the model to apply when using in_place_edit_for? -- Brian On 3/31/06, Josh Kieschnick <jjkiesch@gmail.com> wrote:> > i''ve got an in place edit text box for some of my fields. my model has > validates_presence_of for the field but nothing happens. it works fine > in the scaffold when using the edit page, but nowhere else. > > anyone have a solution to this? > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Brian K. Buckley briankbuckley@gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060624/437c8846/attachment.html
The In_place_editor still uses the callbacks like before_update, so maybe your could force your validation requirements to fire that way. -- Timothy Johnson On Jun 24, 2006, at 7:55 PM, Brian Buckley wrote:> There was no reply to this question but it must be a common > requirement. Is > there a good solution? > > How would one get a validates_*** from the model to apply when using > in_place_edit_for? > > -- Brian > > > On 3/31/06, Josh Kieschnick <jjkiesch@gmail.com> wrote: >> >> i''ve got an in place edit text box for some of my fields. my model has >> validates_presence_of for the field but nothing happens. it works fine >> in the scaffold when using the edit page, but nowhere else. >> >> anyone have a solution to this? >> >> -- >> Posted via http://www.ruby-forum.com/. >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> > > > > -- > Brian K. Buckley > briankbuckley@gmail.com > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
I''ve just created a custom in_place_edit that validates the model and display the error message in javascript alert box. http://www.pluitsolutions.com/2007/03/20/custom-in_place_edit-with-validation/ Herryanto Siatono -- 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 -~----------~----~----~----~------~----~------~--~---
Hi, I followed the above link and try using that link, but i am not getting any alert box, and still its taking the blank one in to the database, SO wat should i do for this??? -- 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 -~----------~----~----~----~------~----~------~--~---
Naga harish Kanegolla wrote:> Hi, > I followed the above link and try using that link, but i am not getting > any alert box, and still its taking the blank one in to the database, SO > wat should i do for this???Hey naga, I forgot to mention that you''ll need to restart your mongrel server. Did you do that? -- 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 -~----------~----~----~----~------~----~------~--~---
Hi, I restarted the server, but till i am not getting, later i added the validates_presence_of :name then it worked for me, I got the alert box saying that it shouldn''t be blank, so its working, but wen i try to edit by not giving blank with another value, then also its giving an alert box that it shouldn''t be blank, and am even not able to add a new one, so wat should i do for this?? -- 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 -~----------~----~----~----~------~----~------~--~---
Naga harish Kanegolla wrote:> Hi, > I restarted the server, but till i am not getting, later i added the > validates_presence_of :name then it worked for me, I got the alert box > saying that it shouldn''t be blank, so its working, but wen i try to edit > by not giving blank with another value, then also its giving an alert > box that it shouldn''t be blank, and am even not able to add a new one, > so wat should i do for this??Naga, I''m not sure what went wrong though, it''s a bit hard to know without looking at the codes. Use firebug, check out the Ajax request generated, put a print statement in your codes, look at the log files, you probably would be able to see something helpful. -- 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 -~----------~----~----~----~------~----~------~--~---
Hi, Thanks a lot, its working fine , i am sorry that i have given the wrong column name for validates_presence_of in the model,its good, and every body liked that, and i would ask u one more thing, is there any alert box custom code for validating the Ajax form, like if i click a link an ajax form appears and if i give a blank and submit its not taking the value in the database but i should get an alert saying that it is blank, Thanks in Advance, Harish -- 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 -~----------~----~----~----~------~----~------~--~---
Laurynas, Please add append the following lines to custom_in_place_editing.rb, I updated the code snippet yesterday to fix caching issue on Rails 1.2, which causes the entry to be blank, after the error message alert. But I forgot to copy a few lines below. ActionController::Base.class_eval do include ActionController::Macros::CustomInPlaceEditing end Harris, I''m not sure what you meant though, sorry. -- 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 -~----------~----~----~----~------~----~------~--~---
laurynas.butkus-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Apr-01 10:50 UTC
Re: validation with in_place_edit_for
Herryanto, thanks a lot for a quick reply! Now it works fine. Laurynas On 1 Apr, 09:07, Herryanto Siatono <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Laurynas, > > Please add append the following lines to custom_in_place_editing.rb, I > updated the code snippet yesterday to fix caching issue on Rails 1.2, > which causes the entry to be blank, after the error message alert. But I > forgot to copy a few lines below. > > ActionController::Base.class_eval do > include ActionController::Macros::CustomInPlaceEditing > end > > Harris, I''m not sure what you meant though, sorry. > > -- > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---
laurynas.butkus-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Apr-01 11:22 UTC
Re: validation with in_place_edit_for
Maybe I replied too quickly :) Now I noticed, that I''m getting "undefined method ''query_cache''" exception if validation fails. If I comment out "object.to_s.camelize.constantize.query_cache.clear_query_cache", I get correct validator error message, but then blank value is shown. That''s on Rails 1.2.3. Laurynas On 1 Apr, 09:07, Herryanto Siatono <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Laurynas, > > Please add append the following lines to custom_in_place_editing.rb, I > updated the code snippet yesterday to fix caching issue on Rails 1.2, > which causes the entry to be blank, after the error message alert. But I > forgot to copy a few lines below. > > ActionController::Base.class_eval do > include ActionController::Macros::CustomInPlaceEditing > end > > Harris, I''m not sure what you meant though, sorry. > > -- > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---
Laurynas, I forgot that I''m using RailsOnEdge. You are right, there''s no query_cache in rails 1.2.3. I''ve applied the patch to handle that. Please re-copied the source codes from the same place: http://www.pluitsolutions.com/2007/03/20/custom-in_place_edit-with-validation/ Sorry for the confusion, and thanks for reporting that. -- 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 -~----------~----~----~----~------~----~------~--~---
laurynas.butkus-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Apr-01 19:38 UTC
Re: validation with in_place_edit_for
Herryanto, after first test everything looks ok. Thanks again! Laurynas On Apr 1, 7:13 pm, Herryanto Siatono <rails-mailing-l...@andreas- s.net> wrote:> Laurynas, > > I forgot that I''m using RailsOnEdge. You are right, there''s no > query_cache in rails 1.2.3. I''ve applied the patch to handle that. > > Please re-copied the source codes from the same place:http://www.pluitsolutions.com/2007/03/20/custom-in_place_edit-with-va... > > Sorry for the confusion, and thanks for reporting that. > > -- > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---