Doubts regarding image,name and description in Exe5 Show a Tag


#1

When we iterate through @destinations we use x.image, x.name and x.descriptions.Are name, image and descriptions variables we created in this particular project (I don't remember doing it :confused:) or rails creates them for any kind of models.


#2

Hi @mad_orange,

*.name, *.description, etc., are from the model we created. In db/migrate/date_model_name.rb. In that file, we set t.string :name, thus letting us access the @destination.name variable (assuming @destination is a variable containing a DB record).

Does that help? :slight_smile:


#3

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