Questions tagged [ruby-on-rails-5.2]

For issues specific to the version 5.2 of Rails. If your question applies to Ruby on Rails in general, use the tag [ruby-on-rails].

Ruby on Rails 5.2, "an open-source web framework that's optimized for programmer happiness and sustainable productivity." Rails 5.2 brings a bunch of new features and improvements over older Rails versions.

Major Features

  • Active Storage
  • Redis Cache Store
  • HTTP/2 Early Hints
  • Credentials

See Ruby on Rails 5.2 Release Notes for more information.

Resources

Related tags

540 questions
0
votes
2 answers

Devise sign_in does not work in controller specs

It seems, that devise's sign_in helper doesn't work. The regular sign in procedure works as a charm, tested via integration test and by filling the login form manually. Both methods delivered the correct value for current_user. I wanted to test the…
Klaus
  • 1,591
  • 1
  • 12
  • 18
0
votes
2 answers

handling nested attributes in rails 5 api only application

I have a requirement in rails api application. client can have many orders and each order belongs to a client. class Client < ApplicationRecord has_many :orders end my order.rb is class Order < ApplicationRecord belongs_to :client,…
Ajith
  • 325
  • 4
  • 17
0
votes
2 answers

Rails Web Console and development error not showing up

I recently updated my rails application to rails 5.2 and Ruby Version 2.3.3 to my surprise, a development error in the browser is not showing up as error anymore but with the message We are sorry, something went wrong If you are the application…
rails_newbie
  • 108
  • 1
  • 12
0
votes
1 answer

Rails 5.2: New records not saving after upgrade from 5.1.4

I upgraded my Rails 5.1.6 app on Ruby 2.4 to Rails 5.2 on Ruby 2.5.1 by making a new rails 5.2 app then transferring all the app files to it. I noticed the following changes: coffee script stopped working (no problem, I just changed to…
Jun Dalisay
  • 1,165
  • 2
  • 12
  • 26
0
votes
0 answers

How to store only .yml files in Active Storage

Im trying to get to set a validation on the storing .yml files only. With some research I'm doing this: class TranslationFile < ApplicationRecord has_one_attached :file validate :only_yml_type private def only_yml_type if…
0
votes
0 answers

How do I execute a callback only if a specific attribute on the object changes?

I have a Stock model that has the following callback: after_save :update_port_stock_current_price But I only want that executed if the Stock object being saved had the price changed. How do I detect if a specific attribute, i.e. stock.price has…
marcamillion
  • 32,933
  • 55
  • 189
  • 380
0
votes
4 answers

Rails 5 project without activerecord causing model generate error

I'm facing a problem in a project using Rails 5.2 without ActiveRecord. I've runned the command rails new project --skip-active-record and it's ok, but when I run a command to generate a model I get this…
sidneivl
  • 242
  • 3
  • 12
0
votes
0 answers

How to clone and re-face Ruby on Rails app with seprate database.

Building a ROR app (rails 5), pushing to github, using jet brains - ruby mine IDE and after building 1st app would like to use all the same code, class names and gems ect. with the exception of changing css and front page design. of the second app.…
Zurch
  • 39
  • 10
0
votes
1 answer

rails has_many :through or has_many_belongs_to

I was faced with the problem of composing associations. It turns out that I have a user, user can have many photo booths. also photo booths can have many users. This problem is solved, but I have Group photo booths. Group photo booths can have…
Artem G
  • 41
  • 4
0
votes
1 answer

heroku push suddenly failing

I pushed out to heroku last night, and now today my pushes are failing with the following error. Heroku status appears to be ok. My heroku config has RAILS_MASTER_KEY set to my master.key. That did not help. Any experience this...or, able to…
hellion
  • 4,602
  • 6
  • 38
  • 77
0
votes
1 answer

how to get IST time in heroku using rails app

how to get IST time in heroku using rails app config.active_record.default_timezone = :local inside the config/environments/development.rb.The above code changed the timezone from UTC to IST. inside config/environments/production.rb…
0
votes
1 answer

Cannot load redis cash store

When I start rails server locally (rails 5.2.0, ruby 2.5.1) with this configuration in develompent.rb config.action_controller.perform_caching = true config.cache_store = :redis_cache_storage with gem redis '4.0.1' installed I've this…
David71
  • 51
  • 3
0
votes
2 answers

Get a belongs_to relationship from class Ruby on Rails

Here are my models: class OrderItem < ApplicationRecord belongs_to :order belongs_to :product end class Order < ApplicationRecord has_many :order_items end Here is my controller: def index orders = Order.where(nil) render json:…
0
votes
1 answer

Rails 5.2 doesn't render new view

I have a controller that was scaffold. In the state, when it is call it does not render any view. If I remove the @event = Event.new, it calls my view new. # GET /admin/events/new def new @event = Event.new end Started GET…
0
votes
1 answer

Rails 5.2.0.rc1 + Webpacker 3.3.0 Unable to find dev_server configuration

Using Docker and Docker Compose, I'm unable to get the webpacker service up and running after upgrading to webpacker 3.3.0. The output after docker-compose up is: webpack dev_server configuration not found in /app/config/webpacker.yml. Please run…
Archonic
  • 5,207
  • 5
  • 39
  • 55
1 2 3
35
36