Data dodania Pytanie
2017-10-07 18:10 RSpec -- Tests seeming to be getting stuck »
So I have a handful of tests. These have run in the past, but now when I run rspec it seemingly just hangs. Any thoughts here or best approach to go ...
(1) odpowiedzi
2017-10-07 10:10 Rails js.erb not rendering partial file but get response file rendered »
I have the following partial files _report.html.erb <h5>REPORT</h5> <hr/> <%= link_to "Extract REPORT", "#", :class => 'btn...
(3) odpowiedzi
2017-10-07 02:10 rails rspec and capybara testing search box input »
I'm trying to figure out how to test a search box. in rspec\capybara I'm creating 2 jobs, visiting the page where the search box is, entering a searc...
(1) odpowiedzi
2017-10-07 01:10 ActiveRecord Recover associated records »
I have an app which models companies that have users who can even have meals. So I have a Company table, a User table and a Lunch table. The lunch co...
(2) odpowiedzi
2017-10-06 21:10 RoR - Model.all, but without created_at and updated_at fields »
I am new to Ruby, so this question might look stupid for you, yeah. But still... I got a model Group, and when I run this class GroupsController &lt...
(3) odpowiedzi
2017-10-06 21:10 Rails 5.1 ActiveAdmin error undefined method `klass' for nil:NilClass »
I am receiving the errors below when I try to view two specific Models through ActiveAdmin's dashboard. Everything I've read points to a possible asso...
(1) odpowiedzi
2017-10-06 21:10 Rspec and FactoryGirl: SystemStackError: stack level too deep rails »
I have one spec and one factory and I am getting this error: SystemStackError: stack level too deep from gems/activerecord-4.2.1/lib/active_recor...
(2) odpowiedzi
2017-10-06 20:10 Ruby variable value set to true »
I am new to Ruby/ Ruby on Rails. I wrote the below code to get a boolean value from api. The API call failed and it went to the rescue block. But for ...
(2) odpowiedzi
2017-10-06 18:10 Add column in rails migration but column doesn't exist right away »
I have an old migration that adds a column into a table, then immediate add some data in that column. def change add_column :table_name, :column_na...
(2) odpowiedzi
2017-10-06 14:10 how to write test case using rspec of this method »
I want to write test case for below method. I'm new to unit testing. Please let me know the correct way to write test case for below method. def crea...
(1) odpowiedzi
2017-10-06 14:10 Capybara doesn't care about event.preventDefault »
Testing Ruby on Rails application with RSpec, Capybara and Selenium. I want to click an anchor which has an href but shouldn't lead anywhere due to ...
(1) odpowiedzi
2017-10-06 13:10 Why is Rails returning a different float value when using a different database? »
I have an app running Rails 4.2 with this migration create_table "nutrient_amounts", force: :cascade do |t| t.integer "nutrient_id", limit: 4 t.i...
(1) odpowiedzi
2017-10-06 10:10 Rails pundit gem, permit view to non signed-in users »
I'm using the pundit gem in order to give permissions to three different users(Admin, seller, viewer). Currently I got everything working, admin has a...
(1) odpowiedzi
2017-10-05 23:10 uninitialized constant ruby model »
I have 3 classes: 1. Article class Article < ActiveRecord::Base has_many :categories_articles has_many :subcategories_articles has_many :...
(1) odpowiedzi
2017-10-05 21:10 Rails Active Record query with multiple optional params »
What would be the optimised way to create an ActiveRecord query in a Rails 4.1 application controller which can 0 to 4 optional query params, in absen...
(1) odpowiedzi
2017-10-05 21:10 Rspec can't find ActiveAdmin controller »
I'm trying to test a custom member action in ActiveAdmin using rspec. app/admin/inactive_user.rb ActiveAdmin.register InactiveUser do member_actio...
(1) odpowiedzi
2017-10-05 18:10 Uninitialized constant ApplicationController::JasperReport »
I followed this tutorial https://www.sitepoint.com/create-great-reports-jasperreports/. But I have this problem now: This is my "application_contro...
(0) odpowiedzi
2017-10-05 15:10 1 week from now at 8 o'clock »
I'd like to get a DateTime that is 1 week from now at 8 in the morning. Getting one week is easy: DateTime.now + 1.week How do I set the resultin...
(3) odpowiedzi
2017-10-05 14:10 Rails 5 API only with Devise, OmniAuth, Devise Token Auth callback issue while Facebook sign in »
I am trying to create a Rails 5 API only app to create signin functionality with Facebook. I am using the following gems: devise_token_auth omniauth_...
(1) odpowiedzi
2017-10-05 14:10 how to upload base 64 image through java script »
<div class="col-lg-3 col-lg-3"> <a href='javascript:;'> <img src="/assets/images/man/img.png" class="" width="100%" height="100...
(0) odpowiedzi
2017-10-05 13:10 Rails: Basic pundit gem setup for three users »
I'm using devise and I followed this in order to setup three users (admin, seller, viewer). Each user has it's on model, session_controller, registrat...
(2) odpowiedzi
2017-10-05 13:10 Is default rails controller#action execution time reliable and correct? »
to test my time of execution I use this code: ActiveSupport::Notifications.subscribe 'process_action.action_controller' do |*args| event = ActiveSu...
(1) odpowiedzi
2017-10-05 11:10 Chef, ruby hashes and templates »
I know this is more a ruby question than chef, but... I have some attributes like: default['my_cookbook']['some_namespace1']['some_attribute1'] = 's...
(2) odpowiedzi
2017-10-05 01:10 Writing tests for API token auth controller in Rspec »
I am following this tutorial to create token authentication: tutorial Here is the controller code from the tutorial Session controller for API: cla...
(0) odpowiedzi
2017-10-04 23:10 Rspec - archives array to match tested array »
I'm having this class method on my Post model for getting archives def self.archives Post.unscoped.select("YEAR(created_at) AS year, MONTHNAME(cr...
(2) odpowiedzi
2017-10-04 22:10 Open-Uri hanging/timing out »
I am trying to use open-uri with Nokogiri class Script require 'nokogiri' require 'open-uri' open("http://www.ruby-lang.org/") {|f| f.eac...
(0) odpowiedzi
2017-10-04 18:10 Dynamically create class »
I have the following code: module City class Bus < Base end class BusOne < Bus; end class BusTwo < Bus; end class BusSixty < B...
(2) odpowiedzi
2017-10-04 14:10 Invalid verification code format facebook oauth 100 »
I am integrating my app on facebook But its give an error with code 191 {"message"=>"Invalid verification code format.", "type"=>"OAuthExceptio...
(0) odpowiedzi
2017-10-04 12:10 How to declare a scope based on embedded model attributes with Mongoid »
I have a User model which embeds a Profile: # app/models/user.rb class User embeds_one :profile end # app/models/profile.rb class Profile embedd...
(3) odpowiedzi
2017-10-04 11:10 Rails not keeping session data when doing ajax with remote=true »
I am working with a rails app and trying to do an ajax request with rails remote: true . The request is supposed to trigger one of my controller actio...
(1) odpowiedzi
2017-10-04 09:10 Rails: before_action :authenticate_admin! doesn't work »
I'm doing this in routes.rb: devise_for :admins, :skip => [:registrations], controllers: {sessions: 'admins/sessions'} devise_scope :admin do ge...
(1) odpowiedzi
2017-10-04 00:10 Using submodel accessor (STI) on parent params for nested forms »
i have the following models: class Order < ApplicationRecord class Bill < Order class Preorder < Order class Detail < ApplicationRecord ...
(1) odpowiedzi
2017-10-03 23:10 ActionController::UrlGenerationError in UsersController#create ... missing required keys: [:id], possible unmatched constraints: [:locale] »
I had some nice form that had been working well, but once I add some translations, I get following error: Here are some important files I have: ro...
(1) odpowiedzi
2017-10-03 22:10 Change 32-bit PK to BIGINT on 32-bit rails app »
I have a Rails 3.2.18 app running on 32-bit Ubuntu using MySQL as the backend. The PK for one of my tables is a 32-bit integer and has recently maxed ...
(1) odpowiedzi
2017-10-03 22:10 rails wrong year -4712 »
irb(main):002:0> require 'date' => true irb(main):003:0> x = Date.new => #<Date: -4712-01-01 ((0j,0s,0n),+0s,2299161j)> As you can...
(2) odpowiedzi