Never give up
Revision | 744bd53086c951941c450049c0fd40aa7c3b7824 (tree) |
---|---|
Zeit | 2016-10-04 01:21:00 |
Autor | HMML <hmml3939@gmai...> |
Commiter | HMML |
Fix client side validations.
@@ -15,8 +15,8 @@ | ||
15 | 15 | //= require turbolinks |
16 | 16 | //= require bootstrap-sprockets |
17 | 17 | |
18 | -//= rails.validations | |
19 | -//= rails.validations.simple_form | |
18 | +//= require rails.validations | |
19 | +//= require rails.validations.simple_form | |
20 | 20 | //= require dl_log_entries |
21 | 21 | //= require jquery.raty |
22 | 22 | //= require navi_voices |
@@ -14,11 +14,12 @@ | ||
14 | 14 | = f.input :raw_delete_key, as: :password |
15 | 15 | %h2= t '.4_tos_agree' |
16 | 16 | .checkbox |
17 | - = f.input :tos_agree, as: :boolean | |
17 | + = f.input :tos_agree, as: :boolean, validate: @navi_voice.new_record? | |
18 | 18 | = next_arrow |
19 | 19 | = f.button :submit, class: 'btn btn-primary btn-lg btn-block', id: 'btn-nv-submit' |
20 | 20 | |
21 | 21 | :coffee |
22 | - $('#new_navi_voice').on 'submit', -> | |
22 | + window.ClientSideValidations.callbacks.form.pass = (form, event) -> | |
23 | + return true unless form[0].id == 'new_navi_voice' | |
23 | 24 | $('#btn-nv-submit').val('#{t "uploading_wait"}').attr('disabled', 'disabled') |
24 | 25 | return true |