My template backs up only some of the information

This is a simple rails form using CKeditor.

I’m saving the content, it appears in the Update.

pp params[:email]["body"]
"
rnheyyy
rnbut now i am going to save this past 9 lines.
rncuz that's what this is all about
rn
rnI am crazy like that
rnc
rncrazy
rncrazy c
rncrazy
rn
rnhere is another line..
r[email protected]!!&
rnfa
rnsdf
rnas
rndf
rnasd
rnfa
rnsdfasdf
rn"

Then my controller goes like this :

@emails = Email.find(params[:id])

Then! After this is called, I type @emails.body
in ruby-debug, and it outputs 1/2 of that! :

@emails.body
"
rnheyyy
rnbut now i am going to save this past 9 lines.
rncuz that's what this is all about
rn
rnI am crazy like that
rnc
rncrazy
rncrazy c
rncrazy
rn
rnhere is another line..
r[email protected]!!&"

Why would that occur?

The attribute is saved as a string in my database.

You’re likely storing it in the database as a varchar instead of text. Depending on the length of the varchar, it will simply truncate the data instead of return an error. You can easily change the column type in a migration:

change_column :my_table, :my_column, :text
Hello, buddy!稿源:Hello, buddy! (源链) | 关于 | 阅读提示

本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 后端存储 » My template backs up only some of the information

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录