Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <% if @post.errors.any?%>
- <div class="allert alert-danger">
- <h5><%= t('common.errors')%></h5>
- <ul>
- <% @post.errors.full_messages.each do |message| %>
- <li><%=message%></li>
- <% end %>
- </ul>
- </div>
- <% end %>
- <%= form_for @post, html:{ multipart: true } do |f| %>
- <div class="form-group">
- <%= f.label :title %>
- <%= f.text_field :title, class: 'form-control'%>
- </div>
- <div class="form-group">
- <%= f.label :summary %>
- <%= f.text_area :summary, class: 'form-control'%>
- </div>
- <%= form_with(model: message_path, local: true) do |f| %>
- <div class="form-group">
- <%= form.label :body %>
- <%= form.rich_text_area :body, class: 'editor' %>
- <%= @post.body %>
- </div>
- <% end %>
- <div class="form-group">
- <%= f.file_field :image %>
- </div>
- <div class="form-group">
- <%= f.submit t('.submit', action: @post.new_record? ? 'Создать' : 'Изменить'), class: 'btn btn-primary'%>
- <%= link_to t('common.back'), :back, class: 'btn btn-outline-secondary'%>
- </div>
- <% end %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement