How to get the value of a field from another table with ruby on Rails

Asked

Viewed 233 times

1

Hello, the question is this: I have classes that use data from other classes, I need you to load the values registered in these other classes, show this in an html page. This is the structure of a class that receives data from other classes.

	field :name, type: String
	field :acronym, type: String
	field :popular_names, type: Array
	field :description, type: String
	field :free, type: Boolean
	field :applicants, type: Array
	field :estimated_time, type: Hash
	field :steps, type: Array
	field :permalink, type: String
	field :other_informations, type: String

	belongs_to :organ, class_name: "Admin::Organ"
	has_and_belongs_to_many :units, class_name: "Admin::Unit"
	has_and_belongs_to_many :audiences, class_name: "Admin::Audience"
	has_and_belongs_to_many :categories, class_name: "Admin::Category"

	before_save :touch_permalink

	search_in :name, :popular_names
and I would like it to be shown in an html page, I know you are saving in the bank, but I am not able to recover the data of these foreignkeys

  • I think you need to elaborate more on your situation...

  • only access by relationships. <%= casa.comodo.cama.valor %>

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.