I have Rails 5 app. And lets say I have this table (PG ORM):
class CreatePosts < ActiveRecord::Migration[5.0]
def change
create_table :posts do |t|
t.string :title
t.text :body
t.text :tags, array: true, default: []
t.timestamps
end
end
end
Now I'd like to see in my form text input with separated by commas tags. And when I hit 'save' button Rails would properly save it in array field. How can I do it?