Data dodania Pytanie
2017-04-19 03:04 Rails How make a conditional inside a method on the model »
I'm trying to make that just the user can feedback on a feedback method in the feedback model. but in the logs shows NoMethodError (undefined meth...
(2) odpowiedzi
2017-04-19 02:04 Rails undefined method `name' for nil:NilClass and I don't get why »
Hi guys I am developing a system I created on RoR My idea is that a person can attend to serveral events, So I have 3 tables: Person, event, and atte...
(2) odpowiedzi
2017-04-19 01:04 How to add data to returned ActiveRecord query records »
I'm doing a simple query to a database table to send off to an external service, but I need to add an element to each of the returned records before I...
(1) odpowiedzi
2017-04-18 23:04 how to get single latest record from a view and test it in console »
I kinda have 2 questions. I have following model and method to get the latest record from view. but when i try to test in console i get error undefine...
(2) odpowiedzi
2017-04-18 20:04 How to allow HTTP requests to other docker containers with RSpec? »
I have a docker project with a few different moving parts, and I want one container to be able to call the API of another container. However, sending...
(0) odpowiedzi
2017-04-18 19:04 MRI duplicates memory allocation when Thread.new »
It seems that MRI makes duplication of memory allocation for every new thread. I use Ubuntu x64, ruby-2.2.4 (rvm), and this what i get: Just started...
(0) odpowiedzi
2017-04-18 19:04 How does count work in Ruby when a string is set as the parameter? »
How does count work in this code: name= "abcdef" puts name.count("aeiou") puts name.count("^aeiou") Does it count for the occurrences of "a", "e", ...
(1) odpowiedzi
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 17:04 Sinatra event triggered by Rufus Scheduler »
Trying to send an event from within Rufus Schedulers results in this error: { 70231586340180 rufus-scheduler intercepted an error: 70231586340180 ...
(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 14:04 EXEC at remote server using paramaterized query »
I am trying to run the following SQL on a Linked Server; INSERT INTO dbo.test (FirstName, LastName)Values(?,?) dbo.test exists on a linked server w...
(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 16:04 How to correctly use require? - ruby »
I have this small project I've been working on. In this project, I've been using the rspec to test the classes, so my project folder is structured li...
(1) odpowiedzi
2017-04-17 16:04 Binary tree maze generation in Elixir »
I have an implementation of a binary tree maze generation in Ruby, in a purely OO way. I'm trying to rewrite this in Elixir as a learning exercise but...
(1) odpowiedzi
2017-04-17 12:04 How to output variable in sinatra without <%= »
In Rails, there exist such helper as "concat" to output variables inside <% %> block for erb remplates. Which helper can I use in Sinatra to perfor...
(1) 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 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 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 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 01:04 Create dynamic method that takes argument »
Is it possible to declare dynamic methods with define_method that does an instance_exec of a block with arguments ? Something like this : class D d...
(1) odpowiedzi
2017-04-16 01:04 How to map with different parameters - ruby »
I'm creating some tests and I would like to create an array of objects passing different parameters to the constructor, is there a smart way of doing ...
(3) odpowiedzi
2017-04-15 23:04 Ruby loop outputs duplicates »
How can the duplicates from this code output be stopped. RE = /<("[^"]*"|'[^']*'|[^'">])*>/ TAG_RE = /<(.+?)>(.*?)<.+?>/ text =...
(1) odpowiedzi
2017-04-15 23:04 Type Casting a Column to bigint in Padrino Active Record »
I have upgraded to the latest Ruby on a Padrino application and I am having errors with active record when creating a new object. It's validating a nu...
(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 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 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-15 01:04 Enabling HTTPS with Rack, Puma and Sinatra? »
I have a Ruby web application built with Sinatra, Rack and Puma. I'm using Sinatra to implement the controllers (MVC pattern), each handling a differe...
(0) odpowiedzi
2017-04-14 22:04 Youtube Api, cannot upload videos ruby »
I have been looking for a solution to upload my videos on youtube automatically. So naturally i went and looked up the Youtube api (ruby). The sample ...
(1) odpowiedzi
2017-04-14 22:04 How to display data on the same page once a button is clicked [Sinatra/Ruby] »
I'm practicing making a web app in Sinatra and I'm trying update a page so that information from a database is displayed once a button is clicked (mor...
(1) odpowiedzi
2017-04-14 19:04 undefined method test for MyModule »
I have following unit test. I am trying to test the exec method in MyModule::Base so i am trying to access it from another class method test. I am not...
(0) odpowiedzi