Skip to content

Instantly share code, notes, and snippets.

@ethicalhack3r
Created March 26, 2014 14:22
Show Gist options
  • Save ethicalhack3r/9784512 to your computer and use it in GitHub Desktop.
Save ethicalhack3r/9784512 to your computer and use it in GitHub Desktop.
# PATCH/PUT /submits/1
# PATCH/PUT /submits/1.json
def update
respond_to do |format|
if @submit.status == 'PENDING'
if @submit.update(submit_params)
format.html { redirect_to @submit, notice: 'Submission was successfully updated.' }
format.json { head :no_content }
end
else
format.html { render action: 'edit' }
format.json { render json: @submit.errors, status: :unprocessable_entity }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment