Closed AndresCarrasquilla96 closed 3 years ago
Make sure your Rails UJS javascript is running so the links are submitted as JS requests.
How can I check that? I recently updated the app to Rails 5.2.0 which is supposed to include rails-ujs. The manifest looks like this:
Side-note: Are there any plans of adding an on-click event to the calendar cells or is there a way to do that?
Looks like you're on an older app with jquery_ujs. Same thing should apply there. It's been so long that I don't remember if you need to do anything more than require jquery_ujs
I would use Stimulus JS to add events to the calendar cells. You're in an older app it looks like, so you may not have Webpacker. In that case, you can add click events with jQuery or whatever. The cells are td's in the calendar table, so you'd just select those.
And you can install the views into your app if you want to add customize it even more. Instructions are in the readme for that.
What I noticed is that the data-remote: true
attribute is not being added, apart from that I think everything else should be fine.
edit: I actually tried manually editing the HTML from the browser and added that attribute and it did load the calendar through Ajax, the problem is that the attribute is not being added in the helper. Do you have any idea why that might be happening?
And thank you for the suggestions.
Hello, I'm asking this question on the repo since it has more activity than the other one.
The thing is, I have a page with several tabs, one of them is for a calendar view:
At the index:
Helper:
Calendar partial:
And the js:
But it keeps on reloading the whole page, please help.