similar to: How to validate in_place_edit updates

Displaying 20 results from an estimated 11000 matches similar to: "How to validate in_place_edit updates"

2006 May 11
2
How do you make in_place_edit fields appear when empty?
Here''s a simple one... When using in_place_edit fields, they don''t appear unless they already have a value. How can I get similar functionality when they are empty? Thanks, Nathan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060511/a98640cf/attachment.html
2006 Jul 16
0
in_place_edit-like functionality in my controller
Hello, I''m trying to extend the functionality of in_place_edit and would like to have a function in my controller that populates methods for requested object/methods (just like in_place_edit does). Here''s some test code I tried to make work (from my controller): def do_some_edit(object, field) logger.info("We are editing") end do_some_edit(:item,
2008 Apr 01
1
in_place_edit
where is the in_place_edit plugin? script/plugin source http://svn......? -- 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
2006 May 31
1
ActiveRecord: When / where to validate data? Tricky question
First of all, thanks for you time. I have kind of a tricky question and wanted to see what you guys thought. ------------------------------------------- Lets say I have this: ------------------------------------------- class Purchase < ActiveRecord::Base validates_numericality_of :some_number, :only_integer => true end ------------------------------------------- Then I do this:
2008 Feb 12
0
Validate all model fields with validates_numericality_of
hi, I have a rather big table and i need to validate every decimal field in the table to make sure its numeric. Can anyone think of the best way to do this or is it even possible? I dont want to write validates_numericality_of: and then each field in the table seperately. JB -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this
2006 Jan 30
1
Either/Or Validation
How would I use validations to ensure I either received a blank value or a ten digit number? If I set validates_length_of :field, :in => 0..10 then that would allow any value in-between. The allow_nil => true option does not seem to work. I''ve also tried using this with some combination of validates_numericality_of but cannot get it to work. Any help would be greatly
2009 Jun 24
2
At my wits end ! Controlling passed in negative values from a form
Hi, I am trying to validate a numeric value passed in from a form, which is saved in a MySQL db as decimal(9,2) Now problem is I need to ensure people don''t enter a form value like -. 003. In my validations, I have a validates_numericality_of check being done. Furthermore, in validate method, I have a check using an if statement such as : ((an_object[n].nil? or an_object[n] < 0) and
2006 May 30
1
Not working validation
Hi there, I have some model classes where I''ve tested successful that validation worked. After some more days of iterations I found that that validation isn''t working anymore. The validation functions are not even called. Example: class Company < ActiveRecord::Base validates_uniqueness_of :name validates_numericality_of :money validates_each :money do |record, attr,
2010 Feb 10
6
validation problems
Hi, there. I have two validations in the model: validates_numericality_of :value, :only_integer=>true, :allow_blank=>true validates_size_of :value, :is=>9, :message=>"must be 5-digit number", :if=>Proc.new{|u| u.value.is_a?(Numeric)} They work as expected except when the :value is character/string like "a" "abc", the second validation will also output
2007 Nov 03
3
Birthdate validation
Hello everyone, I''m almost cracking my head trying to do this birthdate validation. It turns out that I can only accept users with at least 18 years old and I''m trying to validate it writing this code on my user.rb fil at app/ models class User < ActiveRecord::Base validates_presence_of :full_name validates_presence_of :street_address validates_presence_of :city
2006 Jul 11
1
Validating composed_of
Hi, How do I validate a composed_of attribute in my model? I have a product model with: composed_of :price, :class_name => ''Money'', :mapping => %w(cents cents) This maps the price attribute to the Money (http://dist.leetsoft.com/api/money/) class. I want to make sure that the price only contains a price to 2 decimal places i.e. 1.25. This is because if someone enters
2006 Jun 21
3
validation help
I would like to validate a number within a certain range. To first test that a entry is a valid number i use validates_numericality_of :my_number, :message =>''sorry, not a number'' to test if the number is within a certain range i use validates_inclusion of :my_number, :in => min..max, message => ''outside range!'' If the numericality test fails, I
2006 Dec 16
2
Validate some fields only on object creation, not update
I''m having a problem with my User model. Originally I had alot of validation, including this: validates_presence_of :password_confirmation, :password validates_length_of :password, :within => 4..50 validates_confirmation_of :password However, this made it impossible to edit a user without setting his password, which I don''t want. So I tried to isolate the above validations
2006 Aug 14
2
Plugins: Validation Reflection and Client-Side Validation
I''ve just put two plugins on RubyForge. Included below are the READMEs. You can get the plugins at svn://rubyforge.org//var/svn/valirefl/validation_reflection/trunk svn://rubyforge.org//var/svn/clientsidevali/client_side_validation/trunk Michael Validation Reflection ===================== Version 0.2, 2006-08-06 This plugin adds reflective access to validations -
2005 Dec 17
0
bug? saving (valid) updated object results in validation error
Hi! I have an error that I don''t understand. It shouldn''t be happening, according to the documentation! I have a class, defined as below. > class Coupon < ActiveRecord::Base > belongs_to :product > belongs_to :account > validates_presence_of :product > validates_associated :product > validates_presence_of :voucher > validates_presence_of
2006 May 18
1
Touch screen interface?
> Curious if anyone has worked on or knows about a touch-screen application with Rails. I am ramping up work on an accounting application and the suggestion was made for a touch-screen POS interface. I haven''t done any research on this myself yet, but are there any ideas, thoughts, or experiences from the group? > > Thanks, > Nathan > nleach (at) toplineconsulting.com
2006 Jul 08
1
overriding validation messages
I have the following in my model validates_numericality_of :lwind_id When a user submits a non numeric value for the lwind control, the default validaiton message is "Lwind is not a number". I need this to say "Land Window is not a number". I have placed the following in my model validates_numericality_of :lwind_id, :message => "Land Window is not a
2009 Nov 20
3
Ensuring that foreign key is valid
I am trying to set up a validation in a model to ensure that a record can''t be saved unless the foreign key it belongs_to is a valid record. My model says: class Admin < ActiveRecord::Base validates_presence_of :user_id validates_numericality_of :user_id validates_uniqueness_of :user_id validates_associated :user belongs_to :user end but I can still create an admin
2008 May 11
0
validates_numericality_of and greater_than* doesn't appear to be working
I''m using Rails 2.0.2 and I have been trying to take advantage of the "validates_numericality_of" with the ":greater_than" option with something like this: validates_numericality_of :users, :greater_than => 0, :only_integer => true, :allow_nil => true, :message => "The number of allowed users must be a whole number greater than zero." But this
2006 Jun 07
1
Validating numericality based on related attribute value?
I have a price attribute in my model which I need to validate as a positive number if the attribute price_terms.requires_value is equal to ''Y'', otherwise price can be blank or zero. Price_terms is a select list which my model table belongs_to. How do I do this? - I tried doing this: validates_numericality_of :price, :if => self.price_term.requires_value.upcase ==