I have this model "Schedule" with attributes :id, :augurid, #and so on
.
And I have another model "Augur" with attributes :id, :name, :email #and so on
.
Now I want to display augur.name in the Schedule page in Rails_Admin, and my code is like following:
config.model "Schedule" do
list do
fields :id, :weekdays, :occupied, :starting, :duration
field :augur do
pretty_value do
augur = Augur.find(:augurid)
augur.name
end
end
end
edit do
fields :id, :augurid, :weekdays, :occupied, :starting, :duration
end
show do
end
end
But this code is not working, I don't know why since I'm new to rails, and I've checked the documentation of rails_admin, and looks like there's no solution to this problem.
Can anyone help me?
And I think the problem is around
augur = Augur.find(:augurid),
because if I change the :augurid to 5, it will display the right augur name. But how do I do that for every record in schedule?