Questions tagged [ruby-on-rails-4.2]

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

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

See Ruby on Rails 4.2 Release Notes for more information.

Resources

Related tags

702 questions
14
votes
3 answers

How do I properly migrate from has_secure_password to encrypted_password (as both use password_digest) without losing old passwords?

Migrating from has_secure_password to devise causes the following error in the console when interacting with user objects: .rvm/gems/ruby-2.4.1/gems/devise-4.4.0/lib/devise/models/database_authenticatable.rb:166:in `password_digest' I understand…
Ayrad
  • 3,996
  • 8
  • 45
  • 86
14
votes
2 answers

Change integer to float column table Rails

I need to change t.integer :mark_up to a float How can I do this? I have tried in my terminal rails g migration change_column(:stakes, :mark_up, :float) by keep getting a syntax error near unexpected token ('
Neil Murphy
  • 267
  • 1
  • 2
  • 10
13
votes
1 answer

What is the best way to use HTTP 2 with AWS Elastic beanstalk

I have a Ruby on Rails App hosted on AWS using Elastic-beanstalk which works with HTTP 1 now I want to use HTTP 2. Can someone suggest me the best approach
13
votes
1 answer

No such file or directory @ rb_sysopen - public/receipts/416981.pdf

Below on line no. 2, I am getting this error: Errno::ENOENT in OrdersController#print def generate_receipt(filename = nil, current_user = nil) filename ||= "public/receipts/#{id}.pdf" Prawn::Document.generate(filename, :page_layout =>…
Chitra
  • 1,294
  • 2
  • 13
  • 28
12
votes
7 answers

Rspec Using Development Database

I am using Rails 4.2 with Ruby 2.2 and rspec for testcases. I have set Rails.env = 'test' in both my spec_helper and rails_helper. Here is my database.yml file: development: adapter: postgresql encoding: unicode database: app_dev pool: 5 …
Aaditi Jain
  • 6,969
  • 2
  • 24
  • 26
12
votes
4 answers

RangeError for simple integer assignment in Rails 4.2.0 that should be caught by validation

* UPDATE: this is now fixed in 4.2.stable and 4.2.1 * in Rails 4.2.0 (and current 4.2.stable), the ensure_in_range method happens before AR validation, yielding a RangeError if I do something as simple as @obj.threshold = 10_000_000_000 on a column…
whatbird
  • 1,552
  • 1
  • 14
  • 25
11
votes
4 answers

Rails does not reload controllers, helpers on each request in FreeBSD 9.1

I've detected weird behavior of rails. Please give me some advice! For example I have a code like this: def new raise end I start rails server in development mode. Hit refresh in browser and see RuntimeError in…
11
votes
1 answer

Rails 4.2 DEPRECATION WARNING: `serialized_attributes` is deprecated without replacement,

This warning shows up for me (for everyone) in the majority of controller tests. I know its just a warning...for now...until 5 is released. I am unsure what I need to change to comply with this deprecation. What has changed with…
hellion
  • 4,602
  • 6
  • 38
  • 77
11
votes
1 answer

Installing Rails 4.2.0.beta1 – Bundler could not find compatible versions for gem "sprockets-rails"

I've attempted to install Rails 4.2.0.beta1 (released Aug 20, 2014). I get an error Bundler could not find compatible versions for gem "sprockets-rails". Here are the details: $ bundle update rails Fetching gem metadata from…
Sergey Alekseev
  • 11,910
  • 11
  • 38
  • 53
10
votes
1 answer

Docker Container running very slow for Rails Application on development mode

I am facing an issue on docker container. Rails Application is running very slow(means pages taking too much time to load on the browsers). Application details: Rails Version: 4.2.0 Ruby version: 2.2.0 When I checked the status of memory by command…
Rohit Lingayat
  • 716
  • 6
  • 23
10
votes
1 answer

rspec-rails 2.14.2 with Rails 4.2 InvalidURIError

I have gem 'rspec-rails', '~> 2.14.2' in my Gemfile. After upgrading from Rails 4.1 to Rails 4.2 I've got the following error while running rspec: Failure/Error: get 'api/...' URI::InvalidURIError: the scheme http does not accept registry part:…
Sergey Alekseev
  • 11,910
  • 11
  • 38
  • 53
9
votes
2 answers

Attribute saved in development but not in production

I have the following helper method: def parse_potential_followers(params) t_id = TestSet.where(:test_name => params[:test_set][:test_name]).pluck(:id)[0].to_i screen_names = params[:potential_followers].first[1].split("\n").reject(&:blank?) …
8
votes
2 answers

Render partial to String in view helper

How can I render a partial to a String in Ruby on Rails 4.2, since render_to_string is deprecated? Something like: rendered_string = render_to_string partial: 'forgotten_orders/soonest_manufacturing_date', locals: { forgotten_order:…
fkoessler
  • 6,932
  • 11
  • 60
  • 92
8
votes
2 answers

How to run code automatically when launching a Rails console?

Let's say I wanted a greeting every time the Rails console comes up: Scotts-MBP-4:ucode scott$ rails c Loading development environment (Rails 4.2.1) Hello there! I'm a custom greeting 2.1.5 :001 > Where would I put the puts 'Hello there! I\'m a…
at.
  • 50,922
  • 104
  • 292
  • 461
7
votes
2 answers

Scope resolution works differently in ruby when written in different ways

I faced this issue while developing a feature.Lets say there is following code: case 1: module Person module Employee class Officer def self.print_class(obj) obj.is_a? Employee end end end end case 2: class…
1
2
3
46 47