Move related list partial to a component
This way the code is easier to follow; the code checking whether the list has contents is in the partial rendering the list. We also remove some duplication setting up related content in the controllers. For some reason, we have to manually ignore i18n keys which were automatically ignored when the code was in the view.
This commit is contained in:
@@ -29,7 +29,6 @@ class ProposalsController < ApplicationController
|
||||
super
|
||||
@notifications = @proposal.notifications
|
||||
@notifications = @proposal.notifications.not_moderated
|
||||
@related_contents = Kaminari.paginate_array(@proposal.relationed_contents).page(params[:page]).per(5)
|
||||
|
||||
if request.path != proposal_path(@proposal)
|
||||
redirect_to proposal_path(@proposal), status: :moved_permanently
|
||||
|
||||
Reference in New Issue
Block a user