I am trying to use <filter-menu> to filter the index page of one of my
controllers. It works for object that are a part of the model directly,
but does not work for any of the child objects. Code examples below:
======================================
class Plant < ActiveRecord::Base
hobo_model # Don't put anything above this
fields do
name :string
timestamps
end
has_many :bloom_color, :through => :bloom_color_assignments, :accessible
=> true
has_many :bloom_color_assignments, :dependent => :destroy
children :bloom_color
<--cut-->
end
======================================
class BloomColor < ActiveRecord::Base
hobo_model # Don't put anything above this
fields do
name :string
timestamps
end
validates_presence_of :name
set_default_order "name"
has_many :plants, :through => :bloom_color_assignments
has_many :bloom_color_assignments, :dependent => :destroy
children :plants
<--cut-->
end
======================================
class BloomColorAssignment < ActiveRecord::Base
hobo_model # Don't put anything above this
fields do
timestamps
end
belongs_to :plant
belongs_to :bloom_color
<--cut-->
end
======================================
I started out with something along the lines of:
======================================
Plant.apply_scopes(:bloom_color_is => params[:bloomcolor])
======================================
in my controller, but get a "undefined method :bloom_color_is...." error.
Sorry if I have made any mistakes or haven't followed any conventions or
best practices here. I am new to both Hobo and Rails. What would you
suggest I do to correct this, or to do better?
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/hobousers/-/MWDKBItdQ7IJ.
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/hobousers?hl=en.