[Solved] What is # on Ruby on Rails?

[ad_1]

@name represents an array of single object of Quest model. To get the id of that object, use

 <p><%= @name.first.id %></p>

or change your controller code to

@name = Quest.where(category: 'cat1').sample

and then do

<p><%= @name.id %></p>

[ad_2]

solved What is #<..> on Ruby on Rails?