<% @messages.each do |message| %>
<div class="event">
<div class="content">
<div class="summary">
<span style="color: orange"><%= message.user.username%>:</span> <%= message.body %>
</div>
</div>
</div>
<% end %>
이라는 코드를
<%= render @messages %>
로 간단히 대체할 수 있다
참고 github.com/jangsungwon/message_me/commit/28e4132c46d29cec3c93591617f4ba3b741ad60a
Refactoring message partial · jangsungwon/message_me@28e4132
Analytics cookies We use analytics cookies to understand how you use our websites so we can make them better, e.g. they're used to gather information about the pages you visit and how many clicks you need to accomplish a task. Learn more Accept Reject
github.com
'ruby on rails' 카테고리의 다른 글
add devise gem for authentication (0) | 2020.11.19 |
---|---|
websocket via ActionCable (0) | 2020.11.18 |
favicon (0) | 2020.11.18 |
console db 시각화 (0) | 2020.11.17 |
semantic UI 적용 (0) | 2020.11.17 |