Data dodania Pytanie
2017-06-19 20:06 Ruby Sinatra Sessions in a JSX file? »
I'm a newbie to integrating react + ruby and was wondering if there is a way to access my sessions contents that I stored? For example, in my app.rb,...
(1) odpowiedzi
2017-06-19 17:06 Do Ruby symbols exist because strings are mutable and not interned? »
I've been with Ruby for about a year now and have a language question: are symbols necessary because Ruby strings are mutable and not interned? In, s...
(4) odpowiedzi
2017-06-19 16:06 Ruby - Rails - SQL query - reordering words in a search term »
I'm working on a project with a search function that is set up as follows: if params[:search_term].present? && params[:search_term].length &g...
(2) odpowiedzi
2017-06-19 14:06 Get single record from has_many using eager-loading in include »
I'm new to rails and stuck between eager-loading from last 2 days. I have two models Car and Images with Car has_many :images association. and I have ...
(2) odpowiedzi
2017-06-19 09:06 Can I do something like this in sinatra app? config files based on request »
for the following code i'm getting config_file method is not available for the request. How can I do something like setting config file for entire app...
(0) odpowiedzi
2017-06-19 04:06 How to delete elements from an array that are followed by the same elements »
I have an array. There are two 46s at indices 3 and 7: arr = [7, 68, 42, 46, 9, 91, 77, 46, 86, 1] I got a mission to sort this array using selecti...
(3) odpowiedzi
2017-06-19 04:06 Prevent users altering information via the back button? »
I made a very simple RPS application, the only issue is that players can currently change the outcome of the game by pressing the back button and sele...
(0) odpowiedzi
2017-06-19 03:06 Ruby on Rails - Whitelist some IP-adresses to see Full error reports on production »
In Rails 4 from config > environments > production.rb by changing: config.consider_all_requests_local= true, Devs can turn on Full error reports on pr...
(1) odpowiedzi
2017-06-18 18:06 Write an array to multi column CSV format using Ruby »
I have an array of arrays in Ruby that i'm trying to output to a CSV file (or text). That I can then easily transfer over to another XML file for grap...
(3) odpowiedzi
2017-06-18 15:06 How to find a object and insert it in a database »
I’m trying to pick up the shop_id and subscription_id from a cart and insert/save them into the purchase database. I have a cart, line_items and s...
(1) odpowiedzi
2017-06-18 13:06 What is the right syntax to go through json and display the data in a view - Rails 5? »
I'm having a little trouble displaying all of the values in a json response from an api especially round the rullings part where some of the values ar...
(1) odpowiedzi
2017-06-18 12:06 Open image in browser with Ruby »
Learning Ruby, early stages. I have a very simple script that I run on terminal and I want it to open files in browser based on user input. What code ...
(2) odpowiedzi
2017-06-17 22:06 undefined method and attr_accessor »
I want to collect data from an input which is not in my model. So, I tried to use a "attr_accessor" but it's don't work and I don't know why ... There...
(1) odpowiedzi
2017-06-17 19:06 Ruby Module has access to class methods it was required in? »
I don't quite understand how this works: module Perimeter def perimeter sides.inject(0) { |sum, side| sum + side } end end class Rectangle ...
(1) odpowiedzi
2017-06-17 17:06 Instantiate class and push to array Ruby »
I'm trying to instantiate all the classes in the scenes directory and add them to my scenes array. So far the code looks like it should work but I get...
(2) odpowiedzi
2017-06-17 15:06 Rails 5 Active Record Record Invalid Error »
I have two Rails model namely Invoice and Invoice_details. An Invoice_details belongs to Invoice, and an Invoice has many Invoice_details. I'm not abl...
(2) odpowiedzi
2017-06-17 11:06 Rspec feature test - issue for render blank page »
I don't know why but chrome renders blank page after completion of first it block. create_account_spec.rb : require 'feature_helper' require 'rails...
(1) odpowiedzi
2017-06-17 08:06 Why show undefined on rails select? »
i have a ajax select on a rails app that is showing undefined on select as shown below, I added the order scope to fix, but if I remove the order l...
(2) odpowiedzi
2017-06-17 06:06 How does Ruby(or other languages) Implicitly know which object belongs to which built in class? »
Classes, their methods, their variables etc. have been a very new concept for me and also something that has been difficult for me to fully grasp. I...
(2) odpowiedzi
2017-06-17 05:06 How to add an extra field in the registration form generated by devise? »
I'm learning ruby, OOP and Rails. My app use the devise gem for registering users. It only offers the fields email, password, and password confirmat...
(1) odpowiedzi
2017-06-16 23:06 Tried to upload a project to Heroku, Heroku said my binstubs are mangled »
I am unable to upload a project to Heroku, after speaking to their support they have told me the following: Your binstubs are still messed up ...
(1) odpowiedzi
2017-06-16 23:06 How to check block is called using rspec »
I want to check whether the block is called in my function using rspec. Below is my code: class SP def speak(options={},&block) puts "speak...
(2) odpowiedzi
2017-06-16 22:06 Rails RSpec, DRY specs: shared example vs. helper method vs. custom matcher »
I have the following test repeated once for each HTTP method/controller action combination within a controller spec: it "requires authentication" do ...
(2) odpowiedzi
2017-06-16 21:06 How can I make follow form work with a list »
I have a relationship model that follow users back n forth now it works very well when I use it in users#show in my view just like this screenshot ...
(0) odpowiedzi
2017-06-16 19:06 Pass a ruby &block using rspec »
I want to test the functionality of the method using rspec that receives anonymous block and not raise error. Below is my code: class SP def speak(...
(1) odpowiedzi
2017-06-16 18:06 Can't seem to run a process in background of Sinatra app »
I'm trying to display a number from an api, but I want my page to load faster. So, I'd like to get the number from the api every 5 minutes, and just l...
(1) odpowiedzi
2017-06-16 14:06 Rails 3 #update_attributes »
I'm working on a Rails 4 app that was previously upgraded from Rails 3. I haven't worked much Rails 3 before. I came across this something like this u...
(2) odpowiedzi
2017-06-16 11:06 Ruby: How do you include a % sign in sprintf output? »
I have: sprintf("%02X" % 13) Which outputs: =>"OD" I want my output to be: =>"%0D" I've tried: sprintf("\%%02X" % 13) but I get an e...
(3) odpowiedzi
2017-06-16 06:06 Getting error while migrating db in ruby on rails project on windows 7, with ruby 2.3.3 and rails 4.2.5.2 »
I am getting below errors on prelauch project on github. I have install postgres db but i am not getting which gem is having PGconn , PGresult and PGe...
(0) odpowiedzi
2017-06-16 06:06 rbenv: no such command `shell' - Configure RBENV per app/directory on 16.04 sudo environment »
Running (x)ubuntu 16.04 with sudo user ... installed rbenv with local user + sudo plugin cd ~ git clone git://github.com/sstephenson/rbenv.g...
(1) odpowiedzi
2017-06-16 05:06 check if url can be loaded in an iframe »
Snip.ly nicely checks if the entered web address can be used in an iframe. I'd like to replicate it in ruby. Looking through their code they send an a...
(0) odpowiedzi
2017-06-16 01:06 Sinatra Page Not Loading Properly »
I am trying to learn Sinatra. I wrote a script to scrape the job listings from Craigslist and list them on my page (just as an exercise). The output ...
(0) odpowiedzi
2017-06-15 20:06 I need a solution for clean the attachment files uploaded when I test with RSpec »
Hello guys I'm using RSpec for testing and I have some test for upload files using factories. I set up the database cleaner but, when I do a tree on ...
(1) odpowiedzi
2017-06-15 19:06 Delete a Docker image from inside an RSpec script »
TL;DR: I can't delete my Docker image from inside my RSpec script, because RSpec still has a dependent container I'm using RSpec to test my Dockerf...
(0) odpowiedzi
2017-06-15 17:06 Chartkick Datepicker/Range Selector - Possibility to choose dates to show data »
I am using ahoy gem to track visits & chartkick gem to show the data to users. In users dashboard page, I have around 3-4 charts and each of them...
(1) odpowiedzi