0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

備忘録(TX46)レンダーメソット

Posted at

<%= link_to 'Post', posts_path %>

<%= render @posts %>

ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー

>

<%= truncate(post.title, :length => 60) %>

Posted by <%= post.user.name %>

<%= post.title %>

<%= post.content %>

<%= link_to "I'm interested", post_path(post.id), class: 'interested' %>

ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー

じょうきがレンダーを使わない場合

<%= truncate(post.title, :length => 60) %>

Posted by <%= post.user.name %>

<%= post.title %>

<%= post.content %>

<%= link_to "I'm interested", post_path(post.id), class: 'interested' %>

をコピーしてeach do するだけ!!

回答

<%= link_to 'Post', posts_path %>

<% @posts.each do |post| %>
>

<%= truncate(post.title, :length => 60) %>

Posted by <%= post.user.name %>

<%= post.title %>

<%= post.content %>

<%= link_to "I'm interested", post_path(post.id), class: 'interested' %>
<% end %>
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?