Currently I have a form with some inputs, related to a wiki page. So I
have:
<%= text_field ''page'', ''title''
<%= text_field ''page'', ''summary''
<%= text_field ''page'', ''body''
And a model called "Page", extending from
"ActiveRecord::Base", and
storing data in MySQL.
But know I have to record the attributes in some other part, having just
the "body" att. stored in MySQL, and the other attributes,
let''s say, in
a file.
So, what should I do? I first thought of keeping my "Page <
ActiveRecord::Base", and storing there just the "body" attribute
(and
the table in MySQL just storing this attribute, deleting the other
columns), and create another model called "Whatever", which stores the
other attributes (but not extending from "ActiveRecord::Base"). That
way
my view would have:
<%= text_field ''whatever'', ''title''
<%= text_field ''whatever'', ''summary''
<%= text_field ''page'', ''body''
But, if I did this
how can in my "Whatever" model would validate the
things I used to validate with a model extending from
"ActiveRecord::Base", such as:
validates_uniqueness_of :title...
validates_length_of :title, ...
...
Thanks.
--
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 this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---