Fix authorization for communitySolutionsIndex
This commit is contained in:
@ -11,7 +11,7 @@ class CommunitySolutionsController < ApplicationController
|
|||||||
|
|
||||||
# GET /community_solutions
|
# GET /community_solutions
|
||||||
def index
|
def index
|
||||||
@community_solutions = CommunitySolution.all
|
@community_solutions = CommunitySolution.all.paginate(page: params[:page], per_page: per_page_param)
|
||||||
authorize!
|
authorize!
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ class CommunitySolutionsController < ApplicationController
|
|||||||
private
|
private
|
||||||
|
|
||||||
def authorize!
|
def authorize!
|
||||||
authorize(@community_solution)
|
authorize(@community_solution || @community_solutions)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Use callbacks to share common setup or constraints between actions.
|
# Use callbacks to share common setup or constraints between actions.
|
||||||
|
@ -1,19 +1,16 @@
|
|||||||
h1 Listing community_solutions
|
h1 = t('activerecord.models.community_solution.other')
|
||||||
|
|
||||||
table
|
.table-responsive
|
||||||
|
table.table.mt-4
|
||||||
thead
|
thead
|
||||||
tr
|
tr
|
||||||
th
|
th = t('activerecord.attributes.exercise.title')
|
||||||
th
|
th colspan=1 = t('shared.actions')
|
||||||
th
|
|
||||||
|
|
||||||
tbody
|
tbody
|
||||||
- @community_solutions.each do |community_solution|
|
- @community_solutions.each do |community_solution|
|
||||||
tr
|
tr
|
||||||
td = link_to 'Show', community_solution
|
td = community_solution.exercise.title
|
||||||
td = link_to 'Edit', edit_community_solution_path(community_solution)
|
td = link_to 'Edit', edit_community_solution_path(community_solution)
|
||||||
td = link_to 'Destroy', community_solution, data: { confirm: 'Are you sure?' }, method: :delete
|
|
||||||
|
|
||||||
br
|
= render('shared/pagination', collection: @community_solutions)
|
||||||
|
|
||||||
= link_to 'New Community solution', new_community_solution_path
|
|
||||||
|
Reference in New Issue
Block a user