Questions tagged [turbo]

201 questions
0
votes
3 answers

"Are you sure?" confirmation popup not showing for Delete button, Rails 7

When admins click the "Delete park" button, I want an "Are you sure?" confirmation dialogue to pop up before the park is deleted. I've read lots of other people using Rails 7 had success by adding the confirm message to form, like this: <%…
Rebecca
  • 88
  • 1
  • 9
0
votes
1 answer

AdSense Auto ads with a SPA powered by Turbo (Hotwired)

I have a SPA website that displays ads from Google AdSense. The framework used for the SPA experience is Turbo (Hotwired) which has superseeded Turbolinks. The issue I am having is that ads don't display when on subsequent page loads (i.e. when…
Martin
  • 1,066
  • 3
  • 20
  • 36
0
votes
0 answers

How to add a link to a tr element to open a turbo frame

In my code Ive got an iteration, which outputs elements with regarding content. Table elements in HTML are pretty limited so you cant wrap s around them. Insted there is a workaround in jquery/or whatever JS you are using like …
0
votes
1 answer

Unknown format error in link_to helper in rails 7

i am using ruby 3.1.2 and rails 7.0.3.1, i have changed the edit request get to post in the routes file app/config/routes resources :users do member do post :edit end end app/views/users/index.html.erb <% @users.each do |user| %> …
Rahul Gupta
  • 53
  • 1
  • 1
  • 12
0
votes
0 answers

How to pass local variables in iteration to turbo_stream?

In my app I have projects which have many tasks. The tasks are iterated through on the projects show page: ### Project#show <% @tasks.each do |task| %> <%=…
0
votes
1 answer

Turbo-frame with Devise, after a successful update user, on page reload the turboframe does not render the appropriate html

I have a strange problem with Devise that I was not able to figure out after several hours so I decided to bring it up to you to have a little help on the mater. I have a tab panel which uses a turbo_frame_tag to render different tabs that have…
0
votes
1 answer

How to load page specific custom Javascript functions in a Rails 7 app with Turbo, ImportMaps and Stimulus?

I just updated my Rails 6 app to Rails 7 and I am finding it difficult to hook my old "Vanilla Javascript" code into Rails' new setup with Turbo, Stimulus, and ImportMaps. To make things easier, I simple ran rails new NewAppName on the command line…
Tintin81
  • 9,821
  • 20
  • 85
  • 178
0
votes
1 answer

How to trigger "Leave Site?" message for single page – Turbo & Stimulus JS

I want to trigger the in-browser message of "Leave Site?" before leaving a specific form on my site (exactly how StackOverflow does it). The form is at /posts/new (or /posts/xxx/edit). Current problems: Once this page is loaded, the message works…
Kobius
  • 674
  • 7
  • 28
0
votes
1 answer

Why is a Rails Action processed as TURBO_STREAM even though I never explicitely said so?

I am doing a simple Rails application in Rails 7 and for some reason, the "create" form submission, which is redirecting to "show", processes that show action as TURBO_STREAM rather than HTML. I don't understand where this is coming from. Manually…
tkhobbes
  • 368
  • 3
  • 16
0
votes
0 answers

turbo stream and comments tree

I have the following problem. I'm using turbo in a forum with a comment tree. Commentary_1 id="reply_to_commentary_1" Commentary_2 id="reply_to_commentary_2" Commentary _2_1 id="reply_to_commentary_2_1" When someone inserts a…
0
votes
0 answers

500 Error when updating or destroying record with Turbo Stream

In the process of familiarizing myself with Hotwire, I am running into some challenges when firing actions to manipulate records. Resources are nested as follows: resources :batches do resources :tasks do end Here is the tasks index view: …
0
votes
0 answers

Why wont Turbo work with Cypress Dashboard?

Im using Turbo an a page w a simple select. = turbo_frame_tag "widget-index", 'data-controller': 'turbo-frame-select' do .widget-card-header select data-test-id="Widget-year-select" data-action="turbo-frame-select#onChange" …
Niles M
  • 1
  • 1
0
votes
1 answer

Turbo_stream work from controller, but not from view

I'm working on a rails 7 app with hotwire. I have a form modal, when subimited, turbo should remove html from modal and show flash message. When i put my turbo code in my controller i works: # emails_controller.rb def forward service =…
Sonfaya
  • 27
  • 6
0
votes
1 answer

My Delete method is not working, after disabling "Turbo" in rails 7?

I am working on rails 7. I'm trying to run my 'Delete' method after disabling 'Turbo' but its not working, it keeps getting to my 'show.html.erb' file instead of deleting the specific data. Here is my 'Delete' action code: <%= link_to…
MHZ GAMER
  • 11
  • 2
0
votes
1 answer

Turbo and content_for - Rails

I'm trying to load a javascript only on a certain page. For that I'm using <%= yield(:head) %> in the and the following on the page: <% content_for :head do %> <%= javascript_import_module_tag "foo" %> <% end %> This works when clicking on…
derschiw
  • 120
  • 5