|
14 | 14 | <div class="tabs-details"> |
15 | 15 | <div data-target="tabs.panel"> |
16 | 16 | <div class="margin-top"> |
17 | | - <%= form_for current_user, url: modify_users_path, html: { style: "width: 100%;", method: :put } do |f| %> |
| 17 | + <%= form_for current_user, url: modify_users_path, html: { style: "width: 100%;", data: { controller: "form" }, method: :put } do |f| %> |
18 | 18 | <div class="edit-profile--wrapper"> |
19 | 19 | <div class="edit-profile--fields"> |
20 | 20 | <div class="form-field"> |
21 | 21 | <%= f.label :name %> |
22 | | - <%= f.text_field :name %> |
| 22 | + <%= f.text_field :name, data: { target: "form.field", action: "input->form#validateInput" } %> |
23 | 23 | </div> |
24 | 24 |
|
25 | 25 | <div class="form-field"> |
26 | 26 | <%= f.label :bio %> |
27 | | - <%= f.text_area :bio %> |
| 27 | + <%= f.text_area :bio, data: { target: "form.field", action: "input->form#validateInput" } %> |
28 | 28 | </div> |
29 | 29 |
|
30 | 30 | <div class="form-field"> |
31 | 31 | <%= f.label :location %> |
32 | | - <%= f.text_field :location %> |
| 32 | + <%= f.text_field :location, data: { target: "form.field", action: "input->form#validateInput" } %> |
33 | 33 | </div> |
34 | 34 | </div> |
35 | 35 |
|
|
39 | 39 | class="edit-avatar--edit-button" |
40 | 40 | data-action="click->upload#selectNewImage"> |
41 | 41 | <img src="/icons/edit.svg" width="16"> |
42 | | - <%= f.file_field :avatar, class: "hidden", data: { target: "upload.fileInput", action: "change->upload#handleFileSelect" } %> |
43 | | - <%# <input data-target="upload.fileInput" data-action="change->upload#handleFileSelect" name="avatar" type="file" style="visibility: hidden" /> %> |
| 42 | + <%= f.file_field :avatar, class: "hidden", data: { target: "upload.fileInput form.field", action: "change->upload#handleFileSelect change->form#validateInput" } %> |
44 | 43 | </div> |
45 | 44 | </div> |
46 | 45 | </div> |
47 | 46 |
|
48 | 47 | <div class="folders--options-wrapper"> |
49 | | - <%= f.submit "SAVE", class: 'button--cta-new' %> |
| 48 | + <%= f.submit "SAVE", class: 'button--cta-disabled', disabled: true, data: { target: "form.submit" } %> |
50 | 49 | </div> |
51 | 50 | <% end %> |
52 | 51 |
|
|
57 | 56 | </div> |
58 | 57 |
|
59 | 58 | <div data-target="tabs.panel" class="hidden"> |
60 | | - sec |
61 | | - </div> |
62 | | - </div> |
63 | | -</div> |
64 | | - |
65 | | -<card> |
66 | | - <tabs title="Edit Profile"> |
67 | | - <tab name="Account" selected="true"> |
68 | | - <edit-profile /> |
69 | | - </tab> |
70 | | - |
71 | | - <tab name="Security"> |
72 | 59 | <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %> |
73 | 60 | <%= render "devise/shared/error_messages", resource: resource %> |
74 | 61 |
|
|
110 | 97 | <p>Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %></p> |
111 | 98 | <%= link_to "Back", :back %> |
112 | 99 | <%= link_to('SIGN OUT', destroy_user_session_path, method: :delete, class: "button--cta-blue") %> |
113 | | - </tab> |
114 | | - </tabs> |
115 | | -</card> |
| 100 | + </div> |
| 101 | + </div> |
| 102 | +</div> |
0 commit comments