[英]Mailboxer rails 4 Custom Views
嗨,大家好,我目前使用的是mailer gem,並且想要自定義這些渲染器的視圖
%h2 Inbox
%ul= render mailbox.inbox
%hr
%h2 Sentbox
%ul= render mailbox.sentbox
%hr
%h2 Trash
%ul= render mailbox.trash
我想在電子郵件標題中添加“ from”和“ link”,但是不知道視圖在哪里編輯或在哪里生成。 謝謝。
檢查您的服務器日志。 它們應該放在app/views/message_mailer/new_message_email.html.erb
等中
您可以在本教程中查看自定義視圖 。
調節器
def index
@inbox ||= current_user.mailbox.inbox
end
視圖
<% @inbox.each do |conversation| %>
<%= conversation.originator.username%>
<%= link_to raw(truncate(strip_tags(conversation.subject), :length => 15)), conversation_path(conversation) %>
<%= link_to "", {:controller => "conversations", :action => "trash", :id => conversation.id}, :title=> "Move to Trash", :method=>'post', data: { confirm: '¿Estas seguro?' }, :class=> "btn btn btn-danger icon-remove" %>
<%= conversation.updated_at%>
<% end %>
然后創建show.html.erb以查看完整消息。
這是另一個示例應用程序
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.