I searched around the SOF and couldn't find a simple answer for my simple question.
I have two classes, Author and Book.
class Author < ActiveRecord::Base def greet puts "Hello, I'm #{name}." end def describe puts "That Author's name is #{name}. puts "This author wrote this book #{book}." #<--- I want to write this or combine it with the line above end end In class book, I don't have anything just
class Book < ActiveRecord::Base end
How can I puts the following: That Author's name is ... and This author wrote this ... when I enter Author.first.describe in the Rails console?
#{book}segment in your string? What have you attempted so far? More information and clarity would go a long way to helping us provide an answer for youbook_idwhich matches thebook_idin thebookstable.