Questions tagged [ruby-on-rails-5.1]

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

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

Major Features

  • Yarn Support
  • Webpack
  • Encrypted secrets

See Ruby on Rails 5.1 Release Notes for more information.

Resources

Related tags

397 questions
6
votes
2 answers

Unknown parameter in Rails 5.1 strong parameters issue

So my reconciliation model looks like this: class Reconciliation < ApplicationRecord belongs_to :location belongs_to :company has_and_belongs_to_many :inventory_items accepts_nested_attributes_for :inventory_items, allow_destroy:…
6
votes
1 answer

install bootstrap gem or yarn add bootstrap for rails 5.1 or both

After getting a project setup in rails 5.1 with --webpack=react option should I install the bootstrap gem? or use yarn add bootstrap? Or would I need both if I'm using rails and react components throughout a project? Also, are there pros and cons of…
Luke Popwell
  • 381
  • 1
  • 3
  • 15
6
votes
4 answers

Can ActiveAdmin load javascript bundled by webpack? - Rails 5.1

I've upgraded from rails 4.2.6 to rails 5.1, and then started to use webpack. All set up for using webpack have done, but I can't figure out how to load javascript files on the ActiveAdmin page. ActiveAdmin loads…
6
votes
2 answers

RSpec Request Warning - Rails 5.1 Upgrade - The Asset not present in asset pipeline

I was in the process of upgrading a Rails 5.0.1 app to Rails 5.1 and encountered some deprecation warnings. I was able to resolve all but one. I did some searching around and didn't find a definitive answer. Background This is an app that was just…
Ziyan Junaideen
  • 3,270
  • 7
  • 46
  • 71
6
votes
1 answer

Integrating ActionCable with Webpacker in Rails 5.1

I am upgrading my app from Rails 5.0 to 5.1, and there is one thing I can't find being mentioned anywhere - usage of Webpacker to process ActionCable JavaScript files. I realise that Webpacker and the asset pipeline are supposed to work side by…
6
votes
2 answers

Rails 5.1 Capistrano Deploying with secrets.yml.key

I'm attempting to deploy to a staging environment with capistrano. I've set up my encrypted secrets and tested on development, and the secrets appear available. I've setup the staging environment config for read_encrypted_secrets = true. My secret…
5
votes
2 answers

In Rails 5, how to drop the default value of primary key i.e. 'id' column and make it auto_increment again?

In my rails application, there is a table with 'id' column default value set to 0. I want to drop this default value and make this column auto-increment again. I have tried change_column_default(:table_name, :id, nil) but it doesn't seem to work…
Mohsin Sethi
  • 803
  • 4
  • 16
5
votes
1 answer

How to install local fonts for rails 5.2

I am trying to add a font to my Rails 5.1 project, however, it seems the project can't find the font. Here is the directory for the fonts: app ├── assets │   ├── config │   │   └── manifest.js │   ├── fonts │   │   ├── Open-Sans.eot │   │   ├──…
Ning
  • 399
  • 4
  • 14
5
votes
1 answer

Rails convert secrets to credentials

I updated my Rails app from 5.1.6 to 5.2.1 and we were using secrets before. We'd like to switch to credentials since it was supposed to replace secrets. There are a couple of things I'm wondering: 1) Is there a "Railsy" way to do this? I'm aware I…
Ccyan
  • 1,057
  • 12
  • 32
5
votes
1 answer

What is making Rspec take over 4gb of memory to run 500 specs?

I am working on an application that has more than 500 specs when I run these specs on my local machine it successfully passes. But when these specs run on CircleCI, the process is killed. I tried to investigate the problem by tracing the memory on…
Ahmad Rezk
  • 198
  • 1
  • 13
5
votes
3 answers

How do I iterate over a collection of objects, one at a time being rendered in a view, without using a multi-step form?

I have a collection of objects. What I would like to do is iterate over the entire collection, but show each object on a page/view by itself, and allow the user to interact with each object individually. Ideally, I would prefer not to use a…
marcamillion
  • 32,933
  • 55
  • 189
  • 380
5
votes
1 answer

Rails 5 ActionView::Template::Error occurred in controller#action: "nested transaction"

I have recently migrated from 4 to latest 5.1 rails (and from thin to puma server). I have a non-repeatable error and I am not able to trace it's source. Below is a an example application backtrace: …
Kodak
  • 1,779
  • 2
  • 18
  • 29
5
votes
2 answers

ActionController::RoutingError (Couldn't find..., expected it to be defined in...)

So...first time asking a question to StackOverflow... I converted an existing Rails 4.2.5 app (using Ruby 2.2.4) to a Rails 5.1.3 app (using Ruby 2.4.1), following the Rails Guides and the RailsApps Project. Firing up the development server…
TKChattoraj
  • 111
  • 1
  • 6
5
votes
1 answer

Rails 5.1.0 how to upgrade

Rails 5.1.0 introduces the bigint primary keys and foreign keys. All new tables will have bigint pk and creating a reference migration to an old table will not work since the old pk is a normal int. Using change_column _, :id,:bigint just errors…
Iaan Krynauw
  • 311
  • 3
  • 16
4
votes
1 answer

wicked_pdf_image_tag resolves to public folder when looking for images

I want to render an image that a user uploads in a PDF. I am saving the image to the current Rails directory public folder. Images are being saved at the moment inside the public folder. Everything works in development but when in production, it is…
1 2
3
26 27