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
14
votes
1 answer

Run single system test

To run a single test in Rails, we normally do: rails test TEST=test/system/invitation_test.rb But that doesn't work with system tests. Neither do this work: rails test:system TEST=test/system/invitation_test.rb With both those commandos above, all…
13
votes
5 answers

Difference between update and update_attributes

In Rails 5, what is the difference between update and update_attributes methods. I'm seeing the following results for both the methods Returns true/false Checking for active record validation Call backs are triggered and also regarding update…
Sam
  • 5,040
  • 12
  • 43
  • 95
13
votes
1 answer

I would like to know how to disable cookies in Rails 5.1

I have a small app which is used by company staff only. I don't use any 'cookies/session' information from Rails directly. Given current requirements to request acceptance for cookies etc. I would like to completely disable cookies so that Rails…
nexar
  • 11,126
  • 3
  • 29
  • 32
13
votes
2 answers

rails - Displaying image in view after uploading a file via Active Storage

I have a project that is on rails 5.1.2 and I am trying to implement Active Storage on it, following couple of tutorials online I am able to setup the Active Storage and I can see the data being saved inside the active_storage_blobs and…
Shairyar
  • 3,268
  • 7
  • 46
  • 86
12
votes
6 answers

Rails Console error after upgrading to Ubuntu 18.04

After upgrading from ubuntu 16.04 to ubuntu 18.04 I am receiving the following error when running rails console from the root directory of rails project. Only the console seems to be affected, I am able to start the puma server without…
James
  • 123
  • 1
  • 6
10
votes
1 answer

System tests VS integration tests Rails 5.1?

Before upgrading to rails 5.1 i test my rails app via integration tests. And 70% of my rails app is automated via integration tests. Means all of application simple and complex behaviors are automated via integration tests. Off-course rails did not…
Zia Qamar
  • 1,694
  • 1
  • 15
  • 35
10
votes
3 answers

form_with search field in Rails 5.1

In Rails 5.1 all the forms have to be done with form_with. In http://edgeguides.rubyonrails.org/5_1_release_notes.html#unification-of-form-for-and-form-tag-into-form-with I can only find examples for forms which are related to models. What is the…
wintermeyer
  • 8,178
  • 8
  • 39
  • 85
9
votes
4 answers

Deploy Rails 5.1 / Webpacker app with Capistrano

I have an Ubuntu server to deploy my Rails projects. In my Ubuntu server I had RVM. Now I want to deploy new projects with Rails 5.1 and webpacker. To deploy this projects, I've installed NVM, npm and yarn in my Ubuntu server. In my Rails 5.1 /…
Adrià Carro
  • 697
  • 1
  • 10
  • 22
9
votes
2 answers

Rspec request specs and Rails 5

I'm starting a new project, my first with Rails 5.1.0. I have a pb with my first request spec. describe 'Users', type: :request do it 'are created from external data' do json_string = File.read('path/to/test_data/user_data.json') params =…
Ruff9
  • 1,163
  • 15
  • 34
8
votes
0 answers

Wrong partial is rendered in Rails in some cases, possible fragment caching issue

I have a template that displays a list of events <%= render partial: 'event', collection: events, cached: true %> The partial event: <% cache event do %> Something <%= render…
8
votes
3 answers

Mysql2::Error: Table 'table_name' doesn't exist: SHOW FULL FIELDS FROM `table_name`

I am using rails 5.1.1 and mysql 5.7. I have a migration class: class CreateCompanies < ActiveRecord::Migration[5.1] def change create_table :companies do |t| t.string :ragione_sociale t.references :forma_giuridica, foreign_key: true …
vierigianni
  • 83
  • 1
  • 6
8
votes
1 answer

How to turn off BIGINT primary keys in Rails 5.1

Rails 5.1 migrations generates BIGINT (instead of Integer) for tables' primary keys (changelog). Is it possible to disable that somewhere in the config? If so, how to do disable it?
maicher
  • 2,625
  • 2
  • 16
  • 27
8
votes
1 answer

Rails 5.1 + Webpack.... images in CSS?

I'm trying to figure out how to use the --webpack method for a very simple Rails 5.1 app. I'm trying to use it for managing both JS as well as CSS (scss, specifically). This is so insanely frustrating though because there's no docs I can find…
Tallboy
  • 12,847
  • 13
  • 82
  • 173
7
votes
1 answer

Rails 5.1 ActiveJob on Puma development not performing specific enqueued job

I'm running Rails 5.1.4 server (Puma v. 3.10.0 in single mode), but having an issue with a specific ActionJob that get's enqueued correctly but often never performed. I have a handful of jobs. All but 1 specific job always gets performed…
6
votes
2 answers

How do i fix in ruby on rails the undefined method `alias_method_chain' error?

I have just cloned a github repo https://github.com/maxitron93/p2pcollective.com, as i was exploring this awesome p2p lending app i encountered an error NoMethodError: undefined method `alias_method_chain' for…
mwiti muchena
  • 111
  • 1
  • 6
1
2
3
26 27