Advertisement
pilligrim28

Untitled

Jun 21st, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.00 KB | None | 0 0
  1. <% if @post.errors.any?%>
  2. <div class="allert alert-danger">
  3. <h5><%= t('common.errors')%></h5>
  4. <ul>
  5.   <% @post.errors.full_messages.each do |message| %>
  6.   <li><%=message%></li>
  7.  <% end %>
  8.  </ul>
  9. </div>
  10. <% end %>
  11.  
  12.  
  13. <%= form_for @post, html:{ multipart: true } do |f| %>
  14. <div class="form-group">
  15.  <%= f.label :title %>
  16. <%= f.text_field :title, class: 'form-control'%>
  17. </div>
  18.  
  19. <div class="form-group">
  20.  <%= f.label :summary %>
  21. <%= f.text_area :summary, class: 'form-control'%>
  22. </div>
  23.  
  24. <%= form_with(model: message_path, local: true) do |f| %>
  25.   <div class="form-group">
  26.     <%= form.label :body %>
  27.     <%= form.rich_text_area :body, class: 'editor' %>
  28.   <%= @post.body %>
  29.  
  30.   </div>
  31. <% end %>
  32. <div class="form-group">
  33. <%= f.file_field :image %>
  34. </div>
  35. <div class="form-group">
  36.  <%= f.submit t('.submit', action: @post.new_record? ? 'Создать' : 'Изменить'), class: 'btn btn-primary'%>
  37.  <%= link_to t('common.back'), :back, class: 'btn btn-outline-secondary'%>
  38. </div>
  39. <% end %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement