Skip to content

steventen/postgresql-array

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Example of PostgreSQL's Array Feature in Rails

It includes only one model: Group, which has a tags field

tags field is declared as: t.text "tags", default: [], array: true

The input field accepts multiple tags separated by newline.

It removes duplicate tags when saving to database.

Remove Curly Brace

By default, Rails shows curly braces {} in the text input field of the form.

Check Group#formated method and _form.html.erb for the changes I made.

Issue

This example only works with Rails 4.2.0.rc1, but fails on 4.2.0

Testing

The testing code indicate that with Rails 4.2.0, the array could not create.

About

Example of PostgreSQL's Array Feature in Rails

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages