Data dodania Pytanie
2017-04-18 18:04 How to save a variable in an rspec expect? »
I have something along the following lines in one of my spec files: expect(my_instance).to receive(:my_function).with(arg: instance_of(String)) I w...
(1) odpowiedzi
2017-04-18 14:04 Grape entity multiple class inside module not loading »
Currently i'm using grape and grape entity, the current following structure works fine. # app/api/proj/api/v2/entities/committee.rb module PROJ::API:...
(0) odpowiedzi
2017-04-18 10:04 Getting the model class from active record relation »
I have a Rails model: class Foo < ActiveRecord::Base ... end Given an active record relation: limited_foo = Foo.where(...) how can I get th...
(1) odpowiedzi
2017-04-18 10:04 Postgres migrate uuid column type with default value doesn't work »
My migration is class AddUuidToUsers < ActiveRecord::Migration def change add_column :users, :uuid, :uuid, null: false, default: 'uuid_gener...
(1) odpowiedzi
2017-04-18 10:04 put object to a specific folder in aws S3 ruby »
I was trying to upload files using Aws sdk rails gem. Everything is successful except I can not find a way how to upload files to a specific folder ...
(1) odpowiedzi
2017-04-18 01:04 ActionController::UrlGenerationError with POST #create action in RSpec »
I'm writing an e-commerce site, and I'm running into a problem with one of my tests. My test for the create action looks like this: require 'rails_he...
(2) odpowiedzi
2017-04-17 20:04 How to sort an array based off another array which holds the indexes »
I have array a that holds the position of what the array b should. a = [3, 2, 0, 1] b = ["hello", "hi", 2332, "ben"] I want to sort b so that it wi...
(2) odpowiedzi
2017-04-17 17:04 Rails Engine - NameError: uninitialized constant »
I'm creating a Rails Engine Classification, in which I have the Class Passion and a Concern Passionable. I have also another engine Post, where I in...
(1) odpowiedzi
2017-04-17 15:04 Add sum array to active record object where something equals something »
I want to sum my amount column plus display my original activerecord object together where my @val emp_no = @sell_back emp_no. Question is how can I c...
(0) odpowiedzi
2017-04-17 11:04 Apply validations on attribute when a function with same name exists »
chats Schema: create_table "chats", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| t.integer "chat_type", limit: 2, ...
(1) odpowiedzi
2017-04-17 09:04 Google reCAPTCHA doesn't work »
This question has been asked before at here and here. but the solution does not work for me, the reCAPTCHA sometimes works but most of the times doesn...
(0) odpowiedzi
2017-04-17 08:04 Sidekiq process dies silently »
I have 2GB droplet on Digital Ocean and things seem to be working until last week and all of sudden my sidekiq processes seems to be disappearing enqu...
(0) odpowiedzi
2017-04-17 08:04 Errno::ENOENT - No such file or directory @ rb_sysopen »
I'm trying to send an email attachment using action mailer in ruby on rails and I keep getting this error. The problem seems to be that it can't locat...
(2) odpowiedzi
2017-04-17 04:04 Rails - Checkbox not working with Remember Me for Authlogic? »
So I have been using Authlogic to allow user account creation and authentication. I have most of the features I want for the user but I am currently r...
(1) odpowiedzi
2017-04-17 02:04 Couldn't find Product with 'id'=search »
I'm just starting with RoR and i got an issue. Earlier, I asked hear and nobody could fix it. I would like to make a simple search form, where i wo...
(2) odpowiedzi
2017-04-16 22:04 ActiveRecord::UnknownAttributeError - a missing attribute in a User model »
I am new to Ruby on Rails, and I am coming across an UnknownAttributeError through my rspec tests. Where and how do you debug this issue? Thanks in ad...
(2) odpowiedzi
2017-04-16 21:04 Rails: Object saving in console but not within app »
I know this must be a dumb error somewhere, but I've been going in circles trying to figure out why my objects only save within the console, and not i...
(1) odpowiedzi
2017-04-16 19:04 CanCanCan, Doorkeeper and RSpec »
When I try to write tests in RSpec I get an error CanCan::AuthorizationNotPerformed: This action failed the check_authorization because it does no...
(1) odpowiedzi
2017-04-16 18:04 pass params into rails path helper »
I'm trying to pass params into my rails path helper but my current attempt is not working. Here is what I'm doing now: <%= link_to "Pause Assignme...
(1) odpowiedzi
2017-04-16 17:04 How to create plans if they don't exist »
I want to create subscription plans in stripe programatically, and I want to be able to run this many times so if the plans exist it should just ignor...
(1) odpowiedzi
2017-04-16 14:04 syntax error, unexpected keyword_ensure, expecting ')' syntax error, unexpected keyword_end, expecting ')' »
i am getting these errors in my rails project when i add a new product " show.html.erb:52: syntax error, unexpected keyword_ensure, expecting ')' sh...
(1) odpowiedzi
2017-04-16 00:04 Where are Rails helpers available? »
I'm referring to the modules you create in app/helpers. Are they available in: Views? Controllers? Models? Tests? Other files? Sometimes? All the ti...
(1) odpowiedzi
2017-04-15 20:04 How to test Controller post :create of JSON api on rails using rspec? »
I have been tearing my hair trying to make the test to pass. I have a JSON API that looks like this: { "data": [ { "id": "b99f8173-0492-4...
(1) odpowiedzi
2017-04-15 20:04 ActiveJob: Generate sitemap in response to content generation »
In my Rails 4.2 app, I'm using sitemap_generator gem to generate sitemaps. And use Heroku scheduler to execute the rake task. I think it'd be better i...
(0) odpowiedzi
2017-04-15 19:04 What to use instead of `render :text` in rails 5.1 and later? »
Rails 5.1 removes a whole load of previously deprecated methods. Among them is the old friend render :text. It was very useful when you need to rende...
(1) odpowiedzi
2017-04-15 19:04 How do I create/register a User model that has a belongs_to relation? »
I want the user to confirm their email before they add/edit their profile (it's a really big profile). On the POST /users(.:format) devise/regist...
(1) odpowiedzi
2017-04-15 16:04 Why is my Javascript returning null Record for cities when i select my State in Rails app, using city state gem »
I have been struggling to figure out why I am getting empty array and not getting results back for the cities when state is selected. I follow the blo...
(1) odpowiedzi
2017-04-15 15:04 ActionController::InvalidAuthenticityToken in DonationsController#create_user_account »
I am new in ruby on rails and I am trying to send the post request using ajax to the controller method but the it throw the exception ActionControlle...
(0) odpowiedzi
2017-04-15 15:04 grape each entity in a single file »
I want to have multiple classes inside grape entity file, this is the folder structure app/api/proj/api/v2/entities/committees.rb module PROJ::API::V...
(1) odpowiedzi
2017-04-15 10:04 Creating a nested model instance (has_many relation) on the view of its parent model »
I have a model A und a model B and the relation is A has_many B (and B belongs_to A). I have a model, a controller and views for A and only a model fo...
(1) odpowiedzi
2017-04-15 05:04 Rails f.select Save Id an Name at the same time »
I have a form with the f.select option. I want to add the Company ID and the Company Name when the company name is selected from the options. Is it po...
(2) odpowiedzi
2017-04-14 17:04 Rails ActiveJob - how to stop job from being enqueued in before_enqueue »
I am running Rails 4.2.8 and I want to make my job only run under certain conditions. Currently I am doing that check in the code that is calling the...
(1) odpowiedzi
2017-04-14 16:04 Rails. Rewrite clearance controllers »
I try add js in clearance controllers. Users-controllers rewrite ok, but sessions and passwords controllers not work. user_controller (work): class...
(0) odpowiedzi
2017-04-14 15:04 Rspec request specs and Rails 5 »
I'm starting a new project, my first with Rails 5.1.0. I have a pb with my first request spec. describe 'Users', type: :request do it 'are created ...
(1) odpowiedzi
2017-04-14 12:04 Error While Running rake db:migrate »
I have tried to run rake db:migrate on below-mentioned servers. 1st Server: OS: Ubuntu 14.04 Trusty Mysql Version: 5.6.33 Rake Version: 12.0.0 2n...
(2) odpowiedzi