As the subject says, columns are appearing for my associations, but
the values are not being populated for each record. Rather, each
record has the "Create New" link. I am very new to RoR and AS, so
please bear with me because it's likely a handful of rookie mistakes
I'm making.
Here are my two models:
class Instance < ActiveRecord::Base
has_one :elb
end
class Elb < ActiveRecord::Base
belongs_to :instance
end
The foreign key is located in the elbs table, and it is called
"instance_id", so I did not expect there to be a problem with those
defaults. And based on all the tutorials and examples I have seen, I
didn't think much more needed to be included in the associations.
Notably, the select menu on the field_search page is populating with
the elb values (there are duplicates though, in case that provides
some useful info; I'd like to remove those duplicates in the dropdown
though.)
To get around the problem temporarily and as a trouble-shooting step,
I made a virtual field in the Instance model, and that worked using
this code in the model:
def elb_column
@elb = Elb.find(:first, :conditions => ["instance_id = ?",
instance_id ])
@elb.elb_id if @elb
end
The virtual elb_column is populating with the values, but I could not
figure out how to get AS to search within the virtual column. I will
have to make a virtual column for a different reason, so if you have
any advice, please let me know.
To summarize, since there are a few problems I'm running into:
1) I'm not sure why the association columns are not populating with
the records' values
2) How to search within a virtual column
3) How to remove duplicates from a select dropdown in the search page.
Thank you very much for the help!
Jay
--
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en.