Give us a clue. Are you getting an error of some sort? If so it
might be helpful to tell us what it is, we are not telepathic (at
least I am not). Don't forget to show us the bit of code generating
the error if any.
Essentially A customer may have many managers. A Manager is assign to
one tv_show
What his wrong with my code?
Give us a clue. Are you getting an error of some sort? If so it
might be helpful to tell us what it is, we are not telepathic (at
least I am not). Don't forget to show us the bit of code generating
the error if any.
Colin
Sorry,
I am using activeadmin has a backend. When creating a new manager, on
the field Customer I see customer, but when it comes to show possible
tv_show it show me #<TvShow:0xb69ca84 which i am assuming is making a
reference to memory because the relations don't work. Not to sure how to
test it in Ruby console otherwise
Is it your code that is showing it wrong or is it inside activeadmin?
If it is your code then show us the bit of code displaying it. If it
is activeadmin then I can't help I am afraid.
I believe it is active_admin, but i am just wondering if the Association
above seem to be correct, or i am totally missing the point of ruby on
rails association, like did i make mistake
It looks ok to me.
Colin
I come from mySQL where I would have 3 tables
Customer TvShowManager TvShow
JOHN JEAN tv_show_id(1) 1 Simpson
HEATHER JEAN tv_show_id(2) 2 Familly Guy
JASON JASON tv_show_id(3) 3 Simpson
HEATHER tv_show_id(4) 4 Batman
HEATHER tv_show_id(5) 5 Stargate
Customer may have many tv_show_managers, and many tv_show through
tv_show_managers
As I said it looks ok to me. Show us your db/schema.rb
Colin
This is my schema
# encoding: UTF-8
# This file is auto-generated from the current state of the database.
Instead
# of editing this file, please use the migrations feature of Active
Record to
# incrementally modify your database, and then regenerate this schema
definition.
When I do an association, I create an association by integer id field
correct? If i want to see in my form how to see the description instead
of the id how would i proceed?
To answer such basic questions I suggest you work right through some
rails tutorials. railstutorial.org is good and is free to use online.
Work right through, entering the code and checking that it works,
including doing all the exercises and then you will have a good grasp
of the basics of rails and will be able to answer these questions
yourself.