Restricting Messages to an Event
Since we want the messages to constitute a forum for a given event, we’ll have to modify the scaffolded views to limit the viewing and creating of TekMessage instances to the TekEvent they relate to. It’s important to note that the relationship between TekEvent and TekMessage is already established in the domain model; we’re just going to make the workflow match that relationship.
We’ll start by modifying the event show view. We’re going to add a single “Messages” hyperlink that will lead to the message list view, and we are going to filter the list to show only those TekMessage instances that are related to the TekEvent.
Open TekDays/grails-app/views/tekEvent/show.gsp, and add the following code below the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access