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,329
questions
-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 ...
0
votes
2
answers
1k
views
How to find all classes that includes a module
I have a module called Nameable and some models that include this module.
Is there a way to know which models (classes) have included this module?
-4
votes
0
answers
16
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
1
answer
77
views
How to rename column in rails through terminal?
I am unable to rename column through terminal
how to rename column in rails without writing anything inside migration file .I meant to say how we can rename column through terminal only.so please give ...
20
votes
5
answers
16k
views
Rails 4: Why are fonts not loading in production?
I can't load fonts in my Rails 4 app in production, it works normally in development.
Assets are precompiled on the server while deploying.
I have my fonts in
app/assets/fonts
My app.css:
@font-...
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
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....
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 ...
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, ...
-2
votes
1
answer
1k
views
Rails link_to and merge parameter into existing parameters
I have a link_to directive that adds a link to an icon by passing a block to link_to. What I'm trying to do is merge existing query parameters in the URL and append this one as well if it is clicked. ...
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
1
answer
57
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 < ...
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://...
4
votes
3
answers
1k
views
Heroku Rails 7 deployment not finding Javascript files (404)
I have a rails app that has javascript working correctly locally but when I push to Heroku it's getting 404s for each of the relative imports in my application.js file:
// Simply importing activates ...
0
votes
2
answers
41
views
problem installing Rspec with factory_bot. Factories are not registered
I am using rails 7.1.3.4 with rspec-rails 6.1.3 and factory bot.
I have added require 'factory_bot_rails' and config.include FactoryBot::Syntax::Methods in spec/spec_helper.rb
Here is my factory in ...