0
這裏就是我試圖做的:無法更新通過導軌控制檯(或通過我的應用程序)的對象......但沒有具體的錯誤,以幫助調試
irb(main):008:0> c.title = "Another Test"
=> "Another Test"
irb(main):009:0> c.save
(0.7ms) BEGIN
FriendlyId::Slug Load (1.0ms) SELECT "friendly_id_slugs".* FROM "friendly_id_slugs" WHERE "friendly_id_slugs"."sluggable_type" = 'Contest' AND (slug = 'another-test-challenge' OR slug LIKE 'another-test-challenge--%') AND (sluggable_id <> 64) ORDER BY LENGTH(slug) DESC, slug DESC LIMIT 1
(0.5ms) ROLLBACK
=> false
當我嘗試做這在我的應用程序(即使用編輯表格),我得到這個問題:
2013-01-10T17:53:47+00:00 app[web.2]: cache: [POST /mycontroller/this-is-the-old-title] invalidate, pass
我似乎無法編輯標題爲我的目標,這相當於關聯到我的對象,以及友好的ID。
在rails控制檯中運行該命令後,「c.errors.full_messages」輸出的內容是什麼? –
或者嘗試用'c.save!'運行命令。 –
獅子座 - 感謝您指出這一點,它幫助瞭解發生了什麼!如果你把你的回答作爲答案,我會繼續接受它。 –