Friendly urls for tracks
Don't use tracks ids in urls Add short_name to tracks and use that in urls as the identifier
This commit is contained in:
parent
882a1d20c9
commit
95fbd10153
9 changed files with 61 additions and 8 deletions
|
|
@ -2,7 +2,7 @@ module Admin
|
|||
class TracksController < Admin::BaseController
|
||||
load_and_authorize_resource :conference, find_by: :short_title
|
||||
load_and_authorize_resource :program, through: :conference, singleton: true
|
||||
load_and_authorize_resource through: :program
|
||||
load_and_authorize_resource through: :program, find_by: :short_name
|
||||
|
||||
def index; end
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ module Admin
|
|||
private
|
||||
|
||||
def track_params
|
||||
params.require(:track).permit(:name, :description, :color)
|
||||
params.require(:track).permit(:name, :description, :color, :short_name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue