Denis Omerovic

Joined

13,780 Experience
136 Lessons Completed
0 Questions Solved

Activity

Posted in Pass variable to Flash object

I'm trying to pass a variable to flash messages object. I want to autohide flash messages(not each message) after 5 seconds in Stimulus controller. So I want to be able to set data-flash-autohide-value="true or false" in HTML.

One thing that I'm not sure how to pass this true or false from controller?

redirect_to some_path, notice: "Some message", autohide: true - this is clearly not working

so I can pass that variable in HTML stimulus value

Posted in How to prevent Turbo from striping params from form URL

After Turbo upgrade:

I have a form that is sending a GET request with the following URL /some-url?param1="hello"

When the form is submitted param1 is being striped out so it's not being sent. There is a known issue with this but still not sure how to make it work.

Posted in Action listener for submit on return??

You can listen on keydown event and detect when return is pressed and call the function. More on keydown event here https://developer.mozilla.org/en-US/docs/Web/API/Document/keydown_event

I have a user model and around 1milion user records in my database and I'm using ILIKE to match the users by name or email. Sometimes it's very slow since I have a lot of records in my DB so I'm looking for a better way to search users. I would appreciate any suggestions.

Looks like if scroll too fast the same data is fetched twice, even in the video you can see the same. So basically we should still use this.loading to prevent fetching same data multiple times.

Posted in Rails for Beginners Part 17: Login Form Discussion

Probably because you created your user before you added has_secure_password. Try to delete the user from DB and create a new one and then try to log in.

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

© 2024 GoRails, LLC. All rights reserved.