這是一個使用CKeditor的簡單導軌形式。我的模型只保存了一些信息
我正在保存內容,它出現在更新中。
pp params[:email]["body"]
"<br />\r\nheyyy<br />\r\nbut now i am going to save this past 9 lines.<br />\r\ncuz that's what this is all about<br />\r\n<br />\r\nI am crazy like that<br />\r\nc<br />\r\ncrazy<br />\r\ncrazy c<br />\r\ncrazy<br />\r\n<br />\r\nhere is another line..<br />\r\[email protected]!!&<br />\r\nfa<br />\r\nsdf<br />\r\nas<br />\r\ndf<br />\r\nasd<br />\r\nfa<br />\r\nsdfasdf<br />\r\n"
然後我的控制器是這樣的:
@emails = Email.find(params[:id])
呢!在調用這個之後,我在ruby-debug中輸入@emails.body
,並輸出1/2! :
@emails.body
"<br />\r\nheyyy<br />\r\nbut now i am going to save this past 9 lines.<br />\r\ncuz that's what this is all about<br />\r\n<br />\r\nI am crazy like that<br />\r\nc<br />\r\ncrazy<br />\r\ncrazy c<br />\r\ncrazy<br />\r\n<br />\r\nhere is another line..<br />\r\[email protected]!!&"
爲什麼會出現這種情況?
該屬性被保存爲我的數據庫中的字符串。