Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
100 views

I'm using Rails 7 with ActiveStorage to handle file uploads on a Post model. Everything works fine for attaching files, but I'm struggling with removing/deleting an attachment when the record is ...
Elliot's user avatar
  • 57
0 votes
2 answers
1k views

I connected a form_with with my stimulus controller, then added the form itself as a target and added an action to point to my stimulus controller's submit function. When I then get the form and try ...
Daniel Gaspar's user avatar
1 vote
1 answer
34 views

I am trying to create recipe app that users can take. Part of the app is an admin users getting to create the recipes and instructions. There is a User model/table with all the users. This has a ...
auto's user avatar
  • 1,163
1 vote
1 answer
605 views

I am working on Ruby on Rails application and have designed a form. I have two buttons in the form. Generate Plot button which initiates a GET request Save button which initiates a POST request. The ...
TEJINDER SINGH's user avatar
0 votes
1 answer
965 views

Here's the issue I'm facing. I'm creating miniature cards for my models, iterate on every item of the collection (using render @models) and each one has a button to trigger a form (POST) that goes to ...
Julien KARMANN's user avatar
0 votes
2 answers
64 views

I haven't been able to solve the error for a couple of days because of the nested path, what is the problem? I realize that there is no such nested path as Rails is looking for, but why is he looking ...
antnbaranov's user avatar
0 votes
1 answer
1k views

Select field with form_with, Stimulus and Hotwire, and Rails 7 I want to see a message in the console once I change the select value. I'm using Hotwire and Rails 7 but it doesn't work. Code. _form....
Jorge Ortíz's user avatar
0 votes
1 answer
40 views

I do chat on action cable. And I have a problem with post view. However, in order to show a message from a user, it additionally outputs the entire hash of all messages in this chat. This what i get: ...
Andrew Kancev's user avatar
4 votes
2 answers
2k views

My app is running Rails Rails 7.0.2.3 In my update controller action I have the line: return render(:edit) unless @user_form.save This renders the edit view on error .... but errors are not displayed....
ReggieB's user avatar
  • 8,277
1 vote
2 answers
628 views

I'm having trouble connecting a form_with helper to a specific action. I want to search through my posts and so have created a search action in the posts_controller. The logic is working (tested by ...
Jesus Miranda's user avatar
10 votes
1 answer
4k views

In Rails 7 a form generated with form_with tag sends remote request by default (turbo.js handles form submit event instead, whatever). Previously one would pass remote: false or local: true parameters ...
installero's user avatar
  • 9,866
0 votes
1 answer
159 views

class CustomerType < ApplicationRecord belongs_to :workspace, inverse_of: :customer_type validates_presence_of :workspace end class Workspace < ApplicationRecord validates :name, presence:...
Cephas's user avatar
  • 57
0 votes
1 answer
191 views

I've a multiple relation table named Order which belongs_to a Relai(to avoid singular/plurials complications), a Customer and a Composition. I set my Order model accordingly with nested_attributes as ...
JoCoz's user avatar
  • 11
0 votes
1 answer
950 views

I am using rails form_with as a remote form. Before submission I want to display a custom confirm box with a dynamic message. After the box is indeed confirmed I want to eventually submit the form. I ...
David Geismar's user avatar
0 votes
0 answers
55 views

