Home>

Date 1
Place 1
Content 1

Date 2
Place 2
Content 2


I would like to put a post form like

into the Post model
In this case, can I only make one column on db?

If i have any other method, would you like to professor m () m

  • Answer # 1

    The basics of this are explained in detail in 9 Creating Complex Forms in the Action View Form Helper in the Rails Guide. It's a good idea to read through the Action View Form Helper from the beginning.

    To summarize the points, instead of adding a column to the Posts table, you will have a separate table to store the date, location, and contents, and associate it with a record in the Posts table.

Related articles