【发布时间】:2016-01-14 11:00:41
【问题描述】:
是否可以在视图文件中添加 active_admin_cmets 方法? 另外,我也尝试过这种方式,但它并没有保存 cmets。
<%= f.inputs "" do %>
<% f.has_many :comments do |c| %>
<% c.input :_destroy, :as => :boolean, :label => "Remove comment"
unless c.object.nil? or c.object.id.nil? %>
<% c.input :author_id, :as => :hidden, :input_html => { :value => current_admin_user.id } %>
<% c.input :author_type, :as => :hidden, :input_html => { :value => current_admin_user.class.name } %>
<% c.input :body, :label => false, :input_html => { :class => 'autogrow', :rows => 10, :cols => 20 }, :validate => { :presence => true } %>
<% end %>
<% end %>
那你建议我做什么?
【问题讨论】:
标签: ruby-on-rails model-view-controller view comments activeadmin