mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-09 07:28:41 -07:00
adding slugs to schools and categories
This commit is contained in:
parent
683fc31c5d
commit
1db61cd3e5
13 changed files with 42 additions and 12 deletions
|
|
@ -68,12 +68,12 @@ class CategoriesController < ApplicationController
|
|||
private
|
||||
def set_school
|
||||
redirect_to root_path and return false unless params.include?(:school_id)
|
||||
@school = School.find(params[:school_id])
|
||||
@school = School.friendly.find(params[:school_id])
|
||||
redirect_to root_path and return false if @school.nil?
|
||||
end
|
||||
|
||||
def set_category
|
||||
@category = Category.find(params[:id])
|
||||
@category = Category.friendly.find(params[:id])
|
||||
end
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class QuestionsController < ApplicationController
|
|||
private
|
||||
def set_school
|
||||
redirect_to root_path and return false unless params.include?(:school_id)
|
||||
@school = School.find(params[:school_id])
|
||||
@school = School.friendly.find(params[:school_id])
|
||||
redirect_to root_path and return false if @school.nil?
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class RecipientListsController < ApplicationController
|
|||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_school
|
||||
@school = School.find(params[:school_id])
|
||||
@school = School.friendly.find(params[:school_id])
|
||||
end
|
||||
|
||||
def set_recipient_list
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ class RecipientsController < ApplicationController
|
|||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_school
|
||||
@school = School.find(params[:school_id])
|
||||
@school = School.friendly.find(params[:school_id])
|
||||
end
|
||||
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class SchedulesController < ApplicationController
|
|||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_school
|
||||
@school = School.find(params[:school_id])
|
||||
@school = School.friendly.find(params[:school_id])
|
||||
end
|
||||
|
||||
def set_schedule
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class SchoolsController < ApplicationController
|
|||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_school
|
||||
@school = School.find(params[:id] || params[:school_id])
|
||||
@school = School.friendly.find(params[:id] || params[:school_id])
|
||||
end
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue