The field must be limited to 160 characters (it is a text message), but I want the user to be able to add CR's. It looked like the easiest way to do this was to set a text field with a limited size. But Postgre does not appear to allow size limits on text columns. I have validations and I display a "characters remaining" counter to the user, but I would like to have a hard limit in the database as a last line of defense.
On Sep 27, 6:10 am, Matt Jones <[email protected]> wrote: > On Sep 26, 2010, at 10:38 PM, Dan Jasek wrote: > > > I have a field setup with a type of text. I like the way this is > > handled by hobo (displaying as a textarea, etc), but I don't like the > > migration created for it. I need the migration to set this up as a > > string column in the database, not a text column. This is because of > > the odd way Postgre handles text columns. > > > I have modified the migration Hobo generates, but every time I create > > a new migration it wants to change the type of this field to text. Is > > there a way to stop this? > > You could try aliasing the type, so that Hobo can distinguish what you want. > However, I'm curious as to *why* you'd want to present a textbox for a > :string field, which ActiveRecord defines as a varchar(255). Users have a > nasty habit of typing 300+ characters in text boxes... > > --Matt Jones -- You received this message because you are subscribed to the Google Groups "Hobo Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/hobousers?hl=en.
