application record: add array_attribute method.

Add `array_attribute` method that defines helper methods for converting
array attributes to or from strings.
This commit is contained in:
evazion
2018-11-13 16:25:45 -06:00
parent a57d4a9558
commit b660aeefd7
5 changed files with 37 additions and 16 deletions

View File

@@ -8,7 +8,7 @@
<%= f.input :name, :as => :string, :input_html => { :value => @pool.pretty_name } %>
<%= dtext_field "pool", "description" %>
<%= dtext_preview_button "pool", "description" %>
<%= f.input :post_ids, as: :text, label: "Posts", input_html: { value: @pool.post_ids.join(" ") } %>
<%= f.input :post_ids_string, as: :text, label: "Posts" %>
<%= f.input :category, :collection => ["series", "collection"], :include_blank => false %>
<%= f.input :is_active %>
<%= f.button :submit %>

View File

@@ -7,7 +7,7 @@
<%= simple_form_for(@pool) do |f| %>
<%= f.input :name, :as => :string, :required => true %>
<%= dtext_field "pool", "description" %>
<%= f.input :post_ids, as: :text, label: "Posts", input_html: { value: @pool.post_ids.join(" ") } %>
<%= f.input :post_ids_string, as: :text, label: "Posts" %>
<%= f.input :category, :collection => ["series", "collection"], :include_blank => true, :selected => "", :required => true %>
<%= f.input :is_active %>
<%= f.button :submit, "Submit" %>