2009-07-17 53 views
0

以下是模型。我已經安裝了Redcloth((4.2.2)和on Rails的acts_as_textiled插件2.3.2只有鏈接與rails中的acts_as_textile插件搞砸了嗎?

class Post < ActiveRecord::Base 
    acts_as_textiled :content 
end 
從控制檯

現在:

[Staging]>> post = Post.new(:title => 'the post title', :content => 'the link is "linked":http://www.cc.com', :user_id => 1) 
=> #<Post id: nil, title: "the post title", content: "the link is \"linked\":http://www.cc.com", user_id: 1, comments_count: 0, published_at: nil, created_at: nil, updated_at: nil> 
[Staging]>> post.content 
=> "<p>the link is &#8220;linked&#8221;:<a href=\"http://www.cc.com\">http://www.cc.com</a></p>" 
[Staging]>> post.save 
=> true 
[Staging]>> post.content 
=> "<p>the link is &#8220;linked&#8221;:<a href=\"http://www.cc.com\">http://www.cc.com</a></p>" 
[Staging]>> post.content = '_simple_' 
=> "_simple_" 
[Staging]>> post.save 
=> true 
[Staging]>> post.content 
=> "<p><em>simple</em></p>" 
[Staging]>> post.content = "This is *cool*" 
=> "This is *cool*" 
[Staging]>> post.content 
=> "<p>This is <strong>cool</strong></p>" 
[Staging]>> post.textiled = false 
=> false 
[Staging]>> post.content = "This is *cool*" 
=> "This is *cool*" 
[Staging]>> post.content 
=> "This is *cool*" 
[Staging]>> post.textiled = true 
=> true 
[Staging]>> post.content 
=> "<p>This is <strong>cool</strong></p>" 

每個紡織代碼工作,除了該鏈接被搞砸了,爲什麼。該鏈接不會被格式化爲標榜??

=> "<p>the link is &#8220;linked&#8221;:<a href=\"http://www.cc.com\">http://www.cc.com</a></p>" 

鏈接被保存鏈接本身?? 哪些錯誤呢?

回答

0

當使用舊版本的acts_as_textiled時,我遇到了同樣的問題。確保你從http://github.com/defunkt/acts_as_textiled/

克隆從現有的Git倉庫最近的版本我更新版本後,鏈接開始工作,他們應該