Skip to content

Instantly share code, notes, and snippets.

@kkd927
Created September 7, 2014 12:56
Show Gist options
  • Save kkd927/1ba6c09f833c20260033 to your computer and use it in GitHub Desktop.
Save kkd927/1ba6c09f833c20260033 to your computer and use it in GitHub Desktop.
upload video with paperclip (reports_controller.rb)
# POST /reports
# POST /reports.json
def create
@report = current_user.reports.build(report_params)
respond_to do |format|
if @report.save
format.html { redirect_to @report, notice: 'Report was successfully created.' }
else
format.html { render action: 'new' }
end
end
end
private
def report_params
params.require(:report).permit(:title, :date...) # write params you permit
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment