def show
      begin
        @datatable = EffectiveDatatables.find(params[:id])
        @datatable.view = view_context

        EffectiveDatatables.authorize!(self, :index, @datatable.collection_class)

        render json: @datatable.to_json
      rescue => e
        EffectiveDatatables.authorized?(self, :index, @datatable.try(:collection_class))
        render json: error_json(e)

        ExceptionNotifier.notify_exception(e) if defined?(ExceptionNotifier)
        raise e if Rails.env.development?
      end
    end
def show
      begin
        @datatable = EffectiveDatatables.find(params[:id])
        @datatable.view = view_context

        EffectiveDatatables.authorize!(self, :index, @datatable.collection_class)

        render json: @datatable.to_json
      rescue => e
        EffectiveDatatables.authorized?(self, :index, @datatable.try(:collection_class))
        render json: error_json(e)

        ExceptionNotifier.notify_exception(e) if defined?(ExceptionNotifier)
        raise e if Rails.env.development?
      end
    end
def show begin @datatable = EffectiveDatatables . find ( params [ :id ] ) @datatable . view = view_context EffectiveDatatables . authorize! ( self , :index , @datatable . collection_class ) render json : @datatable . to_json rescue => e EffectiveDatatables . authorized? ( self , :index , @datatable . try ( :collection_class ) ) render json : error_json ( e ) ExceptionNotifier . notify_exception ( e ) if defined? ( ExceptionNotifier ) raise e if Rails . env . development? end end
This will respond to both a GET and a POST
This will respond to both a GET and a POST