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
0
votes
2 answers

How delete routes from memory in Rails

In my application I dynamically enter routes by Rails.application.routes.append command For example: Rails.application.routes.append do resources :example end My problem is that I do not know how I could delete these routes. I tried using the…
0
votes
2 answers

Error after rails migration 4.2.6 to 5.1.0

I have migrated one of my rails project from 4.2.5 to 5.1.0 I follow this tutorial for migration: https://hashrocket.com/blog/posts/how-to-upgrade-to-rails-5 After migration when I run rails db:migrate I found following error. NoMethodError:…
Md Sirajus Salayhin
  • 4,974
  • 5
  • 37
  • 46
0
votes
1 answer

Updating the record in two Active Record Callbacks

Ok, stumbled upon this weirdness. I have this in my user model. after_create :assign_role, :subscribe_to_basic_plan def assign_role self.role = 1 self.save end def subscribe_to_basic_plan self.customer_id = "hello" …
ivanibash
  • 1,461
  • 2
  • 14
  • 37
0
votes
1 answer

Rails and RSpec: ActionController::UnknownFormat error

I have been trying to test Paperclip file uploads using RSpec with Rails. When I run the server, I have no problems, but when I run my (very basic) RSpec test, I receive the following error: Failure/Error: visit root_path …
Freddy
  • 1,229
  • 2
  • 13
  • 22
0
votes
1 answer

Compatible actionpack missing for a Rails 5.1.0rc1 to 5.1.0 migration

I've been trying to migrate my Rails app from 5.1.0rc1 to 5.1.0. This is my gemfile: gem 'rails', '~> 5.1.0' gem 'mysql2', '>= 0.3.18', '< 0.5' gem 'puma', '~> 3.0' gem 'sass-rails', '~> 5.0' gem 'turbolinks', '~> 5' gem 'uglifier', '>= 1.3.0' gem…
Cornelius
  • 378
  • 1
  • 2
  • 12
0
votes
2 answers

Apartment gem giving unexpected error when generating model on Rails 5.1.0

I am new to rails platform. I'm building a multi-tenant application using Apartment gem. I'm following https://medium.com/@balogic/using-apartment-gem-to-implement-multitenant-concept-in-rails-b86f7d9e37c5 this guide to learn how to use this gem.…
0
votes
0 answers

How to use Devise helper methods

I am trying to build a Rails server for my client while implementing Devise controllers, and am facing a lot of issues. When using Warden.authenticate(resource_name)! for logging purpose, I get "401 unauthorized", but I am able to sign-up properly…
0
votes
1 answer

Rails: Worker failing and increasing memory usage

I've got a weird issue when using Sidekiq with Algoliasearch in my Rails application. Whenever I start sidekiq, it automatically performs all actions I configured with Algoliasearch: # A post model include AlgoliaSearch algoliasearch if:…
heroxav
  • 1,387
  • 1
  • 22
  • 65
0
votes
0 answers

Console shows correct value but view's incorrect

Im getting a json object with HTTPart gem. I need to iterate, convert to integer then do x: data.first["x"] = ["0", "0", "2", "5" ] I need to convert the values to int: arr = data.pluck(:x).map(&:to_i) # How to remove all zeros in one go? I need…
Sylar
  • 11,422
  • 25
  • 93
  • 166
0
votes
1 answer

How to get value of particular name in xml file

700054480 5012
Anish
  • 558
  • 3
  • 10
  • 33
-1
votes
4 answers

will-paginate broken with Rails 5.1?

Ever since upgrading to Rails 5.1, I get the following error when trying to paginate unfiltered (but not filtered) user table results: I use will-paginate 3.1.6 and Rails 5.1.0. I'm not even sure which line is causing the error; presumably it's the…
Sprachprofi
  • 1,229
  • 12
  • 24
-1
votes
1 answer

Can't access non-persisted associations in RSpec

Problem: I have two models called Contract and Appendix. The latter has the scope persisted for excluding non-persisted objects. I'd like to write spec for the scope but seems I can't access non-persisted associations inside specs at all. Models:…
Andres
  • 2,099
  • 3
  • 22
  • 39
-1
votes
1 answer

How do i record a user information such as email in RubyOnRails?

I am creating a post request for Forgot Password request. So I generated a controller using: rake generate controller post forgot_password Now since I want to record a user email on my form so defined them as follows: def forgot_password …
-1
votes
1 answer

Rails devise: user_signed_in? not working #Rails5.1

I tried to use Rails devise: user_signed_in? not working but it not worked. I also tried it after in VM Box, even changing the system but it's not working. please see the image . In spite of having signed in, it's showing sgin_in page but not admin…
-1
votes
2 answers

Error ActiveRecord::RecordNotFound in Rails

ActiveRecord::RecordNotFound in PicsController#show Couldn't find Pic with 'id'=1 Extracted source (around line #34): def find_pic @pic = Pic.find(params[:id]) end I cant resolve the error. My pics_controller.rb is as follows. class…
FAntony
  • 534
  • 7
  • 22
1 2 3
26
27