<%
  add_body_class "new_discussion discussion_form"
  @page_title = "New #{@exchange.class.to_s.downcase}"
  if @recipient
    @page_title += " with #{@recipient.username}"
  end
%>

<h2 class="section">
  <% if @exchange.kind_of?(Conversation) %>
    <%= link_to "Conversations", conversations_path %> &raquo;
    <% if @recipient %>
      <%= link_to "New conversation with #{@recipient.username}", new_conversation_with_path(username: @recipient.username) %>
    <% else %>
      <%= link_to "New", new_conversation_path %>
    <% end %>
  <% else %>
    <%= link_to "Discussions", discussions_path %> &raquo; <%= link_to "New", new_discussion_path %>
  <% end %>
</h2>

<%= form_for(@exchange) do |f| %>
  <%= render partial: "exchanges/form", locals: {f: f} %>
  <p><button type="submit">Create <%= @exchange.class.to_s.downcase %></button></p>
<% end %>

<%
  add_body_class "new_discussion discussion_form"
  @page_title = "New #{@exchange.class.to_s.downcase}"
  if @recipient
    @page_title += " with #{@recipient.username}"
  end
%>

<h2 class="section">
  <% if @exchange.kind_of?(Conversation) %>
    <%= link_to "Conversations", conversations_path %> &raquo;
    <% if @recipient %>
      <%= link_to "New conversation with #{@recipient.username}", new_conversation_with_path(username: @recipient.username) %>
    <% else %>
      <%= link_to "New", new_conversation_path %>
    <% end %>
  <% else %>
    <%= link_to "Discussions", discussions_path %> &raquo; <%= link_to "New", new_discussion_path %>
  <% end %>
</h2>

<%= form_for(@exchange), builder: Sugar::FormBuilder do |f| %>
  <%= render partial: "exchanges/form", locals: {f: f} %>
  <p><button type="submit">Create <%= @exchange.class.to_s.downcase %></button></p>
<% end %>

Use the form builder for new discussions
Use the form builder for new discussions
