similar to: validate method not getting called?

Displaying 20 results from an estimated 100 matches similar to: "validate method not getting called?"

2006 Jul 18
2
validate method doesn''t recognize another instance method
All, I am attempting to do some custom validation on my object. Here is my validate method: protected def validate puts "Do I have the target_list_ids method? " + self.methods.include?(''target_list_ids'').to_s if target_list_ids.nil? || target_list_ids.length == 0 errors.add_to_base("You must choose at least one target list for this job")
2006 Jul 14
7
Form validation - keepin correct fields displayed on refresh
All, I''m finally doing my first real form in Rails - the model object that I''m entering information for has 8 validations so far. If I type in good values for all the fields but one, I get the pretty validation, and the nice field highlighting, but all of the fields are cleared, forcing me to retype all of that info. That is a big drag. Is there a standard way to get the
2006 May 05
1
ActionMailer with attachments, body is blank
I am trying to use the Rails Recipe for sending emails with attachments. However, when I add an attachment, my body fails to render. The resulting email has the attachment, but is blank otherwise. In the book, it mentions that this is "broken" in rails 1.0 and to upgrade to a newer version or edge rails. Well, I am running on 1.1.2 and it''s still happening. When I look
2006 Jul 11
4
checkboxes with a has_many :through relation
All, I''m populating a view with checkboxes in a list. I want to be able to assign to my has_many relationship using the post values of these checkboxes. Essentially, I want to populate the relationship table which will create the correct join values in my model. Here is my check_box_tag code: <%= check_box_tag("@current_job[target_list_ids][]",
2006 Jul 12
0
What is the best way to override an _entire_ AR::Errors msg?
All, I have an error message that I would like to be more readable, since my column name doesn''t look good. I want to change the output of validates_presence_of :eSubject from Esubject can''t be blank to Subject can''t be blank Do I have to go through aliasing the whole eSubject column in the AR class or is there an easier way to just modify the "field
2006 Jul 12
0
Give form elements "fieldWithErrors" class in non-std. way?
All, I want to know how to force an element of my model to be invalid, but not generate any message for it, so that the corresponding form field on a form will show up with the ''fieldWithErrors'' class. I have some checkboxes on my RHTML form, and they are generated with this code <%= check_box_tag("current_job[target_list_ids][]"...etc. %> target_list_ids
2006 Mar 09
1
ActionMailer Question -- can''t find email templates
I have a PageController that displays a form. The form is just straight HTML, I only used the form helpers for the form tag as so: -- <%= form_tag({:action => :send_request}, {:method=>:post, :name=>''childsplay''})%> -- In my page controller I have this: -- def send_request email = InfoMailer::deliver_sendrequest(params) end --- in my action mailer class I
2020 Jun 19
2
SegFault when using TunnelServer=yes
Hi all, I have a network with about ~800. The network is a mix of tinc 1.0 and 1.1 nodes. It is gradually expanding for several years now. The problem is that at some point it seams the daemon can not handle the processing of the new connection and the edges. There are 3 major nodes in the system and every other node initially makes connection to one of them. Now after a lot of debugging
2008 Jan 18
0
ApnaCircle Invite for Online Social and Professional Networking Site
[1]ApnaCircle.com Online Social & Professional Networking Site [2]Make Freinds Earn Rewards [3]ApnaCircle.com gives you a valuable platform to make friends & professional contacts for mutual benefit. And you get points for joining ApnaCircle & redeem points against
2006 Jul 05
1
TMail + Receing mail and extract attachments
Hi guys, I have a hard time with action mailer and TMail, I always get the following error... My code: << pop = Net::POP3.new(''pop.mydomain.com'') pop.start(''xxx'', ''xxxxx'') # (1) if pop.mails.empty? puts ''No mail.'' else i = 0 pop.each_mail do |m| # or "pop.mails.each
2020 Jul 27
3
SegFault when using TunnelServer=yes
Hi, thank for getting back. I'll answer the questions, but I've already gave up on tinc and switch to zerotier-one. On 2020-07-27 5:10 p.m., borg at uu3.net wrote: > Hi. I have few questions out of curiosity.. Cant help for now with > your problem... > > What version is crashing? 1.1 or 1.0 ? 1.1 is crashing > > How your network is segmented..? > I use tinc myself
2020 Jul 27
0
SegFault when using TunnelServer=yes
Hi. I have few questions out of curiosity.. Cant help for now with your problem... What version is crashing? 1.1 or 1.0 ? How your network is segmented..? I use tinc myself here a lot too (1.0) but my network is very segmented. I use switch mode and handle routing myself, so mesh links arent large.. I would NOT go beyond 30 nodes for full auto-mesh.. its already like 435 edges... Regards,
2006 Jun 27
3
belongs_to <parent name>, :foreign_key modifier not working
All, I have two ActiveRecord objects. TargetList has_many Targets Targets belongs_to TargetList I''ve specified belongs_to :target_list, :foreign_key => ''DataSetID'' Queries generated by various methods in target_list do not seem to see the foreign_key name and keep trying to query my Target table using "target_list_id" (the default foreign
2020 Jul 28
0
SegFault when using TunnelServer=yes
Thanks for answers. I think its now flaw.. but design.. Tinc auto-mesh is very very handy. You just need to avoid flat networks. There is also IndirectMode w/ forces nodes to be switched by intermediate node... but I would be cautionus how its used. I use it myself for certain nodes behind NATs where they cannot be connected to, so always connect node handles switching for them. You noticed it
2008 Jul 02
1
Data editor duplicates pairs of backslashes (PR#11897)
Full_Name: Magnus Torfason Version: 2.7.0 OS: Windows Vista Submission from: (NULL) (128.59.140.167) Each time a string is edited in the data editor (on Windows at least), any pairs of backslashes (an escaped backslash) are duplicated on each edit of the string. Note that one must actually double click the value for the bug to show up. Behavior/Replication: > # Create data frame >
2006 Apr 07
2
errors.add_to_base
What are the limitations on using: errors.add_to_base to display errors in views? I have tried for days to add errors from my object.rb and they never get displayed. class Keyword < ActiveRecord::Base validates_presence_of(:name, :message => "Name is required.") validates_uniqueness_of(:name, :message => "This name is already in use. Please try
2009 Dec 21
0
errors.add_to_base translation missing: en, activerecord
In my model I am using errors.add_to_base: errors.add_to_base "Error 1" This works fine. If I do this twice: errors.add_to_base "Error 1" errors.add_to_base "Error 2" I receive the message: translation missing: en, activerecord, errors, models, modelname, attributes, base, as part of my error messages. Anyone know how to get rid of this? Many thanks, Mike
2010 Apr 29
1
Setting a message on a model -without- errors.add_to_base
I''m trying my best to follow the skinny controller/fat model concept, and I''ve got a series of callbacks (that I''m about to move into observers) running on a few models. Based on what these callbacks do to the data (it''s implementing business rules), I''d like to add some type of message on the state of the model *without* invalidating it. For example:
2006 Aug 14
2
after_create is not being called
Hi all I have the following model: class PhotoGallery < ActiveRecord::Base attr_accessible :title, :description, :file_path, :title_photo_id has_many :photos, :dependent => :destroy belongs_to :title_photo, :class_name => ''Photo'', :foreign_key => ''title_photo_id'' validates_presence_of :title, :description, :file_path
2006 May 02
1
Custom error messages
On a model I have the following simple validator: def validate unless name && name =~ /^\w+$/ errors.add_to_base("Name is missing") end end I would like to display a custom message on my views, without using the helper <%= error_messages_for "table" %> Where the messages from errors.add_to_base are stored and how to access them in the views? --