Note that there are some explanatory texts on larger screens.

plurals
  1. POPutting a hyperlink inside a "Post" text field in Rails 3
    primarykey
    data
    text
    <p>Rails Newb here asking his first question....</p> <p>I'm building a personal blog-style website that uses a generic "Post" scaffold to add content to the site. The fields are <strong>title:string</strong>, <strong>body:text</strong>, and <strong>:tag_list</strong> respectively. <em>Acts-as-taggable</em> sorts the posts and puts them on the correct page.</p> <p>When I create a new post and enter text into the <strong>:body</strong>, I can't get it to recognize anything other than pure text. I'm trying to get it to accept in-line html tags, rails methods (i.e. <strong>link_to</strong>, <strong>image_tag</strong>) in the text itself. As I'm typing this I realize what I'm looking for is the basic functionality of most blogging text editors. Is there any easy way to do this?</p> <p>Here is my posts <strong>model</strong>:</p> <pre><code>class Post &lt; ActiveRecord::Base has_many :tags acts_as_taggable_on :tags attr_accessible :tag_list, :tags, :title, :body, :post, :comments validates :title, :presence =&gt; true, :length =&gt; { :maximum =&gt; 30 } validates :body, :presence =&gt; true default_scope :order =&gt; 'posts.created_at DESC' named_scope :by_join_date, :order =&gt; "created_at DESC" </code></pre> <p>Here is my posts <strong>helper</strong>:</p> <pre><code>module PostsHelper include ActsAsTaggableOn::TagsHelper include TagsHelper </code></pre> <p>The <strong>Posts Controller</strong> and <strong>Post Views</strong> are all basicallu unchanged from the scaffold code.</p> <p>Thanks in advance for all your help!</p> <p>~Dan</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload