I’ve list of features.
class Feature < ActiveRecord::Base
has_many :assets, dependent: :destroy
and assets, that belongs to feature:
class Asset < ActiveRecord::Base
validates :feature_id, presence: true
i have one sample feature in db, and a link to show assets for this
Now, when i follow the link, list of assets is shown. Actually it is
as there are no assets in database. I need to show what feature this
are belongs to (there’re no assets, but that shouldn’t make any
I’ve tried with this:
Listing Assets for <%= asset.feature.try(:engtitle) %>
undefined local variable or method `asset’ for
Listing Assets for <%= @feature.try(:engtitle) %>
raising exception, but there’s definitely engtitle for this feature in
What am i doing wrong?