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

1

Hello, the question is this: I have classes that use data from other classes, I need them to load the values registered in those 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 would like it to be displayed on an html page, I know it's saving in the database, but I'm not able to retrieve the data from these foreignkeys     
asked by anonymous 04.03.2016 / 15:40

0 answers