Data dodania Pytanie
2017-10-08 22:10 How to get YAML files to render in middleman with erb »
I have a file written in yaml that I would like to render with middleman using erb. How do I render this so that the yaml file will be translated to H...
(1) odpowiedzi
2017-10-08 13:10 How to resolve Rails Active Record MySql database connection timeout and lost connection »
Ruby on Rails production server gets down in a random period of interval, and gives the error of database connection timeout. I could not figure out. ...
(0) odpowiedzi
2017-10-08 09:10 Latest Watir version supports Edge? »
I see WATIR supports Edge browser automation in official website. But when I tried to run my existing suite on Edge after setting the path for Microso...
(1) odpowiedzi
2017-10-08 04:10 overwrite let inside an it method to alter params send to subject »
It's possible to overwrite a let value inside an spec? I wanted to be able to set subject and modify my params within each test, something like: su...
(1) odpowiedzi
2017-10-08 02:10 How can I generate a link/route/path in Roda? »
How can I generate a path or url in a view in Roda? Will I need to use a plugin? If not, how else? Or will I have to hard-code urls/paths? In Rails I...
(1) odpowiedzi
2017-10-08 00:10 How to test that URI is called only once »
I have this method: def url @url ||= URI("#{API_BASE}/#{url_token}") end I want to test using rspec that the URI is called only once. However, as...
(1) odpowiedzi
2017-10-07 23:10 How to conditionally add a bootstrap class to a button in rails »
I have upvote/downvote buttons on a site that I want to display differently depending on whether the user has upvoted the post or not. I'm using the a...
(3) odpowiedzi
2017-10-07 20:10 Ruby refinements gotchas »
In Metaprogramming Ruby 2 in Chapter 2 at the "Refinements" section I found the following piece of Ruby code: class MyClass def my_method "ori...
(1) odpowiedzi
2017-10-07 19:10 Rails 5. How to submit from the form_tag to custom action? »
I'm a real newbie at Ruby and Rails, and I've been looking for the solution for two days. I need to submit data from form_tag to action 'create' in my...
(1) odpowiedzi
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 09:10 NoMemoryError in Array#max »
I'm working on a codewars problem to parse an integer and re-order its digits in descending order. My working solution is below; I decided to use stri...
(2) odpowiedzi
2017-10-07 06:10 Saving data in ruby on Rails without resources »
Its bit difficult for me to explain what I want, but still I will try my best. I created a form in Rails where user can fill certain fields. Now once...
(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-07 01:10 Need to break out a config method into its own namespace so it can have multiple configurations »
So I have a Sinatra::Base application that connects to Active Directory, and everything works perfect when there is only one Active Directory being qu...
(0) odpowiedzi
2017-10-07 00:10 Ruby - How to calculate subtotal of items in a grocery list »
I want to create a program where a user basically "creates" a grocery list where the user inputs item and price until they want to quit. If the user e...
(1) 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 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-06 03:10 Behaviours of a Ruby local variable shadowing an instance method »
I recently read a blog post about Ruby's behaviours with regards to a local variable shadowing a method (different to, say, a block variable shadowing...
(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 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 Rails 4.2 : Form with multiple models - param is missing or the value »
I'm having trouble with Rails 4.2 to create a form with multiple models. I'm creating a form to allow a user to order a gift card with a custom stripe...
(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 15:10 Unable to decrypt encrypted message using another instance of cipher »
I am using ruby version 2.4.0 and openssl version "OpenSSL 1.0.1f 6 Jan 2014", I am trying to implement an encryption/decryption for a security layer....
(1) 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 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 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 02:10 Not able to run selenium with firefox, Capybara and Docker in headless mode »
I'm trying to run tests with Selenium and Firefox with Capybara. When I run a test, it does a POST request to "http://127.0.0.1:4444:/sessions", it st...
(1) 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