Files
nairobi/app/controllers/sdg_management/relations_controller.rb
Javi Martín ed51c5dcd3 Add basic SDG Management content section
Note using `params[:relatable_type].classify` is recognized as a
security risk by some tools. However, it's a false positive, since we've
added constraints to the URL so that paramenter can only have the values
we trust.
2020-12-21 18:04:48 +01:00

12 lines
283 B
Ruby

class SDGManagement::RelationsController < SDGManagement::BaseController
def index
@records = relatable_class.accessible_by(current_ability).order(:id).page(params[:page])
end
private
def relatable_class
params[:relatable_type].classify.constantize
end
end