Questions tagged [rails-4-2-1]

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

47 questions
2
votes
2 answers

undefined local variable or method `resource_class' in devise

I am trying add a attribute called username to devise but rails shows me an error in the following line of code I am using rails 4.0.0 and devise 3 def configure_permitted_parameters devise_parameter_sanitizer.for(:sign_up) { |u|…
juan perez
  • 323
  • 5
  • 14
2
votes
2 answers

how setup active_job and rescue scheduler?

I'm trying to create background jobs for email notification and scraper. I use resque-scheduler (4.0.0), resque (1.25.2) and rails 4.2.1. My config.ru file: # This file is used by Rack-based servers to start the application. require…
bmalets
  • 3,207
  • 7
  • 35
  • 64
1
vote
1 answer

Check all products belong to a category are enabled or disabled?

I have products belongs to a category and each product has status enabled and disabled enum status: [:disabled, :enabled]. On Category page I want to check weather all products in category all enabled or not. I tried below code which return array…
O'hare
  • 13
  • 5
1
vote
1 answer

Post request parameters getting truncated in Rails 4.2.2 with content type as "Application/xml"

I have this below observation: I deployed a sample Rails 4.2.2 application with a controller and action to receive a POST request. Now If I send a POST request to this application with some POST body say a hash like {"1"=>"hello","2"=>"bye"} and if…
Vipul Kumar
  • 259
  • 1
  • 2
  • 12
1
vote
1 answer

Rails 4 has_many :through with collection_check_boxes and additional join table text_field

I've already searched about the whole internet but I can't get this forms working. Here's the thing: I have two models connected by a has_many :through join model: estoque.rb class Estoque < ActiveRecord::Base has_many :mpm_ests has_many…
balataca
  • 23
  • 5
1
vote
1 answer

Rails 4.2.1 on ubuntu 15.04 execution error

I've just installed rails 4.2.1 and ruby 2.2.2. When I run rails new blog, I get the following error rbenv: rails: command not found The `rails' command exists in these Ruby versions: 2.1.6 I'm new to linux and it'll help if anyone can tell me…
0
votes
1 answer

How to access specific model in rails config/production.rb file?

I want to send exception mail to email_ids stored in yb_notifier_email_ids table. Previously, email_id was hardcoded in production.rb file. I want to send mail by using model. But as configurations file are loaded before active_records I am not able…
0
votes
1 answer

Create Google Contact through API in Ruby On Rails

I need some help with Google integration. I need to create google contacts through the Google Contacts API but all the gems I can find only gets the contents and it also seems like the Google Contacts API doesn't support JSON posts, only…
IDP
  • 75
  • 6
0
votes
2 answers

With Rails4.2 I'm not able to handle Exceptions like RoutingError

My application_controller.rb code is: class ApplicationController < ActionController::Base# Prevent CSRF attacks by raising an exception.#For APIs, you may want to use: null_session instead. protect_from_forgery before_filter: set_current_user …
Govind Mantri
  • 803
  • 1
  • 11
  • 24
0
votes
0 answers

Rgeo, activerecord-postgis-adapter does't fire SQL statements for attributes of type point

So I'm running rgeo with activerecord-postgis-adapter and have a Rails 4 app's db.yml file set up correctly. But when I set the attributes of a ActiveRecord model like: Place .create(name: 'some name', geom: RGeo::Geographic.spherical_factory(:srid…
Keith Johnson
  • 730
  • 2
  • 9
  • 19
0
votes
1 answer

How called view 'show' when id is in other controller

I have a link_to on index refinancings <%= link_to "View details", refinancing_path(@refinancing) %> This refinancing_path(@refinancing) is refinancings/6 for example My route is simple: resources :refinancings, except: :destroy And my controller…
0
votes
4 answers

No implicit conversion of Symbol into Integer. A error still no solution for me

I have a view with checkboxes and input text. I checked one checkbox and digit value on input, after submit. But have two problem... A error on params and don't save the values on my table, this is my code: refinancings_controller.rb def new if…
Elton Santos
  • 571
  • 6
  • 32
0
votes
2 answers

Couldn't find Authorization with 'id'=0 using each_with_index

I have this error and this is my code: params[:authorization][:contract_ids].each_with_index do |index, id| Authorization.find(id).update_column(value_solve: params[:authorization][:value_solve]) end This started with 0, and…
Elton Santos
  • 571
  • 6
  • 32
0
votes
1 answer

Show a selectbox with all registers that employee using or no associations

So, I have a model Refinancing belongs to employee and employee has many refinancings. This employee can have many register (but register is just a column). In view refinancing, how make for show a selectbox with all registers? I tried <%=…
0
votes
2 answers

Pass only checkboxes checked for other view

I have two views, the first is a table that show all authorizations, how I make for pass only the authorizations checked for other view? This is first view: (all ok here) (...) <% @authorizations.each do |authorization| %> …
Elton Santos
  • 571
  • 6
  • 32