can't save urls

0 views
Skip to first unread message

badnaam

unread,
Jul 23, 2010, 7:23:12 PM7/23/10
to Ruby on Rails: Talk
I have a model with a field called "website", its a varchar(150) mysql
data type.

the field renders fine in my new/edit forms, I have insured it does
get to the update/create method in the controller in the params args,
but it never gets saved! I have a validation on it that does not fire
either, even if I enter more than 150 characters, which is the limit.

Very strange because the same datatype, field name works just fine in
another application. Any ideas?

validates_length_of :website, :maximum =>
Constants::MAX_LINK_LENGTH, :allow_nil => true, :message => "Please
keep the link within #{Constants::MAX_LINK_LENGTH} characters or make
it short at http://tinyurl.com/"

Frederick Cheung

unread,
Jul 24, 2010, 4:58:17 AM7/24/10
to Ruby on Rails: Talk


On Jul 24, 12:23 am, badnaam <asitkmis...@gmail.com> wrote:
> I have a model with a field called "website", its a varchar(150) mysql
> data type.
>
> the field renders fine in my new/edit forms, I have insured it does
> get to the update/create method in the controller in the params args,
> but it never gets saved! I have a validation on it that does not fire
> either, even if I enter more than 150 characters, which is the limit.
>
> Very strange because the same datatype, field name works just fine in
> another application. Any ideas?
>
is there anything else in the model pertaining to website (perhaps
you've overwritten one of the accessors by accident?)

Fred

Dee

unread,
Jul 24, 2010, 5:55:31 AM7/24/10
to Ruby on Rails: Talk
Did you list :website in attr_accessible? Check the server log and see
if it's being thrown out.

On Jul 24, 4:58 am, Frederick Cheung <frederick.che...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages