
Paul Phillips
Joined
Activity
One little thing - in the authentication module, resume_session method, the original version (without impersonation) had this line:
Current.session ||= find_session_by_cookie.
In the version with impersonation, this has been changed to:
Current.session = find_session_by_cookie. (no ||=)
Using the impersonation version ( = ), when I ran a query that returned 160 records, the logs showed a LOT of calls to:
app/controllers/concerns/authentication.rb:39:in 'Authentication#find_session_by_cookie'.
Adding the ||= back into the code seemed to get rid of all that. I suppose there is not problem with returning to ||=, right?
After further testing, I can get methods 1 and 2 to work correctly, but still method three seems to call the html xxx_field partial and not the turbo_stream partial when clicking on the link_to to add a second nested object.. I can't figure out why.
Another question - I need to pass an array into my equivalent of the task partial. How to I do this on method 2 when using the button_tag that calls the stimulus controller?
This is a very helpful video! I'm trying to implement version 3 - full-turbo-get. For some reason, the link_to on the form page to add a second task is not executing a turbo_stream, but rather is executing the html partial. In my case, the link looks like this:
<%= link_to "Add a Student", chamber_music_entry_field_chamber_music_groups_path, data: { turbo_stream: true } %>
The turbo_stream is not executing - rather, it loads the html version as a new page. My project is running rails 7.0.3 and turbo 1.3.2. What could be causing this?