Forum: JRuby how to get username

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.
D3a9d4230cf378d2aac66a99738fd845?d=identicon&s=25 Veerendra P. (veerendra_p)
on 2013-07-18 13:03
Hi ,

i have a class "members" it has memberid,firstname,lastname and email
and there is another class "risks" in tht memberid is referenced and
storing the database table,now i want to show in risks report member
name based on the memberid,

I am new to Jruby,
 please help on this.

Veerendra Patil
Karol Bucek (Guest)
on 2013-07-19 15:00
(Received via mailing list)
Hi Veerendra, do it the same way as in Ruby :)

If you're new do that one as well you need to choose an ORM ...
assuming you use Rails/ActiveRecord you do something like :

class Member < ActiveRecord::Base
  has_one :risk

class Risk < ActiveRecord::Base
  belongs_to :member

id = params[:memberid]
member = Member.find(id)

puts( member.firsname << ' ' << member.lastname << ' ' << )

Next time - maybe with a few details (the more details the better
ask this on he Rails user mailing list
or start somewhere here:

Have a great week-end, K.
This topic is locked and can not be replied to.