Files
forum/app/views/topics/_form.html.erb

30 lines
1.1 KiB
Plaintext
Executable File

<%= form_for [@forum, @topic] do |f| %>
<% if @topic.errors.any? %>
<% flash.now[:error] = @topic.errors.full_messages.join(', and ') %>
<% end %>
<div class="module">
<div class="module_header"><%= action_name.humanize %> Topic</div>
<div class="module_subheader smaller"></div>
<div class="module_body">
<%= f.label :title %>
<span class="input indent smaller"><%= f.text_field :title, :style => "width:98%" %></span>
<div class="clear"></div>
<% unless @topic.id %>
<%= f.label :body %>
<span class="input indent smaller"><%= f.text_area :body, :style => "width:98%", :rows => 15 %></span>
<div class="clear"></div>
</div>
<% end %>
<div class="module_footer">
<div class="fieldset">
<span class"input">
<%= f.submit "Submit", :class =>"btn btn-primary"%>
<%= button_tag "Cancel", :confirm => 'Are you sure? Any changes will be lost.', :class => 'btn', :type => 'submit', :name => 'commit', :value => 'cancel' %>
</span>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<% end %>