ruby-on-rails-4.2 Questions

1

I'm running Rails 4.2 on Heroku (cedar), Ruby 2.1.6 I've got Sidekiq running locally on Redis with Foreman, and in my app I call Rails' new ActiveJob deliver_later methods like this, inside applic...
Copacetic asked 14/5, 2015 at 9:38

2

Solved

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_manufactu...
Baggett asked 6/5, 2015 at 14:59

1

Solved

How to make validation where presence of model's attribute isn't necessary, but if it is present, attribute's length must be more than three characters?

1

One of our Rails programmers keeps messing up our bin directory. He'll run bundle install and for some reason the bin directory fills up with scripts for almost all of our gems and the 5 scripts we...

1

Solved

inside controller: def update @user.update({approved: true}) UserMailer.send_approved_mail(@user) redirect_to(root_url) end inside user_mailer.rb class UserMailer < Devise::Mailer ...
Dayflower asked 1/4, 2015 at 9:3

2

Solved

I've tried to use caching with collections (with multiple solutions) the problem is that when ever I try caching the response become slower consider the following example of a collection that rende...

2

Is there a proper place for helper methods for models in Rails? There are helper methods for controllers and views, but I'm not sure where the best place to put model helper methods. Aside from add...

2

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 unexpect...
Quark asked 17/3, 2015 at 21:31

2

Solved

In rails 4.2 respond_with and respond_to have been moved to the responders gem. I've read that this is not the best practice. I use backbone.js for my app. For render all users in controller I us...
Purnell asked 10/2, 2015 at 1:59

3

Solved

I tried to connect localhost:3000 in windows rails server is running in vagrant(ubuntu 14.10) portforwarding is done when, I tried lynx 127.0.0.1:3000 in ubunutu, it works but, in windows, I c...
Rollicking asked 23/12, 2014 at 20:7

4

Solved

I installed Rails 4.2.0.beta2 per the instructions in RailsTutorial.org 3rd Edition (the one that just came out). I'm not using the cloudIDE and am instead using Ubuntu Trusty 32 via Vagrant on a W...

1

Solved

You can specify which queue to use when calling deliver_later in an ActionMailer by adding :queue as optional argument, e.g.: Notifier.welcome(User.first.id).deliver_later(queue: "low") Is there ...
Tumble asked 30/1, 2015 at 22:48

1

Solved

I'm stuck in a really weird issue. I recently updated from rails 4.1 to 4.2. In 4.1 everything worked fine. But now, in 4.2, it seems model concern content is beig ignored, even if the concern is f...

1

Solved

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_fo...
Burp asked 28/1, 2015 at 9:14

1

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:...
Parochialism asked 9/2, 2015 at 6:0

2

Solved

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/gem...
Cuffs asked 28/11, 2014 at 11:53

1

I have a rails app with a user model, which is able to have several roles. I implemented this using a bitmask like this: class User < ActiveRecord::Base DEFAULT_ROLES = %w[developer entreprene...
Tredecillion asked 5/2, 2015 at 4:38

1

My database.yml file does not seem to be picking up the environment variable correctly. When I put the password in directly, there are no issues, so I know it's not a password problem. I've also re...

1

Solved

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 dep...
Brusa asked 23/12, 2014 at 4:4

1

Solved

In the Rails 4.1.1 version of an app, I have the following create method in articles_controller: def create @article = Article.new(article_params) authorize @article if @article.save flash[:no...
Preordain asked 15/1, 2015 at 4:50

1

Solved

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...
Sesquicentennial asked 13/12, 2014 at 19:46

2

Solved

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...
Lani asked 22/8, 2014 at 2:7

1

Solved

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::InvalidURIEr...
Brainbrainard asked 29/11, 2014 at 10:38

1

Solved

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 rail...
Alit asked 24/8, 2014 at 17:2

© 2022 - 2024 — McMap. All rights reserved.