0

以下がモデルです。Rails 2.3.2にRedcloth((4.2.2)とacts_as_textiledプラグインを既にインストールしました

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>"

リンクはリンク自体と一緒に保存されますか?? どうしたの?

4

1 に答える 1

0

古いバージョンのacts_as_textiledを使用したときにも同じ問題が発生しました。http://github.com/defunkt/acts_as_textiled/から入手できるgitリポジトリから最新バージョンのクローンを作成してください。

バージョンを更新した後、リンクが正常に機能し始めました

于 2009-11-15T05:43:22.017 に答える