spacerobotTR

Joined

2,120 Experience
4 Lessons Completed
1 Question Solved

Activity

Posted in Rendering simple_calendar content using Turbo Frames

Did you ever get this working? I am working on something similar and would love for hotwire to update the events in the calendar.

Posted in How do you deploy hotwire turbo via capistrano?

Cancel that. I was dynamically changing the layout if it was a devise controller or other and it was causing an issue with my modal turbo frame. It is all set now!

Posted in How do you deploy hotwire turbo via capistrano?

I just deployed a site to an ubuntu server I have on premise. The site is working, but none of the turbo hotwire stuff is. Like clicking a button to open a modal with hotwire does nothing. I see no errors in the logs. Are there additional steps to configuring hotwire on a deploy?

Not sure if you solved this but this works to get it up and running:
https://github.com/excid3/tailwindcss-stimulus-components/issues/153

My issue is that the alerts do not animate when they trigger. Any ideas on that? I am using the referenced code on the github page to render the alert.

Indeed it is. As an update i ended up getting this all working with taglib ruby.

Posted in User Avatars with ActiveStorage Discussion

Did you ever resolve this? I just hit the same problem.

Posted in Datatables From Scratch Using Hotwire Discussion

What rails version / -js build are you using?

Posted in Datatables From Scratch Using Hotwire Discussion

Wow this is awesome! I was just searching yesterday trying to find a datatables alternative. This is great! Would love to see the csv, excel, pdf download buttons worked in. You should package this up as a gem or something!

Posted in Hotwire Modal Forms Discussion

Solved the issue with this in case anyone else hits this problem. https://github.com/adrienpoly/stimulus-flatpickr

Posted in Hotwire Modal Forms Discussion

Just went through this. Great tutorial! Everything is working great except one thing for me. I have 3 flatpickr fields for date selection and start time / end time. When the form renders again due to validation errors it wipes out the flatpickr fields. Any thoughts on how I can have them render again when the form rebuilds to display the errors?

Posted in Can you csv import with additional form fields?

Say I have a form that some default information on a request. Start date, end date, access level etc. I want to be able to browse for a csv of employees that contains one field for each row the employee ID, and create a new request for each ID in the csv with the default form data attached.

Is it possible to do that? If so how?

Posted in CSV Upload Form to Import Records Discussion

Question on this. How would you combine this with other form fields? Like if I wanted to set up some default form fields to fill out. Then upload a csv file with a bunch of users and create records for each user with the form fields that were filled out?

Posted in How to order stimulus reflex morph asc?

I thought that it ran the controller methods as well. In my show method I have it sorted ASC. When I refresh the page it does sort them correctly, but when I create new ones it always puts the new one at the top of the list.

Posted in How to order stimulus reflex morph asc?

I have a morph for stimulus reflex that updates a portion of the page when todos are created. What the customer would like to have happen is that when they create new todos they are added to the bottom of the list. Currently they are added at the top. I have tried a bunch of different ways to get it to sort but have been unsuccessful so far. If I manually refresh the page it sorts correctly by adding the order by to the controller, but when I add a new todo it always puts it at the top. Any ideas on how to do this?

def toggle
todo = Todo.find(element.dataset[:id])
todo.update(completed_at: (todo.completed_at? ? nil : Time.current), lastUpdatedBy: current_user.id)
morph "#todo-#{todo.id}", ApplicationController.render(
partial: 'todos/todo',
locals: { todo: todo }
)
end

Posted in How to use Javascript via Webpacker in Rails 6 Discussion

There is no e in flatpicker. Its flatpickr.

If I wanted to have a site similar to bandcamp where I could upload MP3 tracks are there any gems or recommended ways to check the audio quality, and read/write meta tags to the files?

I didn't realize you had to delegate the current_user. per this: https://docs.stimulusreflex.com/authentication

Trying to slightly build off the stimulus reflex dynamic forms checkbox lesson. I wanted to add the current_user id to the lastUpdateBy field when the checkbox is checked. I have not been able to get it to work though. Any thoughts on what I am doing wrong? If I hard code the value instead of current_user it works. I must just be referencing it wrong.

  def toggle
     todo = Todo.find(element.dataset[:id])
     todo.update(completed_at: (todo.completed_at? ? nil : Time.current), lastUpdatedBy: current_user)
  end

I'm still trying to figure this out. Does anyone have any thoughts on this?

I was working on this today. I am rendering the partial from the compitem page in my case passing through the compitem_id as a locale. I get the error that the ID value is undefined so I'm not sure if I am passing it through correctly. It would be great to see a full working example of this.

logo Created with Sketch.

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

© 2022 GoRails, LLC. All rights reserved.