Questions tagged [rails7]
48 questions
0
votes
1 answer
Nested tag inside link_to in Rails 7
I need the following HTML output exactly as shown below:
I am using a Ruby block to create multiple…
Option1
>Option1 content...

Matteo
- 1,136
- 1
- 16
- 36
0
votes
1 answer
Call create method from index page - Rails 7
I have a Document model and I'm looking to create a Document by clicking a button that send some params from my index page.
I want to do this whithout passed in the 'new' page.
What I want to do exactly is : I click the button, that create my model…

Bllfngr
- 11
- 4
0
votes
2 answers
My Jquery files are only loading on Refresh page rails 7
My Jquery files are only loading when page is refreshed. But when I remove (import "@hotwired/turbo-rails") from application.js It works normally. But removing "@hotwired/turbo-rails" causing other issues. Anyone please help.

Hammad Abdullah
- 21
- 1
0
votes
1 answer
Admin's delete user link not working with Devise and Rails 7
I want to allow admins to delete users from a link on the users index.
Desired behavior: When logged in admin clicks "delete" next to a username on the index page, that admin sees a confirmation message. Upon confirming, the user is deleted, admin…

Rebecca
- 88
- 1
- 9
0
votes
1 answer
Ruby On Rails-Make content on show page content-editable
I would like to make my show page content editable by double clicking on the content and after I update that content, then that updated content would also be save in the database. I am working on Ruby on Rails. Any suggestions, how can make my…
0
votes
1 answer
ActionView::SyntaxErrorInTemplate at /template_name
I need to dynamically load a sidebar's content into a sidebar partial based on the presence of a directory name-spaced as the controller_name (if present) and the action_name (always used). They both are derived from the Rails hash and map to the…

Matteo
- 1,136
- 1
- 16
- 36
0
votes
2 answers
More than 2 dynamic layout options per controller in Rails
Using multiple layout statements in Rails will throw an error. Rails ignores all but the last layout statement.
However, I have a complicated layout system where I need to dynamically render several different layouts other than the standard…

Matteo
- 1,136
- 1
- 16
- 36
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
Flash message (Stimulus) is not worked in heroku
I'm working on a personal development application with Rails7+Tailwind, and I implemented the code to delete flash messages in stimulus with reference to a web article.
I'm having trouble solving the problem that Stimulus (erasing Flash messages)…

mojaomi
- 115
- 6
0
votes
1 answer
How to add bootstrap and jquery in rails using import map?
I'm setup rails 7 app. And i wan't to add bootstrap and jquery using import map. I'll try but didn't work. I follow this step if i made any mistake please correct.
rails new demo
bundle install
create demo controller with index and add some…

hardik
- 39
- 6
0
votes
0 answers
Rails 7 - Stimulus - external script not loaded during navigation (Klaviyo newsletter form)
I have an issue with a script in my website.
The application is based on RAILS 7 and Stimulus.
I have added an external script in order to generate a simple form to sign-in for a newsletter (it is simply an input for the email and the submit button)…

Roberto Boldi
- 117
- 1
- 7
0
votes
2 answers
RoR Rails 7 using Turbo to Update a partial on button click
Help! I'm relatively new to Ruby on Rails and now I'm attempting to use Rails 7 with Turbo and Stimulus to update a partial on my web page.
I have buttons on a page within a partial (call it _home.html.erb). When clicked I'd like them to replace…

epurdy
- 151
- 1
- 12
0
votes
1 answer
using ApexChart for rails7 raising error Uncaught ReferenceError: ApexCharts is not defined
I'm new one in rails and trying to add Apexchart js to my project in rails7.
So i did
document.addEventListener('turbo:load', function(){
var options = {
chart: {
type: 'line'
},
series: [{
name: 'sales',
data:…

cyberriver
- 1
- 2
0
votes
1 answer
How do I generate a form using a model with single table inheritance?
I have a model Company that has a type field. There are two subclasses Fleet and Dealer.
I know the inheritance is working so I'm now working towards the views working too. However the views/companies/_form.html.erb is producing this error when I…

Nathan Gillespie
- 21
- 7