This might be a really simple thing to ask but I’ve got a JavaScript countdown timer, but I can’t stop it from counting past 0:00. Instead of stopping at this point, it will continue to -1:59 etc. I’d also like it to play a beeping sound (which can be found here) when the timer reaches zero. This is the code
Tag: ruby-on-rails
v-model in html.erb template renders function () { [native code] }
I am in the process of adding Vue.js to my Rails 6 app. The project is using turbolinks so “vue-turbolinks” is installed via yarn and my Vue config looks like this: and my rails template(.html.erb) contains a text field with a Vuejs “v-model” attribute Vue seems to be working as expected, except “v-model” is outputting literal function instead of calling
I am using bootstrap and everything is working except for tooltips
Okay so my javascript is definitely not on point, and I am really stuck with integrating tooltips into my rails application. I have done everything that bootstrap is telling me to do in any possible way, and it still doesnt work… The only progress I made is that now when I hover over something I see the text that is
Rails vuejs get height of iframe element
I am using vuejs with rails webpacker and turbolinks. I want to calculate the correct height of the iframe element on the initial page load. Currently, I am getting the height of the element when I manually refresh the page, and when someone navigates from any other pages to the page where the iframe element is located, the height of
Can I use ActionCable to refresh the page?
I’ve recently been trying to create a live-scoring system for squash matches. I’ve managed to use ActionCable with Rails 5 to auto-update the score on the page, but I’d like to know if it’s possible to tell Rails to refresh the page if a certain condition is met. For example, if the game has finished, a different page is shown
Error in my script SyntaxError: missing ) after argument list [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 2 years ago. Improve this question
How to trigger a JS code once when a new model is created in rails?
I’m trying to have an ‘Achievement Unlocked’ JS animation play on my show page when someone creates a new cocktail model. So it should only play once and never again on that particular page. I’m kinda stuck on how to do that without creating a separate table for ‘Achievements’ in my DB. Does anyone have a simple solution? Here’s my
Why my sortable function does not work in rails?
I want to drag and sort the div of id=”sortable” class=”sort”. I use the function of sortable, but it does not work. Anybody can give advice? Answer My solution is to use turbolinks.
ruby on rails call javascript function from button_tag
I am trying to perform a very simple task: Button is clicked – message is displayed (via JavaScript). Most likely I am either looking in the wrong places or going completely wrong about it but I can’t find any examples that will show how to accomplish this simple task. My js function is: The button_tag is: I would like to
How do I change the default text highlighting color in Summernote?
I’m building a Rails app capable of displaying text with rich formatting – the app will be used by non-technical personnel, so using markdown is not possible. Therefore, I’ve decided to use Summernote as a WYSIWYG editor. However, the default highlighting color (the background color option) that is shown when the summernote is initialized is yellow which really conflicts with