You can simply use the 'text' type instead of 'string'.
def self.up
create_table :notes do |t|
t.text :note
end
end
Using the 'text' type will result in database column of type TEXT. Varchar is usually limited to a maximum length of 255 (in MySQL, other RDBMSs have similar limits).
If you use Rails' form helpers, a textarea will be output for this field (because it is of type 'text'). textarea is the form element that accepts multi-line input.
Edit: If you've already migrated the create_table, you can create a new migration to change the column type:
def self.up
change_column :notes, :note, :text
end
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…