Forum: Ruby on Rails second table column data lift

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Craig W. (Guest)
on 2006-02-07 02:42
(Received via mailing list)
have placements, clients and case_managers tables with relationships

Trying to create new placement record...case_manager_id field exists in
clients table. I need the value from related clients record in
placements table

in placements_controller.rb

def create
  @placement =[:placement])
  case_manager_id = Client.case_manager_id  # this doesn't work
    flash[:notice] = 'Placement was successfully created'
    redirect_to :action => 'list'
    render :action => 'new'

How do I get the case_manager_id value from the related record since I
am already storing the client_id (the foreign key) because I need the
foreign key for case_manager_id or I cannot save?

This topic is locked and can not be replied to.