notification.body = 'You posted a new <a href="' +
question_url(question.id) + ‘">question’
notification.save
end
comes up saying undefined method for question_url
Well, since url helpers are UI constructs, they really shouldn’t be
used directly by models. They are available in controllers and views.
I’d humbly suggest that the best way to solve this is to have the
UserNotification have a reference to the question, and then use
question_url in UserNotificationsController and/or it’s views.
This would properly keep the M-VC business logic-ui separation.