I now have:
= link_to 'Back <', @discussable
And @discussable could be a course with a title, or a group with a name(I wish I used the same name). So I want to display “Back to *course_title*” or “Back to *group_name*” depending on the @discussable type. How do I do that? Thanks!
In your models, you can create a method that each model has to respond to, such as
def title, and from there you would call that.Example:
Then you would just do: