Description:
- fix pdf loading fail
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r634:56cf4357ce2a - - 4 files changed: 11 inserted, 4 deleted
@@ -88,7 +88,7 | |||||
|
88 | flash[:notice] = 'Error: Uploaded file is not PDF' |
|
88 | flash[:notice] = 'Error: Uploaded file is not PDF' |
|
89 | render :action => 'edit' and return |
|
89 | render :action => 'edit' and return |
|
90 | end |
|
90 | end |
|
91 |
- if @problem.update_attributes( |
|
91 | + if @problem.update_attributes(problem_params) |
|
92 | flash[:notice] = 'Problem was successfully updated.' |
|
92 | flash[:notice] = 'Problem was successfully updated.' |
|
93 | unless params[:file] == nil or params[:file] == '' |
|
93 | unless params[:file] == nil or params[:file] == '' |
|
94 | flash[:notice] = 'Problem was successfully updated and a new PDF file is uploaded.' |
|
94 | flash[:notice] = 'Problem was successfully updated and a new PDF file is uploaded.' |
@@ -285,4 +285,10 | |||||
|
285 | def get_problems_stat |
|
285 | def get_problems_stat |
|
286 | end |
|
286 | end |
|
287 |
|
287 | ||
|
|
288 | + private | ||
|
|
289 | + | ||
|
|
290 | + def problem_params | ||
|
|
291 | + params.require(:problem).permit(:name, :full_name, :full_score, :date_added, :available, :test_allowed,:output_only, :url, :description) | ||
|
|
292 | + end | ||
|
|
293 | + | ||
|
288 | end |
|
294 | end |
@@ -118,7 +118,7 | |||||
|
118 | end |
|
118 | end |
|
119 | end |
|
119 | end |
|
120 | end |
|
120 | end |
|
121 |
- flash[: |
|
121 | + flash[:success] = 'User(s) ' + note.join(', ') + |
|
122 | ' were successfully created. ' + |
|
122 | ' were successfully created. ' + |
|
123 | '( (+) - created with random passwords.)' |
|
123 | '( (+) - created with random passwords.)' |
|
124 | redirect_to :action => 'index' |
|
124 | redirect_to :action => 'index' |
@@ -2,7 +2,8 | |||||
|
2 |
|
2 | ||
|
3 | <!--[form:problem]--> |
|
3 | <!--[form:problem]--> |
|
4 | <p><label for="problem_name">Name</label><br/> |
|
4 | <p><label for="problem_name">Name</label><br/> |
|
5 | - <%= text_field 'problem', 'name' %></p> |
|
5 | + <%= text_field 'problem', 'name' %> Do not directly edit the problem name, unless you know what you are doing. If you want to change the name, use the name change button in the problem management menu instead. |
|
|
6 | + </p> | ||
|
6 |
|
7 | ||
|
7 | <p><label for="problem_full_name">Full name</label><br/> |
|
8 | <p><label for="problem_full_name">Full name</label><br/> |
|
8 | <%= text_field 'problem', 'full_name' %></p> |
|
9 | <%= text_field 'problem', 'full_name' %></p> |
You need to be logged in to leave comments.
Login now