The following form intends to generate an XHR response <% articlediscounts_for_article = @articlediscounts.where(article_id: article.id).first %> <%= form_with(scope: ...
Jerome's user avatar
  • 6,355
0 votes
1 answer
638 views

I added the method: patch to the form_with helper (like it said to in this SO post) <%= form_with(model: [:admin, contest], method: :patch) do |form| %> ... and the <input type="...
Sticky's user avatar
  • 3,959
0 votes
1 answer
214 views

This is in application.html.erb, and it works on 95% of the pages in my app: <% ['usd', 'eur', 'aud'].each do |currency| %> <%= form_with url: {controller: :home, action: :currency_select},...
stevec's user avatar
  • 55.3k
0 votes
1 answer
136 views

How can I use the selected value in form for alerts? Is there a way to get it by getElementById or equivalent? Form = f.select :some_key, some_array `= f.submit 'Submit', data: { confirm: t('views....
kndoshn's user avatar
  • 21
0 votes
2 answers
828 views

I've created a form so the user can add a new picture to the website catalog, but for some reasons it doesn't work. Once the form is filled out, I click on the 'Submit' button but nothing happens, I ...
blueblue's user avatar
2 votes
1 answer
9k views

I have a form without a model backing it built using form_with in Rails 6: <%= f.text_field :one %> <%= f.select :two, [['Option 1',1],['Option 2',2]] %> <%= f.submit 'Submit' %> ...
RedBassett's user avatar
  • 3,597
0 votes
1 answer
583 views

I am trying to add an "any" section to my game filters. In a wide view it works fine I just reload the page passing the link the other needed params like this: <%= link_to games_path ...
Ry Ellingson's user avatar
4 votes
2 answers
6k views

Is there an easy way to customise the message that appears when the pattern: "([A-Za-z0-9\-\_]+)" argument is not satisfied and this message appears: e.g. <%= f.text_field :username, ...
stevec's user avatar
  • 55.3k
0 votes
0 answers
178 views

When a form_with submits, it submits all the desired parameters, but also a parameter called "booking", and I have absolutely no idea where this parameter came from. It's not contained in ...
stevec's user avatar
  • 55.3k
1 vote
1 answer
567 views

A pattern argument can be provided to a form field as described here Example (regex from here) <%= f.text_field :username, pattern: "([A-Za-z0-9\-\_]+)" %> When the regex is not ...
stevec's user avatar
  • 55.3k
4 votes
2 answers
4k views

I am attempting to add a hidden field to a form_with. Here are 3 attempts (and results / error messages) First attempt From: https://guides.rubyonrails.org/form_helpers.html <%= hidden_field_tag(:...
stevec's user avatar
  • 55.3k
1 vote
1 answer
2k views

I'm trying to allocate an address a custom id so it's not easy to guess the record (for people who want to add and change other people's addresses). For some reason, whilst I can create a record with ...
Darren's user avatar
  • 1,752
1 vote
1 answer
5k views

I'm new to Stimulus JS. I'm a little stuck trying to make a simple event fire using collection_select in a form (created with rails g scaffold). Here's my dropdown-controller.js (stimulus) file: ...
Ignacio's user avatar
  • 37
0 votes
1 answer
440 views

I am new to rails but I think I'm following every step for using this gem. However, I'm getting a NoMethodError. My steps: I ran gem install country_select -v 3.1.1 in terminal. I stopped my server, ...
Dylan's user avatar
  • 5
1 vote
2 answers
147 views

I'm programming a Book library system with a SQL Lite database in the background. Via the console I can add and update books without a problem. And I have already made a view where I can add new books ...
aa.hari.csbe's user avatar
0 votes
1 answer
305 views

Hello guys I searched everywhere on how to output form errors but no luck. I tried almost all the code I found on the internet but still didn't work. Here are some of my files: view/books/new.html.erb ...
jericoluislua's user avatar
1 vote
1 answer
813 views

My application needs to duplicate a Skill (from skills index) as many times the user needs it in his cart. So I decided to trigger the add-to-cart method of the skills_controller when the related form,...
user1185081's user avatar
  • 2,178
1 vote
1 answer
551 views

To register addresses for clients in my application I am using nested routes, however when clicking on the link to register a new address or to edit an existing address the system presents the error: ...
Jemison Santos's user avatar
0 votes
1 answer
644 views

In my view, I have several checkboxes, and I want to send back an array of which are checked. I have achieved this by writing the HTML myself, but I'm wondering if there's a way to do it using ...
Nathan Hinchey's user avatar
0 votes
0 answers
168 views

I see ActionController::ParameterMissing (param is missing or the value is empty: order) Its clear order is missing from my params Hash. My parameters dictionary is flat and does not include {order=&...
user398520's user avatar
  • 1,683
1 vote
1 answer
73 views

I'm new to Ruby on Rails and am following the online tutorial here: https://guides.rubyonrails.org/getting_started.html As soon as I try to implement a 'form_with' element I get the following error ...
DevJoe's user avatar
  • 53
0 votes
1 answer
124 views

I'm upgrading a rails 4.2 site to 6.0 and am receiving uninitialized constant Authlogic::Session::Validation when I try to load a form, presumably because the Validation module was removed from ...
MattPo's user avatar
  • 46
0 votes
1 answer
1k views

I have a pair of models, Preset and Plot class Preset < ApplicationRecord belongs_to :user has_many :plots, :dependent => :destroy accepts_nested_attributes_for :plots, ...
twigonometry's user avatar
0 votes
2 answers
454 views

I have two models, Preset and Plot, as below: class Preset < ApplicationRecord belongs_to :user has_many :plots, :dependent => :destroy accepts_nested_attributes_for :plots, ...
twigonometry's user avatar
3 votes
1 answer
2k views

I have a simple form for creating a new model. The model has an attribute panel that is set in the Controller. I think it should not matter, but panel is an enum. def new @order = Order.new(panel: ...
MeXx's user avatar
  • 3,365