Sha256: a31d32de6402afbb319d34fe32914f2af2268ec021f06e51b89b206083ee29a9
Contents?: true
Size: 1.7 KB
Versions: 3
Compression:
Stored size: 1.7 KB
Contents
<%= form_for @forum_thread, url: (@forum_thread.persisted? ? simple_discussion.forum_thread_path(@forum_thread) : simple_discussion.forum_threads_path), html: { data: {behavior: "comment-form"} } do |f| %> <% if @forum_thread.errors.any? %> <div id="error_explanation"> <h2><%= pluralize(@forum_thread.errors.count, "error") %> prohibited this forum_thread from being saved:</h2> <ul> <% @forum_thread.errors.full_messages.each do |message| %> <li><%= message %></li> <% end %> </ul> </div> <% end %> <div class="form-group"> <%= f.label :forum_category_id, t('choose_a_category') %> <%= f.collection_select :forum_category_id, ForumCategory.sorted, :id, :name, {include_blank: t('pick_a_category')}, {autofocus: true, class: "form-control"} %> </div> <div class="form-group"> <%= f.label t('title') %> <%= f.text_field :title, placeholder: t('how_do_i'), class: "form-control" %> </div> <% if local_assigns.fetch(:posts, true) %> <%= f.fields_for :forum_posts do |p| %> <div class="form-group"> <%= p.label :body, t('what_help_needed') %> <%= p.text_area :body, placeholder: t('add_a_comment'), rows: 10, class: "form-control simplemde", data: { behavior: "comment-body" } %> </div> <% end %> <% end %> <div class="form-group text-right"> <% if f.object.new_record? %> <%= f.button t('ask_your_question'), class: "btn btn-primary", data: {disable_with: "<i class='fa fa-spinner fa-spin'></i> #{t('saving')}"} %> <% else %> <%= f.button "Update Thread", class: "btn btn-primary", data: {disable_with: "<i class='fa fa-spinner fa-spin'></i> #{t('saving')}"} %> <% end %> </div> <% end %>
Version data entries
3 entries across 3 versions & 1 rubygems