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

707 questions
7
votes
1 answer

Rails action Mailer raise_delivery_errors, how does it works? How to detect bounces?

I have a Rails 4.2.0 application which sends lots of mails, it's a elearning platfrom. At the moment I have problems with bounces, Lots of the Mails coming back because the Mail-Adresses aren't valid. One way is to solve the problem manually,…
Felix
  • 4,808
  • 9
  • 45
  • 130
7
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,130
  • 10
  • 53
  • 88
7
votes
1 answer

Redirect same page to different language with Globalize & Friendly_id

I've been scratching my head for the last few hours, looking for an answer but I can't find it anywhere. My gem file: # Use globalize for translating models gem "globalize", github: "ncri/globalize" # for Rails 4.2 gem 'globalize-accessors', '~>…
7
votes
1 answer

Should I use rails 4.2 add foreign_key or not?

By release of rails 4.2 add_foreign_key method was introduced. As far as I understand it is used as combo of migration with model:references and add_index. Let's say I only use PostreSQL. (add_foreign_key is limited to MySQL and PostreSQL). Should…
Filip Bartuzi
  • 5,027
  • 6
  • 42
  • 92
7
votes
1 answer

How to make Rails 4.2 work with Postgres Jsonb?

I've seen a few blog posts claiming that rails 4.2 added support for the new Jsonb data type in Postgres 4.2. However, googling gets me zero results on how to actually use the datatype. Since I'm not depending on key order and I would like my…
TheSuper
  • 586
  • 5
  • 11
7
votes
5 answers

Why does Rails 4.2 + responders keeps telling me to add responders to the Gemfile?

I'm upgrading a Rails 4.1.8 app (also using rails-api ~> 0.3.1) to 4.2.0.rc2 and would like to retain the respond_with functionality. I've added responders to the Gemfile, but when I bin/rake spec, I…
turboladen
  • 659
  • 1
  • 9
  • 14
7
votes
2 answers

`@@{' is not allowed as a class variable name (SyntaxError) while using s3 gem + rails 4.1.5

I know this type of question is already asked. I use s3 gem to upload my files in s3 bucket. But after s3 gem installation, when I start rails server it shows this error: /var/lib/gems/1.9.1/gems/aws-s3-0.6.3/lib/aws/s3/extensions.rb:223:in…
rick
  • 1,625
  • 3
  • 13
  • 28
7
votes
2 answers

Installing Rails 4.2.0.beta1 - Unresolved dependency found during sorting

I've attempted to install Rails 4.2.0.beta1 (released Aug 20, 2014). I get an error "Unresolved dependency found during sorting." Here are the details: $ ruby -v ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0] $ gem -v 2.4.1 $ gem…
Daniel Kehoe
  • 10,782
  • 6
  • 59
  • 79
6
votes
1 answer

How to use Rails with uppercase column name?

I have the following as part of an AR query: .having('COUNT(foo.id) > bar.maxUsers') This generates an error: ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR: column bar.maxusers does not exist …
B Seven
  • 39,557
  • 59
  • 208
  • 346
6
votes
0 answers

jsonb query in AREL

I'm fairly new to AREL, and have had trouble finding references to using Postgres JSONB with AREL. How might I convert this SQL into an AREL statement? SELECT tag, count(tag) FROM people p, jsonb_array_elements(p.data->'tags') tag…
ChrisJ
  • 1,662
  • 14
  • 28
6
votes
1 answer

mongodb connection refused docker-compose

The dockerfile consists as:- FROM ruby:2.2.3-slim MAINTAINER Milan Rawal RUN apt-get update && apt-get install -qq -y build-essential nodejs libmagickcore-dev imagemagick libmagickwand-dev libxml2-dev libxslt1-dev git-core curl…
codemilan
  • 900
  • 2
  • 9
  • 28
6
votes
2 answers

Minitest tests fail with custom HTTP headers in Rails 4.2

I am unable to successfully test custom HTTP variables in my Rails 4.2 application using minitest—for some reason, Rails doesn't seem to recognize them at all. I have the following test: require "test_helper" describe ApplicationController do …
partydrone
  • 431
  • 3
  • 14
6
votes
1 answer

NameError (uninitialized constant Unzipper::Zip) but only on Heroku deploy (Rails)

I have a class unzipper.rb that unzips a file using Rubyzip. In my local environment, I can succesfully unzip a file without explictly including the dependency using require 'zip' On Heroku though, I get an NameError (uninitialized constant…
madcow
  • 2,317
  • 12
  • 30
6
votes
1 answer

Custom views and assets for tenants in a multi-tenant rails app?

When using a rails engine, overriding views is as easy as creating new views in the right folder. But when creating a multi-tenant rails app where all tenants reside in the same app (they don't use an engine), how can one override views for…
Jacob
  • 5,787
  • 9
  • 35
  • 56
6
votes
3 answers

Generating dynamic child rows in Rails partial

I have implemented a nested attribute form using the nested attributes Railscast as a guide. As a result, the user can click an icon to dynamically add "child" rows to my view. Unfortunately, I can only make this work for the last icon in my view…
1 2
3
47 48