Displaying 20 results from an estimated 500 matches similar to: "validating presence of a tag"
2006 Jul 16
0
Problems with validates_lenght_of
I''m building a login system, and I want users to be able to update their
password, first name and last name after signing up. So, when signing up
password can''t be nil, and it must be between 6..20 characters long. However,
on update, the user can choose to leave the password field empty (but fill in
other stuff, like first name) and then I want the User model to not update
2006 Mar 17
0
validations using acts_as_taggable
Can anyone provide me an example of how they are displaying validation
errors when saving a tag using Demetrius''s (not DHH''s) act_as_taggable
plugin?
For example, the tag model has a
:validates_length_of :name, :in => 1..30, :too_long => "Tag name too long -
max 30 characters", :too_short => "Tag must have a name"
If a user inputs a tag longer than
2011 Apr 18
2
acts_as_commentable validations
Hi all,
I recently started back up with Rails and things are going well up until
now.
I''ve set up acts_as_commentable in my Post model and it''s working great.
Problem is users are able to create a "blank" comment. I''ve added the
following validations in the comment.rb file generated by
acts_as_commentable to limit the comment length:
[code]
2012 Aug 14
3
validates_format_of :message not working, validates_length_of :message is working
I''m using validates_format_of and the validation I want to do works, but I
can''t get an error message to be displayed if the data is invalid:
validates_format_of :mobile, :with => /\A[\+0-9]+\Z/, :message => " - Wrong"
I have another validation some where else that does display the error
message: " - Name is too long"
validates_length_of :name,
2006 Dec 01
2
more_like_this not working?
Hi all,
using ferret 0.10.13 and aaf trunk, i cannot get more_like_this to work.
I read other posts on this forum related to that, but that did not solve
it.
I have a model Question with a field question_text. I do:
-----------------------------------------------
>> q = Question.find(:first)
>> q.more_like_this
NoMethodError: You have a nil object when you didn''t expect
2006 Jan 02
1
Dealing with collections of model objects
For an application I''m writing I have a model object, "Answer", many
of which are associated with a "Request" object. A user will need to
answer many questions, each of which is stored in an Answer object
that is associated with their request (Request has many Answers). Is
there an easy way to create and then validate each of these Answer
objects?
I basically want to
2005 Jan 17
5
how to override rails errors messages?
hi,
how can i override rails errors mesages (that are in english) to
display them in an other language?
thanks
hangon
2006 Mar 15
7
Populating text_tag with serialized data
I am using a serialized attribute in one of my models The serialized data is
in the form of an array. I want to have a text_tag for each element
contained in my serialized attribute. How would I construct the text_tag?
My model name is ''questions''. The serialized attribute is "answers"
So I might have:
<% form tag %>
<% text_tag ''question'',
2006 Feb 05
0
validating presence of file uploads
not sure whats going on here, but I''m using some pretty standard code to
manage file uploads in to a db, but having trouble detecting if the file
upload field has been filled or not.
in my Asset Model, I have:
def asset=(asset_field)
self.name = base_part_of(asset_field.original_filename)
self.content_type = asset_field.content_type.chomp
self.data = asset_field.read
end
def
2009 Dec 30
4
Validating the presence of two associated objects from both models
I have a model “Conversation” and a model “Leader”. A Conversation is always led by exactly 1 Leader.
I’ve overridden Conversation’s “validate” method to validate the presence of an associated Leader model.
If I add a similar validation to the Leader model, however, Conversations can no longer be saved on creation because the Leader model is invalid.
On creation of both a new Conversation and
2006 Apr 24
4
Does Rails need more useful form helpers?
I have been using rails professionally for only a month and a half now,
but I am continually running into problems with form helpers and
accessing multiple objects on a single page. To whit:
1. While text_field and text_area and such all support the :index
option, the select helper does not.
2. When appending the text ''[]'' to a helper''s object name, the id is
2006 Jul 29
3
Validating two models
Hi,
I have a model Account wich "has_one" model called UserData. Both models
use validation.
# Model contains user name, email etc.
class Account < ActiveRecord::Base
has_one :user_data, :foreign_key => "user_id"
validates_presence_of :email
end
# Model contains firstname, lastname etc.
class UserData < ActiveRecord::Base
2006 May 28
3
Validating Foreign Key
Howdy,
I''m a Rails beginner working on my first significant project with RoR.
I''m trying to figure out how to validate a foreign key (you know, make
sure the row actually exists.)
However, validates_associated doesn''t seem to be what I want to use, nor
does it work...
-- BEGIN --
class City < ActiveRecord::Base
has_many :schools
belongs_to :state
2008 Dec 16
3
ApplicationProperties
Hi There,
I was wondering what the appropriate way to use the
applicationproperties.rb model was.
I was hoping to query it to find out which users are developers for my
app and then grant special permissions to them ...
I tried creating something like this:
class ApplicationProperties < ActiveRecord::Base
def facebook_session
@facebook_session ||=
returning
2007 Oct 13
4
Chapter 9
Hello,
I''m currently stunk on this issue for few days and I do not know how
to get it fixed.
The system always raises this error message :
order is closed
and here is my order.rb:
class Order < ActiveRecord::Base
include ActiveMerchant::Billing
before_validation :set_status
attr_protected :id, :customer_ip, :status, :error_message, :updated_at, :created_at
attr_accessor
2007 Jul 18
3
how to combine presence only data sets to one presence/absence table
Problem: I have a Set of samples each with a list of observed species
(presence only).
Data is stored in a excel spreadsheet and the columns (spl) have
different numbers of observations (spcs).
Now I want to organize the data in a species by sample matrix with
presence/absence style in R.
data style (in excel):
spl_A spl_B spl_C
spcs1 spcs1 spcs2
spcs2 spcs3 spcs3
spcs4 spcs5
spcs5
desired
2006 Aug 14
0
Checking element presence in RJS
I need to test whether an element exists before I do some RJS thing to
it. I currently have a small RJS snippet that looks like this:
page << "if $(''foo'') {"
page[''foo''].visual_effect :appear
page << "}"
This would make sense:
if page[''foo'']
page[''foo''].visual_effect :appear
2007 Aug 21
0
Low IRC presence for a bit
Hey all,
I just wanted to let everyone know that I''m going to have a reduced
IRC presence for a while, since I''m in a development crunch and can''t
seem to get much done when I''m on IRC.
I''ll still make sure I go through the lists, and I''ll be on when I
can, but I don''t know how much that will be. So, if you need my
help, use
2007 Apr 18
0
Since harmonics are often accompanied by a temperature rise, thermography can be used to detect evidence of their presence.
Skipped content of type multipart/alternative-------------- next part -----=
---------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 18867 bytes
Desc: not available
Url : http://lists.linux-foundation.org/pipermail/virtualization/attachment=
s/20070408/f3caf0e4/attachment.gif
2007 Dec 18
0
Cisco 7970 BLF/Presence
I have been trying to get the 7970 (running SIP firmware) to display presence information about other extensions. Thus far, I have been unsuccessful. Does anyone have BLF working on the SIP-loaded 7941/7961/7970/7971? I have been using the following as a guide for my work:
http://www.voip-info.org/wiki/view/Asterisk+Presence+for+Cisco+79x1+Phones
I have successfully implemented every step