app/controllers/shifts_controller.rb
def show
    begin
      @shift = Shift.find(params[:id])
    rescue ActiveRecord::RecordNotFound
      respond_to do |format|
        format.html #freak out
        format.js do
          render :update do |page|
            ajax_alert(page, "<strong>Error (404):</strong> shift ##{params[:id]} cannot be found. Please refresh the current page.".html_safe)
            page.hide "tooltip"
          end
        end
      end
    else
      return unless require_department_membership(@shift.department)
    end
  end
# TODO: verify that it can be removed
# Necessary? -ben
# No, but since the shifts view is broken,i'm using this.
verify that it can be removed
Necessary. -ben
No, but since the shifts view is broken,i'm using this.
verify that it can be removed Necessary . - ben No but since the shifts view is broken i ' m using this .
def show
    begin
      @shift = Shift.find(params[:id])
    rescue ActiveRecord::RecordNotFound
      respond_to do |format|
        format.html 
        format.js do
          render :update do |page|
            ajax_alert(page, "<strong>Error (404):</strong> shift ##{params[:id]} cannot be found. Please refresh the current page.".html_safe)
            page.hide "tooltip"
          end
        end
      end
    else
      return unless require_department_membership(@shift.department)
    end
  end
def show begin @shift = Shift . find ( params [ :id ] ) rescue ActiveRecord :: RecordNotFound respond_to do | format | format . html format . js do render :update do | page | ajax_alert ( page , "<strong>Error (404):</strong> shift ##{params[:id]} cannot be found. Please refresh the current page." . html_safe ) page . hide "tooltip" end end end else return unless require_department_membership ( @shift . department ) end end
TODO: verify that it can be removed
Necessary?
TODO : verify that it can be removed Necessary?
#freak out