Models II Step one


#1

https://www.codecademy.com/courses/learn-rails/lessons/one-many/exercises/one-many-models-ii?action=lesson_resume

Thought I did it right...

class CreateTags < ActiveRecord::Migration
  def change
    create_table :tags do |t|

      t.timestamps
      t.title
      t.image
    end
  end
end

#2

To create a column, you must specify its type like this: t.text or t.string or t.integer, follow it by :symbol - to name this column "symbol". For example, if you were to add a column named user_id of type integer, you would do it like this: t.integer :user_id


#3

Ummm....

class Tag < ActiveRecord::Base
	has_many :destinations
  t.string :title
  t.string :image
end

#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.