Symbol called like a method?


#1

Page : https://www.codecademy.com/courses/learn-rails/lessons/one-many/exercises/one-many-models-ii?page=3
Open db/migrate/first file

Hello,

I’m wondering about the use of the symbols in this part of the course.
Look at the page, we use this:

def change
create_table :tags do |t|
t.string :title
t.string :image
t.timestamps
end

Then, later, we call the symbols like methods:

t.title
t.image

How can this happen ? title and image aren’t methods, right ?


#2

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