def update
      self.resource = find_resource
      
      respond_to do |format|
        if resource.update( resource_params )
          format.html { redirect_to resource_url, notice: "#{resource_name.humanize} was successfully updated." }
          format.js
          format.json { render :show, status: :ok, location: resource_url }
        else
          format.html { render :edit }
          format.js   { render :edit }
          format.json { render json: resource.errors, status: :unprocessable_entity }
        end
      end
    end
def update
      self.resource = find_resource
      
      respond_to do |format|
        if resource.update( resource_params )
          format.html { redirect_to resource_url, notice: "#{resource_name.humanize} was successfully updated." }
          format.js
          format.json { render :show, status: :ok, location: resource_url }
        else
          format.html { render :edit }
          format.js   { render :edit }
          format.json { render json: resource.errors, status: :unprocessable_entity }
        end
      end
    end
PATCH/PUT /events/1
 PATCH/PUT /events/1.json