Skip to content

Conversation

@smartlime
Copy link
Owner

Как-то совсем просто получилось. Существующий уже remove() идеально подошел в качестве экшена. Поэтому очень смущает фраза из задания про:

Подумайте, какие изменения необходимо внести в Stimulus контроллере?

Copy link

@palkan palkan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Да, тут всё просто, если не решить усложнить remove() и поменять удаление на скрытие, например.

<div class="flash notice" role="alert" data-turbo-temporary data-controller="removeable" data-removeable-after-value="10">
<p class="text-small"><%= flash[:notice] %></p>
<button class="absolute top-0 bottom-0 right-0 px-2 py-3" data-action="click->removeable#remove">
<svg class="fill-current h-6 w-6 hover:text-primary" role="button" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><title>Close</title><path d="M14.348 14.849a1.2 1.2 0 0 1-1.697 0L10 11.819l-2.651 3.029a1.2 1.2 0 1 1-1.697-1.697l2.758-3.15-2.759-3.152a1.2 1.2 0 1 1 1.697-1.697L10 8.183l2.651-3.031a1.2 1.2 0 1 1 1.697 1.697l-2.758 3.152 2.758 3.15a1.2 1.2 0 0 1 0 1.698z"/></svg>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Иконку, конечно, лучше положить в views/icons, как это сделано везде

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Да) Я это отразил только на 3-м дне, кажется.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants