Created
September 7, 2014 12:56
-
-
Save kkd927/1ba6c09f833c20260033 to your computer and use it in GitHub Desktop.
upload video with paperclip (reports_controller.rb)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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