Google Groups Home
Help | Sign in
validating when form labels don't match table fields
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Mike Poirier  
View profile
 More options Dec 31 2006, 10:56 pm
From: "Mike Poirier" <mike.poir...@gmail.com>
Date: Sun, 31 Dec 2006 22:56:37 -0500
Local: Sun, Dec 31 2006 10:56 pm
Subject: validating when form labels don't match table fields

Hi,

I have a model where the attribute names don't match exactly what I'd
like to use for labels for the input s on my view.  For example, my
model order has an attribute "ordered_by_first_name" and I'd like the
label on the view to be "Your first name".  Fine.  Except that if I use
really nice validation helpers I can't fully override the error
message.  I can use :message but it always sticks in the model
attribute name.  This will cause some confusion and I was hoping to
make things a little more user friendly on the view.

My order model has other attributes that refer to people's names in
them (no, I'm not entirely normalized).

I guess it goes without saying that I was hoping to use
error_messages_for in the view.

Anyone have any suggestions for when the model names don't match what
you'd want to present to a user?

TIA,
Mike


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dan Manges  
View profile
 More options Jan 1 2007, 12:46 pm
From: "Dan Manges" <daniel.man...@gmail.com>
Date: Mon, 01 Jan 2007 17:46:18 -0000
Local: Mon, Jan 1 2007 12:46 pm
Subject: Re: validating when form labels don't match table fields

Mike Poirier wrote:
> Anyone have any suggestions for when the model names don't match what
> you'd want to present to a user?

If you use a custom validation you can use:
self.errors.add_to_base("full message") to specify a full message.  I
am not sure how to override the attribute name for the default error
messages.

Dan Manges


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike  
View profile
 More options Dec 30 2006, 10:01 pm
From: "Mike" <mike.poir...@gmail.com>
Date: Sun, 31 Dec 2006 03:01:56 -0000
Local: Sat, Dec 30 2006 10:01 pm
Subject: validating when form labels don't match table fields
Hi,

I'm using the validates_* functions in my models, but with one model,
I've used different labels in the view than what the real field names
are on the model.  I see how to set a custom message with :message but
it always sticks in the model's field name.  This would be confusing
when the error message is displayed, and the whole point was to make
the labels a little more tailored to the end user.

Is there any easy solution here?

TIA,
Mike


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike  
View profile
 More options Dec 31 2006, 9:03 am
From: "Mike" <mike.poir...@gmail.com>
Date: Sun, 31 Dec 2006 06:03:22 -0800
Local: Sun, Dec 31 2006 9:03 am
Subject: validating when form labels don't match table fields
Hi,

(I posted this topic last night, but it never showed up.)

I have a model where the attribute names don't match exactly what I'd
like to use for labels for the input s on my view.  For example, my
model order has an attribute "ordered_by_first_name" and I'd like the
label on the view to be "Your first name".  Fine.  Except that if I use
really nice validation helpers I can't fully override the error
message.  I can use :message but it always sticks in the model
attribute name.  This will cause some confusion and I was hoping to
make things a little more user friendly on the view.

My order model has other attributes that refer to people's names in
them (no, I'm not entirely normalized).

I guess it goes without saying that I was hoping to use
error_messages_for in the view.

Anyone have any suggestions for when the model names don't match what
you'd want to present to a user?

TIA,
Mike


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike  
View profile
 More options Dec 31 2006, 1:18 pm
From: "Mike" <mike.poir...@gmail.com>
Date: Sun, 31 Dec 2006 10:18:52 -0800
Local: Sun, Dec 31 2006 1:18 pm
Subject: validating when form labels don't match table fields
Hi,

(I posted this topic last night, but it never showed up.)

I have a model where the attribute names don't match exactly what I'd
like to use for labels for the input s on my view.  For example, my
model order has an attribute "ordered_by_first_name" and I'd like the
label on the view to be "Your first name".  Fine.  Except that if I use
really nice validation helpers I can't fully override the error
message.  I can use :message but it always sticks in the model
attribute name.  This will cause some confusion and I was hoping to
make things a little more user friendly on the view.

My order model has other attributes that refer to people's names in
them (no, I'm not entirely normalized).

I guess it goes without saying that I was hoping to use
error_messages_for in the view.

Anyone have any suggestions for when the model names don't match what
you'd want to present to a user?

TIA,
Mike


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google