Displaying 3 results from an estimated 3 matches for "subject_group".
2006 Jul 14
6
Get a collection through ActiveRecord for using with option_groups_from_collection_for_select
...am having some difficulties with ActiveRecord.
What I want to do is to get a collection of SubjectGroups for using
with option_groups_from_collection_for_select
My Code:
========================================
class Subject < ActiveRecord::Base
has_and_belongs_to_many :users
belongs_to :subject_group
end
class SubjectGroup < ActiveRecord::Base
has_many :subjects
end
@subjects= Subject.find(:all, :include => :subject_group)
@groups= SubjectGroup.find(:all, :include => :subjects)
The first find instruction runs just fine, the second gives me the
following error:
You have a nil obje...
2009 Jan 25
1
Multiple lattice plots on a page: aligning x-axes vertically
...possible to create a new panel function
that does a panel.xyplot and panel.densityplot on slightly different
data?).
Thanks.
Daniel
## BEGIN Example
#OS: Mac OS X 10.5.5; R: 2.8.1; lattice 0.17-20
library(reshape)
library(lattice)
plotdensitymeans <-
function(data,measure,factors=c('subject_group','task'),
xlab="",xlim=NULL, ...) {
# Create means by subject
x.melted <- melt(data, id.var = append(factors,'subject_ID'),
measure.var=measure,na.rm=T)
formula.bysubject.cast <- paste(factors[1],"+",factors[2],"+
subject_ID...
2006 Sep 01
2
Mrelation does not exists
...jects_user])
subject.save
The models:
class User < ActiveRecord::Base
has_one :last_entrie
has_one :address_book
has_and_belongs_to_many :subjects
has_one :user_detail
has_and_belongs_to_many :subjects
end
class Subject < ActiveRecord::Base
has_and_belongs_to_many :users
belongs_to :subject_group
end
class SubjectsUser < ActiveRecord::Base
end
Thank you for your attention,
Paulo Abreu
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email t...