Question: How can I "convert" my textile generated HTML back to textile markup in my app?
Here's the situtation. I managed to piece together a poor man's blog editor in my Rails 3 app by implementing RedCloth and acts-as-textiled in my "posts" model. I use acts-as-textiled to take the pain out of writing content in the body of my "posts".
It works great. However, when I edit the post I see the generated HTML in the post body. What I would like to see is the original textile markup. Is this possible?
Thanks in advance for your help!
Here is my post model:
class Post < ActiveRecord::Base
has_many :tags
acts_as_taggable_on :tags
acts_as_textiled :title, :body
attr_accessible :tag_list, :tags, :title, :body, :post, :comments
validates :title, :presence => true
validates :body, :presence => true
default_scope :order => 'posts.created_at DESC'
Here is my Posts view for the "Show" method:
<%= @post.title.html_safe %>
<%= @post.body.html_safe %>