Skip to content

Instantly share code, notes, and snippets.

@baileylo
Created October 19, 2010 08:40
Show Gist options
  • Save baileylo/633849 to your computer and use it in GitHub Desktop.
Save baileylo/633849 to your computer and use it in GitHub Desktop.
Code to display conversations
<%= form_for(@conversation, :url => board_conversations_path) do |f| %>
<% if @conversation.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@conversation.errors.count, "error") %> prohibited this conversation from being saved:</h2>
<ul>
<% @conversation.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :title %><br />
<%= f.text_field :title %>
</div>
<%= fields_for(@comment) do |cf|%>
<div class="field">
<%= cf.label :body %><br />
<%= cf.text_area(:body, :size => "60x10")%>
</div>
<% end %>
<div class="actions">
<%= f.submit :as => "Create Post"%>
</div>
<% end %>
<h1 id="page_title">New conversation</h1>
<%= link_to @board.title, @board %>
<%= render 'form' %>
<%= link_to @board.title, @board %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment