customer but seem that the middle association doesn't works
Here my model
has_many :customers, :through => :book_managers
has_many :books, :through => :book_managers
The field are has follow
Book Customer book_manager
id id id
description email customer_id
When fetching the information in my def edit, the following is
@book = Book.first
@book = Book.last
The following seem to fails
@customer = Customer.find(params[:id])
@book = @customer.books.first
@book = @customer.books.order("created_at DESC").first
Is there something i miss?
I also try to verify by creating an index for book_manager controller
and view and nothing appears, its seems its empty. The way i created the
books was as follow
@book = current_customer.books.build(params[:book])
flash[:success] = "Book Created"
Posted via http://www.ruby-forum.com/.
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to firstname.lastname@example.org.
To unsubscribe from this group, send email to email@example.com.
For more options, visit https://groups.google.com/groups/opt_out.