Questions tagged [turbo-rails]

67 questions
0
votes
1 answer

Undefined local variable or method "rendering_options" error for

I am a beginner and I have used this fix (https://medium.com/@nejdetkadir/how-to-use-devise-gem-with-ruby-on-rails-7-33b89f9a9c13) for making devise work with turbo forms in my previous project and it worked fine. But when I use it in my new project…
0
votes
1 answer

Turbo frame causes unexpected page layout

I currently used turbo-frame in a project which was using turbo-links, after I found that all the pages are disrupted by turbo-frames, such as the dropdown list became something looks like a input area (Sorry couldn't find the picture of that…
0
votes
0 answers

jquery on('click', ()) method doesn't work properly in rails7

I am new to rails7 and I can't make jquery work properly. Below simple code(change element's attribute by radio button value) doesn't work which it worked with Webpack(rails6). app/javascript/application.js // Configure your import map in…
0
votes
0 answers

How to redirect to next question after showing the result for 2s Ruby on Rails / Turbo

I am working on a quiz functionality, and I'd like to show the user the results for 2s before redirecting him to the next question. Here is my code to show the results to the user (it works): def validate_answer answer_given =…
0
votes
1 answer

Ruby on Rails 7 + Turbo - Not showing notice message

I am learning Ruby on Rails. Rails 7 + Turbo stream... I am following a tutorial and I am having a problem with displaying the Notice message. Can you help me understand why I am not getting notice message after I create a new quote? Here is a…
Volkan
  • 494
  • 3
  • 14
  • 32
0
votes
0 answers

Ruby on Rails 7 - page loaded twice when use 'data-turbo-track': 'reload' on it

I use rails 7 with importmap. On view I added <% content_for :head do %> <%= javascript_include_tag 'path/to/script', 'data-turbo-track': 'reload' %> <% end %> for run script only on it. After that the page is always loaded twice when you go to…
0
votes
0 answers

Rails 7 + Hotwire/Turbo: `turbo_frame_tag` not rendering where it should

I'm creating a table and I want to render a turbo-frame tag around each row. Here's the code in an html.erb file (see line 7). 1. 2. 3. ... 4. 5. 6. <%…
John
  • 9,254
  • 12
  • 54
  • 75
0
votes
0 answers

Rails 7 - how to submit form without redirect with Turbo

I'm using Rails 7 with Turbo. I'm trying to build a file upload mechanism - the idea is that user in the profile page could upload the file and after upload success, page should not be reloaded but it should show a green mark as a success…
mr_muscle
  • 2,536
  • 18
  • 61
0
votes
0 answers

Why is turbo rails remove action not removing this div and returning this error?

I've got a Rails 6 app using turbo-rails. In my HTML I'm rendering a div like so
When I click a button_to tag I trigger the destroy action that runs a destroy.turbo_stream.erb view file <%= turbo_stream.remove…
ilrock
  • 573
  • 8
  • 24
0
votes
2 answers

Turbo Stream broadcast_replace_to is removing the turbo_frame_tag

Code snippets: application.html.erb: <%= turbo_stream_from current_user, "counter" %> <% if current_user%> <%= render partial: "users/counter", locals: { user: current_user } %> <% end %> users/_counter.html.erb: <%= turbo_frame_tag…
septerr
  • 6,445
  • 9
  • 50
  • 73
0
votes
1 answer

how to render partial without variable with turbo

I search trough internet, but I only find 'how to render partial after update' etc. For now I click on the image, page is refereshing and partial appear. But this refreshing part is... not good for me, so I wonder.. Can I render partial (or replace…
Shruikan
  • 69
  • 8
0
votes
0 answers

Set multiple targets with turbo form submission in rails

I have a response that has a template with 3 different turbo_tags nested in another one. = turbo_frame_tag 'container' = turbo_frame_tag 'frame1' = form_with url: path, data: { turbo_frame: '?' } = turbo_frame_tag 'frame2' =…
0
votes
1 answer

Ruby on rails turbo current user access

index.html.erb <%= turbo_stream_from "posts" %> <%= turbo_frame_tag "posts" do %> <%= render partial:'posts/post', collection: @posts, as: :post %> <% end %> _post.html.erb <% if Current.user.id == post.user_id %>
Levi
  • 1
0
votes
0 answers

Can Turbo.visit update a turbo frame when onChange changes, without changing the URL?

Inside a form we have 2 select and would like to refresh/update the second select when the first select changes, using onChange Example: First select has: onChange:"Turbo.visit(`/sites/index_by_country?country_id=${this.value}`)" Currently this…
viktorsmari
  • 179
  • 1
  • 3
  • 12
0
votes
2 answers

How do you use a turbo frame to replace an object creation form with an object show partial?

I have a model subscription_tier with show and edit actions with corresponding views. I've wrapped each of these with a turbo frame <%= turbo_frame_tag subscription_tier do %> When I edit an existing subscription tier and save it, the turbo frame…
sasav
  • 1
  • 1
  • 2