Questions tagged [ruby-on-rails]
Ruby on Rails is an open source full-stack web application framework written in Ruby. It follows the popular MVC framework model and is known for its "convention over configuration" approach to application development.
ruby-on-rails
338,265
questions
-4
votes
0
answers
15
views
Deploying Ruby on Rails to HTML [closed]
I have thinking about deploying ruby rails to html. Then connect it to apache Cordova then how can I deploy the project to html
I tried some deploying ruby gem libs and some of them didn't work for ...
0
votes
0
answers
32
views
TinyTDS Login failed when TSQL connects -
I have a RoR API only app:
gem 'rails', '~> 7.0.8'
gem 'activerecord-sqlserver-adapter', '7.0.7'
gem 'composite_primary_keys', '14.0.9'
gem 'tiny_tds', '2.1.7'
The ubuntu server connects just fine ...
0
votes
0
answers
20
views
Rails Form no submitting attributes from associated models
I've come back to rails after ignoring it for a few years and seem to have forgotten some things!
I have three models:
customer
product
order
When submitting an order, there are two fields to select ...
-1
votes
0
answers
35
views
Why is the data in a Rails view displaying as 0.0 or 42.0 instead of $42.00?
Question Title: Why is the data in a Rails view displaying as 0.0 or 42.0 instead of $42.00?
Summary: How can I get this field to display e.g. $42.00 instead of 0.0 or 42.0? In addition to the ...
1
vote
1
answer
49
views
Ruby module is not an ancestor after prepend
I'm developing a plugin to the Rails (6.1.7) project Foreman (v3.5.1; based on the Foreman Plugin Template) and face the issue that one of my modules (DnsInterfaceExtensions) ought to be prepended to ...
0
votes
0
answers
18
views
Rails 7 with turbo - some requests on Chrome/FF doesn't work correctly
It happens only on Chrome/Firefox - on Safari everything works fine.
I noticed that some requests (eg. file upload) don't work correctly after moving to turbo (from turbolinks). Request:
patch https://...
0
votes
1
answer
36
views
Mime type spoofing detection
I am working on a content type spoof detector for a web application. My issue can be answered by any developer with experience on this subject.
My input is a object, which expose its filename, ...
0
votes
0
answers
37
views
How can I fix Postgres errors in Minitest?
I am using Minitest and Postgres to test my Rails website. When I added a "Like" model, I started getting Postgresql deadlock errors
Minitest::UnexpectedError: ActiveRecord::Deadlocked: PG::...
0
votes
0
answers
18
views
rack-attack: Rack attack throttling not working
I am trying to limit the api calls using rack attack. I have followed the setup process but throtteling is not working.
steps I followed:
installed rack-attack gem
created rack_attack.rb initializer
...
0
votes
0
answers
17
views
N+1 issue when listing attachement and variants(has_many_attached)
N+1 query issue is coming at the time of fetching variant.
Model:
# Yoyaku Shouhin model
class YoyakuShouhin < ApplicationRecord
has_many_attached :shouhin_images do |attachable|
attachable....
-1
votes
0
answers
9
views
Library is unable to encode image files to the Webp files
Currently, I'm using webp-ffi gem to convert PNG/JPG files to webP files for better performance, it was working fine but suddenly, the library stopped working and it is raising the below exception
...
0
votes
1
answer
56
views
Is it valid practice to intentionally omit association definition with Rails ActiveRecord? [closed]
While been working on Ruby on Rails application, I was suggested to omit ActiveRecord association intensionally by my coworker for it's defines unnecessary methods.
Example,
class Person < ...
1
vote
1
answer
32
views
How can I make Tailwind work on my component
Good morning everyone. I'm trying to render a FlashMessage component
<% flash.each do |type, message| %>
<%= render FlashMessageComponent.new(type: type, message: message) %&...
0
votes
1
answer
22
views
Generating an I18n attribute in a json jbuilder flow
The following, in a context where the Mobility gem is used for handling translation of values.
json.label transaction.categoryminor.name
is generating a value, which would be blank as Mobility ...
0
votes
0
answers
22
views
puma-dev server error 'Unable to start worker'
I am trying to get puma-dev server working locally, and im hitting an issue. If I tail these logs tail -fn 2000 ~/Library/Logs/puma-dev.log I can see this error once I hit the first webpage and try to ...