0

Rails g scaffold Quantified {type:string (i.e. average or instance) name:string metric:string} result:decimal date:date

Do I use a :primary_key to help generate the below table? I put the main components in the above brackets.

I want the bracketed data types to be the headers of the table, then whenever a user submits a new _form that includes an existing type, name, & metric (i.e. primary_keys?) then the _form would add a new column reflecting the result & date to the preexisting row.

enter image description here

Here's what a similar table looks like live on my blog: http://www.anthonygalli.com/quantify/

Community
  • 1
  • 1
AnthonyGalli.com
  • 2,796
  • 5
  • 31
  • 80
  • Not sure I understand the question but rails will generate an `id` column to be used as a primary key. – engineersmnky Jan 05 '15 at 19:19
  • I couldn't figure out what primary_key does from what I read. I thought it would help me specify certain data types as being associated with other date types to help me create the table above from the command line. – AnthonyGalli.com Jan 06 '15 at 00:07

1 Answers1

0

No :primary_key was needed I used scope in the rb file instead.

AnthonyGalli.com
  • 2,796
  • 5
  • 31
  • 80