I\'m still quite new to Rails so hopefully this isn\'t a silly question.
I have two models: User and Chore. User has_one chore, and Chore belongs to User
<
Here's another option that uses Rails' Delegate module:
class User < ActiveRecord::Base has_one :chore delegate :name, to: :chore, prefix: true, allow_nil: true end
This will allow you to call <%= user.chore_name %>, which will pass the name call onto chore, returning nil if there is none.
<%= user.chore_name %>
name
nil