Skip to content

Commit

Permalink
Fix redirect call. Add maxlength in input texts. Close #248 Close #249
Browse files Browse the repository at this point in the history
  • Loading branch information
Kazunori Sakamoto committed May 13, 2016
1 parent d647d2c commit ae3d826
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/contests/problems_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def submit
file = params[:files]

redirect_to({ action: 'index' }, alert: 'Contest is already closed.') and return if @contest.ended?
redirect_to({ action: 'show' }, alert: 'Too large file') if file && file.size > 100.kilobyte
redirect_to({ action: 'show' }, alert: 'Too large file') and return if file && file.size > 100.kilobyte

problem = Problem.find(params[:id])
input_type = params[:input_type]
Expand Down
2 changes: 1 addition & 1 deletion app/views/groups/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<div class="field">
<%= f.label :name %><br>
<%= f.text_field :name %>
<%= f.text_field :name, { maxlength: 50 } %>
</div>
<div class="actions">
<%= f.submit %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/users/_edit_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<div class="field">
<%= f.label :name, 'User Name' %><br>
<%= f.text_field :name %>
<%= f.text_field :name, { maxlength: 50 } %>
</div>
<div class="actions">
<%= f.submit %>
Expand Down

0 comments on commit ae3d826

Please sign in to comment.