Skip to content

Instantly share code, notes, and snippets.

@pencilcheck
Created August 21, 2011 07:52
Show Gist options
  • Save pencilcheck/1160306 to your computer and use it in GitHub Desktop.
Save pencilcheck/1160306 to your computer and use it in GitHub Desktop.
<p id="notice"><%= notice %></p>
<p>
<b>Name:</b>
<%= @mailbox.name %>
</p>
<% @mailbox.letters.each do |letter| %>
<p>
<b><%= letter.subject %></b><br />
<%= letter.body %>
</p>
<% end %>
<br />
<br />
<br />
<h3>Add a new letter for the mailbox:(of course this should be handled by the server eventually)</h3>
<%= form_for([@mailbox, @letter]) do |f| %>
<% if @letter.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@letter.errors.count, "error") %> prohibited this letter from being saved:</h2>
<ul>
<% @letter.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :subject %><br />
<%= f.text_field :subject %>
</div>
<div class="field">
<%= f.label :body %><br />
<%= f.text_area :body %>
</div>
<div class="actions">
<%= f.submit %>
</div>
<% end %>
<%= link_to 'Edit', edit_mailbox_path(@mailbox) %> |
<%= link_to 'Back', mailboxes_path %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment