today_ai_weather/app/javascript/controllers/flash_controller.js
songtianlun 0312383bc8 feat: add flash message functionality
- Implement Stimulus controller for closing flash messages
- Replace inline alerts with a partial for better organization
- Enhance styling for user registration and login forms

This update introduces a new flash message component that allows
for user notifications to be displayed on the screen and closed by
the user. The forms also include improved styles for a better
user experience.
2025-02-11 15:52:58 +08:00

8 lines
195 B
JavaScript

import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
close(event) {
const target = event.target.closest('.alert')
target.remove()
}
}