I generated a user table using Acts_as_authenticated and a subject table, and I create a join table for them to build up the "has_and_belongs_to_many" relationship between them. This is what I want to have: After a user logins into the system, he can see a list of subjects and add a subject to his list ''user.subject'' simply by clicking a button besides the subject. Where do I define the method? Can I define it in the ''login'' controller generated by AAA plugin? Can anyone provide some examples or tutorial related to what I am trying to do? Many thanks. -- Posted via http://www.ruby-forum.com/.
hao min
2006-Jun-19 16:16 UTC
[Rails] Re: Add subjects to my user subject. Linking two tables
anyone? please help -- Posted via http://www.ruby-forum.com/.
Dark Ambient
2006-Jun-19 16:34 UTC
[Rails] Re: Add subjects to my user subject. Linking two tables
Newb here but I''ll try to be a good ritizen. user model must contain at minimum :has many :subjects model subject belongs_to :user that will start you off. Hopefully that is what your looking for, your question was rather brief. Stuart On 6/19/06, hao min <mh.pinkoan@gmail.com> wrote:> > anyone? please help > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Reasonably Related Threads
- How to call database variables from "Public" folder?
- Storing additional data on join tables with Rails
- Once I added this HABTM, one of my 'through' relationships, on a non-habtm model, seems to have broke?
- help with join tables and has_and_belongs_to_many
- HABTM count table