<h1>Editing Topic</h1>

<%= form_for(@topic, html: { class: 'square' }) do |f| %>
  <%= render 'shared/errors', messages: @topic.errors.full_messages %>

  <div class="fields horizontal">
    <%= f.label :title %>
    <%= f.text_field :title %>
  </div>
  <div class="fields horizontal">
    <%= f.label :forum_id %>
    <%= f.select :forum_id, Forum.all.collect{|forum| [forum, forum.id]} %>
  </div>
  <div class="fields horizontal">
    <%= f.label :state %>
    <%= f.select :state, f.object.states.invert %>
  </div>
  <div class="controls">
    <%= f.submit 'Update Topic' %>
  </div>
<% end %>
