views:

50

answers:

1

Following is the model. I've already installed Redcloth((4.2.2) and acts_as_textiled plugin on Rails 2.3.2

class Post < ActiveRecord::Base
  acts_as_textiled :content
end

Now from console:

[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\"&gt;http://www.cc.com&lt;/a&gt;&lt;/p&gt;"
[Staging]>> post.save
=> true
[Staging]>> post.content
=> "<p>the link is &#8220;linked&#8221;:<a href=\"http://www.cc.com\"&gt;http://www.cc.com&lt;/a&gt;&lt;/p&gt;"
[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>"

Every textile codes works except the link gets messed up. Why that link doesn't get formatted as advertised??

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

The link gets saved with the link itself?? Whats wrong with it?

A: 

I had the same problem when using an older version of acts_as_textiled. Make sure you clone the most recent version from the git repository available from http://github.com/defunkt/acts%5Fas%5Ftextiled/

After I updated my version, links started working as they should

opcode