class TimingsController < MyplaceonlineController
  def show_add
    false
  end
  
  def footer_items_show
    super + [
      {
        title: I18n.t('myplaceonline.timings.timing_events'),
        link: timing_timing_events_path(@obj),
        icon: "bars"
      },
      {
        title: I18n.t('myplaceonline.timings.add_timing_event'),
        link: new_timing_timing_event_path(@obj),
        icon: "plus"
      }
    ]
  end
  
  protected
    def insecure
      true
    end

    def sorts
      ["lower(timings.timing_name) ASC"]
    end

    def obj_params
      params.require(:timing).permit(
        :timing_name,
        :notes,
        timing_events_attributes: [:id, :_destroy, :timing_event_start, :timing_event_end, :notes]
      )
    end
end

class TimingsController < MyplaceonlineController
  def show_add
    false
  end
  
  def footer_items_show
    [
      {
        title: I18n.t('myplaceonline.timings.add_timing_event'),
        link: new_timing_timing_event_path(@obj),
        icon: "plus"
      },
      {
        title: I18n.t('myplaceonline.timings.timing_events'),
        link: timing_timing_events_path(@obj),
        icon: "bars"
      },
    ] + super
  end
  
  protected
    def insecure
      true
    end

    def sorts
      ["lower(timings.timing_name) ASC"]
    end

    def obj_params
      params.require(:timing).permit(
        :timing_name,
        :notes,
        timing_events_attributes: [:id, :_destroy, :timing_event_start, :timing_event_end, :notes]
      )
    end
end

Make it easier to add a timing event
Make it easier to add a timing event
