Add to_param to the Track model

And update the urls
This commit is contained in:
AEtherC0r3 2017-07-07 00:21:26 +03:00 committed by Stella Rouzi
parent 68fc750e9f
commit 9671696adf
10 changed files with 33 additions and 27 deletions

View file

@ -9,7 +9,7 @@
Track
.row
.col-md-12
= semantic_form_for(@track, url: (@track.new_record? ? conference_program_tracks_path : conference_program_track_path(@conference.short_title, @track.short_name))) do |f|
= semantic_form_for(@track, url: (@track.new_record? ? conference_program_tracks_path : conference_program_track_path(@conference.short_title, @track))) do |f|
= f.input :name
= f.input :short_name, hint: "A short and unique handle for the track, using only letters, numbers, underscores, and dashes. This will be used to identify the track in URLs etc. Example: 'my_awesome_track'", input_html: { required: 'required', pattern: '[a-zA-Z0-9_-]+', title: 'Only letters, numbers, underscores, and dashes.' }
= f.input :color, input_html: {size: 6, type: 'color'}, required: true

View file

@ -21,7 +21,7 @@
- @tracks.each do |track|
%tr
%td
= link_to(conference_program_track_path(@conference.short_title, track.short_name)) do
= link_to(conference_program_track_path(@conference.short_title, track)) do
= track.name
%td
= track.short_name
@ -34,7 +34,7 @@
%td
= track.state
%td
= link_to 'Edit', edit_conference_program_track_path(@conference.short_title, track.short_name),
= link_to 'Edit', edit_conference_program_track_path(@conference.short_title, track),
method: :get, class: 'btn btn-primary'
.row

View file

@ -23,4 +23,4 @@
= @track.description
.row
.col-md-12.text-right
= link_to 'Edit Track request', edit_conference_program_track_path(@conference.short_title, @track.short_name), class: 'btn btn-primary'
= link_to 'Edit Track request', edit_conference_program_track_path(@conference.short_title, @track), class: 'btn btn-primary'