4

I haven't found any example of how to make a dynamic form for a field which is a Postgresql array.

I want to fill it dynamically using Mustache.js. I have done it before but with a string field using a json string.

I am using ruby2.0, rails4.0 and postgresql9.1.

Thank you very much.

1 Answer 1

2

You can insert the Array values into a form with:

<input type = 'textbox' name = 'model[array_column_name][:item_1, :item_2...]'>

params['model']['array_column_name']

I'm not familiar with mustache.js but the above should give you a rough understanding on how to implement a form with a PostgreSQL Array.

1
  • sorry to necro bump, but what the heck is type textbox? I've never heard of that and can't find any info on it... Commented Nov 7, 2017 at 17:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.