mirror of
https://github.com/danbee/my-images
synced 2025-03-04 08:49:05 +00:00
Fix issue with adding tags
This commit is contained in:
parent
c611214a60
commit
539de55297
@ -13,8 +13,8 @@ export default class extends Controller {
|
||||
.then(response => {
|
||||
if (response.status == 200) {
|
||||
this.tagListTarget.innerHTML += response.data;
|
||||
};
|
||||
this.tagTarget.value = "";
|
||||
};
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,9 +5,9 @@
|
||||
<div class="new-tag-form">
|
||||
<%= form_tag user_image_tags_path(image),
|
||||
method: :post,
|
||||
data: { remote: true, action: "tags#create" } do %>
|
||||
data: { action: "tags#create" } do %>
|
||||
<%= text_field_tag :tag, nil, data: { target: "tags.tag" } %>
|
||||
<%= submit_tag "Add Tag" %>
|
||||
<%= submit_tag "Add Tag", data: { disable_with: false } %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -40,7 +40,7 @@ feature "user manages image tags by visitng images show page" do
|
||||
scenario "user can add a tag to the list of tags", js: true do
|
||||
tags = ["one", "two"]
|
||||
user = User.create(uid: "123")
|
||||
new_tag = "new tag"
|
||||
new_tag = "newtag"
|
||||
Image.create(
|
||||
user: user,
|
||||
tags: tags,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user