Note that there are some explanatory texts on larger screens.

plurals
  1. POAbout a index of blog and show description and show all
    primarykey
    data
    text
    <p>i got a problem about blog making i need something like the site railcast which is before enter the title i will see the index page description with limited row after enter the title only see the full paragraph i failed to do in this way</p> <pre><code>My index View :: &lt;% for post in @posts %&gt; &lt;div class="blogPost"&gt; &lt;h2&gt; &lt;%= link_to h(post.title), post %&gt; &lt;/h2&gt; &lt;b&gt;Category:&lt;/b&gt;&lt;%=h post.category.category_name %&gt;&lt;br/&gt; &lt;b&gt;Posted at:&lt;/b&gt;&lt;%=h post.date_of_creation %&gt;&lt;br/&gt; &lt;%= "#{post.comments.count} Comments" %&gt;&lt;br/&gt; &lt;div class="body"&gt; &lt;p&gt;&lt;%= post.description %&gt;&lt;/p&gt; &lt;p&gt;&lt;%=link_to "Read More...", post %&gt;&lt;/p&gt; &lt;/div&gt; &lt;div class="action"&gt; &lt;%= link_to "Edit", edit_post_path(post) %&gt; &lt;%= link_to "Destroy", post, :confirm =&gt; 'Are you sure?', :method =&gt; :delete %&gt; &lt;/div&gt; &lt;/div&gt; My controller :: def index @posts = Post.paginate :per_page =&gt; 5, :page =&gt; params[:page], :order =&gt; 'created_at DESC' respond_to do |format| format.html # index.html.erb format.js do render :update do |page| page.replace_html 'post', :partial =&gt; "post" end end format.xml { render :xml =&gt; @posts } format.json { render :json =&gt; @posts } format.atom end end </code></pre> <p>and</p> <pre><code>New Post Form :: &lt;h1&gt;New post&lt;/h1&gt; &lt;% form_for(@post) do |f| %&gt; &lt;%= f.error_messages %&gt; &lt;p&gt; &lt;%= f.label :title %&gt;&lt;br /&gt; &lt;%= f.text_field :title %&gt; &lt;/p&gt; &lt;p&gt; &lt;%= f.label :body %&gt;&lt;br /&gt; &lt;%= f.text_area :body %&gt; &lt;/p&gt; &lt;p&gt; &lt;%= f.label :date_of_creation %&gt;&lt;br /&gt; &lt;%= f.date_select :date_of_creation %&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="category"&gt;Category&lt;br/&gt;&lt;/label&gt; &lt;select name="category"&gt; &lt;% @cat.each do |category| %&gt; &lt;option value="&lt;%= category.id %&gt;"&gt; &lt;%= category.category_name %&gt; &lt;/option&gt; &lt;% end %&gt; &lt;/select&gt; &lt;/p&gt; &lt;p&gt; &lt;%= f.submit 'Create' %&gt; &lt;/p&gt; &lt;% end %&gt; </code></pre> <p>is that i need to create a new column call description or what i failed to call it up with</p> <pre><code>&lt;div class="body"&gt; &lt;p&gt;&lt;%= post.description %&gt;&lt;/p&gt; &lt;p&gt;&lt;%=link_to "Read More...", post %&gt;&lt;/p&gt; &lt;/div&gt; </code></pre> <p>Guy here have any better idea ? Thx for reply ~</p>
    singulars
    1. This table or related slice is empty.
    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.
    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