This worked a treat - all fixed. Thank you so much Bryan! cheers Lloyd
On Saturday, January 5, 2013 5:38:43 AM UTC, Bryan Larsen wrote: > > The agility tutorial has not been updated for Hobo 2.0 or current > Rails yet. I'm slowly working my way through the documentation and > am about half done. Unfortunately the tutorial is in the half that > isn't done. > > You need to add your associations to your attr_accessible for them to > be visible on the forms. You probably don't need all of what I'm > adding below, but you will need some: > > > On Fri, Jan 4, 2013 at 8:49 AM, kiwi lloyd <[email protected]<javascript:>> > wrote: > > Hi > > I am having real problems getting the Accessible Associations to work in > the > > Hobo Agility Tutorial. I have walked through the tutorial and have got > > stuck on the "Associations" section - the javascript control to > associate > > "users" to "tasks" doesn't appear. I am logged in as admin. > > > > Any help would be really appreciated as I don't know how to track down > the > > problem. Thanks very much. > > > > Below are the main gems and model files. Screen shot is attached. > > > > gem 'rails', '3.2.10' > > gem "hobo", "= 2.0.0.pre7" > > gem "will_paginate", :git => "git://github.com/Hobo/will_paginate.git" > > gem "hobo_jquery_ui", "2.0.0.pre7" > > gem "hobo_clean", "2.0.0.pre7" > > gem "jquery-ui-themes", "~> 0.0.4" > > gem "hobo_clean_admin", "2.0.0.pre7" > > > > tasks.rb > > class Task < ActiveRecord::Base > > > > hobo_model # Don't put anything above this > > > > fields do > > description :string > > timestamps > > end > > belongs_to :story, :inverse_of => :tasks > > has_many :task_assignments, :dependent => :destroy, :inverse_of => > :task > > has_many :users, :through => :task_assignments, :accessible => true, > > :dependent => :destroy > > > > attr_accessible :description > > attr_accessible :description, :story, :story_id, task_assignments, :users > > > ... > > > > users.rb > > class User < ActiveRecord::Base > > > > hobo_user_model # Don't put anything above this > > > > fields do > > name :string, :required, :unique > > email_address :email_address, :login => true > > administrator :boolean, :default => false > > timestamps > > end > > validates_presence_of :name > > has_many :task_assignments, :dependent => :destroy, :inverse_of => > :user > > has_many :tasks, :through => :task_assignments, :accessible => true, > > :dependent => :destroy > > > > attr_accessible :name, :email_address, :password, > :password_confirmation > > attr_accessible :name, :email_address, :password, > :password_confirmation, :task_assignments, :tasks > > > > ... > > task_assignments.rb > > class TaskAssignment < ActiveRecord::Base > > > > hobo_model # Don't put anything above this > > > > fields do > > timestamps > > end > > belongs_to :user, :inverse_of => :task_assignments > > belongs_to :task, :inverse_of => :task_assignments > > > > attr_accessible > > attr_accessible :task, :task_id, :user, :user_id > > > Bryan > -- 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/-/uch9t9XFn44J. 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.
