Skip to content

Commit ae3d826

Browse files
author
Kazunori Sakamoto
committed
Fix redirect call. Add maxlength in input texts. Close #248 Close #249
1 parent d647d2c commit ae3d826

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

app/controllers/contests/problems_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def submit
4343
file = params[:files]
4444

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

4848
problem = Problem.find(params[:id])
4949
input_type = params[:input_type]

app/views/groups/_form.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
<div class="field">
1515
<%= f.label :name %><br>
16-
<%= f.text_field :name %>
16+
<%= f.text_field :name, { maxlength: 50 } %>
1717
</div>
1818
<div class="actions">
1919
<%= f.submit %>

app/views/users/_edit_form.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
<div class="field">
1515
<%= f.label :name, 'User Name' %><br>
16-
<%= f.text_field :name %>
16+
<%= f.text_field :name, { maxlength: 50 } %>
1717
</div>
1818
<div class="actions">
1919
<%= f.submit %>

0 commit comments

Comments
 (0)