app/views/phcpresspro/article/posts/_form.html.erb in phcpresspro-69.1.0 vs app/views/phcpresspro/article/posts/_form.html.erb in phcpresspro-70.0.0
- old
+ new
@@ -1,47 +1,47 @@
-<%= form_for(@article_post, :html => {:multipart => true}) do |f| %>
+<%= form_with(model: article_post, local: true) do |form| %>
<div class="row">
<div class="col-md-3">
<div class="panel panel-inverse">
<div class="panel-heading">
<h4 class="panel-title">Publish Panel</h4>
</div>
<div class="panel-body">
<div class="form-group">
- <%= f.label :pststatus, "Post Status" %>
- <%= f.select( :pststatus, [['Draft','draft'],['Published','published'],['Review','review']], {}, {class: "form-control form-control-sm"}) %>
+ <%= form.label :pststatus, "Post Status" %>
+ <%= form.select( :pststatus, [['Draft','draft'],['Published','published'],['Review','review']], {}, {class: "form-control form-control-sm"}) %>
</div>
<div class="actions">
- <%= f.submit class: "btn btn-primary waves-effect" %>
+ <%= form.submit class: "btn btn-primary waves-effect" %>
</div>
</div>
</div>
<div class="panel panel-inverse">
<div class="panel-heading">
<h4 class="panel-title">Post Images</h4>
</div>
<div class="panel-body">
<div class="form-group">
- <%= f.label :pstimage, "Featured Image" %>
- <%= f.file_field :pstimage, class: "form-control" %>
+ <%= form.label :pstimage, "Featured Image" %>
+ <%= form.file_field :pstimage, class: "form-control" %>
</div>
- <% if f.object.pstimage? %>
- <%= image_tag f.object.pstimage_url, class: "img-responsive img-thumbnail" %>
- <%= f.label :remove_pstimage %>
- <%= f.check_box :remove_pstimage %>
+ <% if form.object.pstimage? %>
+ <%= image_tag form.object.pstimage_url, class: "img-responsive img-thumbnail" %>
+ <%= form.label :remove_pstimage %>
+ <%= form.check_box :remove_pstimage %>
<% end %>
</div>
</div>
<div class="panel panel-inverse">
<div class="panel-heading">
<h4 class="panel-title">Post Categories</h4>
</div>
<div class="panel-body">
- <%= f.collection_check_boxes :category_ids, Phcpresspro::Modules::Category.all, :id, :catname do |post_category| %>
+ <%= form.collection_check_boxes :category_ids, Phcpresspro::Article::Category.all, :id, :catname do |post_category| %>
<%= post_category.check_box %>
<%= post_category.label %></br>
<% end %>
</div>
</div>
@@ -52,12 +52,12 @@
<!-- PHCNotifi Render Validation -->
<%= render 'phcnotifi/validations', :object => @article_post %>
<!-- PHCNotifi Render Validation -->
<div class="form-group">
- <%= f.label :psttitle, "Article Title" %>
- <%= f.text_field :psttitle, class: "form-control" %>
+ <%= form.label :psttittle, "Article Title" %>
+ <%= form.text_field :psttittle, class: "form-control" %>
</div>
<div class="panel panel-inverse">
<div class="panel-heading">
<div class="panel-heading-btn">
@@ -67,10 +67,10 @@
</div>
<h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
</div>
<div class="panel-body panel-form">
<div class="form-group">
- <%= f.text_area :psttext, :class => "ckeditor form-control", :id => "editor1", :rows => 20, :cols => 60 %>
+ <%= form.text_area :psttext, :class => "ckeditor form-control", :id => "editor1", :rows => 20, :cols => 60 %>
</div>
</div>
</div>
</div>