Corrections in SchedulesController
- Controler file name pluralized - Load and authorization fixed and improved - Consider that save can fail in create action - Eliminate unnecessary if in update action - Ability and tests related to the schedules link in the admin sidebar fixed
This commit is contained in:
parent
2e1cd164a4
commit
29b920d746
9 changed files with 67 additions and 69 deletions
|
|
@ -28,5 +28,5 @@
|
|||
|
||||
.row
|
||||
.col-md-12.text-right
|
||||
= link_to 'Add Schedule', admin_conference_schedule_index_path(@conference.short_title),
|
||||
= link_to 'Add Schedule', admin_conference_schedules_path(@conference.short_title),
|
||||
method: :post, class: 'btn btn-primary'
|
||||
|
|
@ -8,8 +8,8 @@
|
|||
.row
|
||||
.col-md-2
|
||||
Selected schedule
|
||||
= check_box_tag @conference.short_title, @schedule_id, (@schedule_id == @selected_schedule_id),
|
||||
method: :put, url: (admin_conference_schedule_path(@conference.short_title, @schedule_id) + '?selected_schedule='),
|
||||
= check_box_tag @conference.short_title, @schedule.id, (@schedule.id == @selected_schedule.try(:id)),
|
||||
method: :put, url: (admin_conference_schedule_path(@conference.short_title, @schedule) + '?selected_schedule='),
|
||||
class: 'switch-checkbox', data: { size: 'small',
|
||||
off_color: 'warning',
|
||||
on_text: 'Yes',
|
||||
|
|
@ -32,5 +32,5 @@
|
|||
|
||||
:javascript
|
||||
$(document).ready( function() {
|
||||
Schedule.initialize("#{admin_conference_event_schedule_index_path(@conference)}", "#{@schedule_id}");
|
||||
Schedule.initialize("#{admin_conference_event_schedule_index_path(@conference)}", "#{@schedule.id}");
|
||||
});
|
||||
|
|
@ -81,9 +81,9 @@
|
|||
- if can? :update, @conference.program.difficulty_levels.build, conference_id: @conference.id
|
||||
%li{:class=> active_nav_li(admin_conference_program_difficulty_levels_path(@conference.short_title))}
|
||||
= link_to 'Difficulty Levels', admin_conference_program_difficulty_levels_path(@conference.short_title)
|
||||
- if can? :update, @conference.program.events.build
|
||||
%li{class: active_nav_li(admin_conference_schedule_index_path(@conference.short_title))}
|
||||
= link_to 'Schedules', admin_conference_schedule_index_path(@conference.short_title)
|
||||
- if can? :update, @conference.program.schedules.build
|
||||
%li{class: active_nav_li(admin_conference_schedules_path(@conference.short_title))}
|
||||
= link_to 'Schedules', admin_conference_schedules_path(@conference.short_title)
|
||||
|
||||
- if can? :update, Registration.new(conference_id: @conference.id)
|
||||
%li{:class=> active_nav_li(admin_conference_registrations_path(@conference.short_title))}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue