Data dodania Pytanie
2017-03-12 06:03 Find all undefined variables in Ruby file? »
I am coming across lot of production issues related to undefined variables. How can I FIND all undefined variables in Ruby file? Is there any gem/scri...
(3) odpowiedzi
2017-03-12 04:03 Sinatra helper extensions/modules that can be used as static methods with namespaces? »
I want to write a helper extension that can be invoked using module's name, rather than directly as a DSL method in a classic Sinatra app. For exampl...
(0) odpowiedzi
2017-03-12 04:03 rails rspec rake task with parameters »
I have been working to get test coverage on the following rake task with the attached spec. However, nothing I appear to try sends the env parameter ...
(1) odpowiedzi
2017-03-12 01:03 Rails Couldn't find Object without an ID »
I'm trying to get the order of shop orders but Couldn't find Order without an ID error appear ActiveRecord::RecordNotFound (Couldn't find Order wi...
(0) odpowiedzi
2017-03-11 22:03 Getting PG:UndefinedTable: ERROR: when running migration to add friendships table (In development) »
I'm trying to build an app that has users and friendships. I am using Rails 5, Ruby 2.4.0, and PostgreSQL 9.5.6 I'm currently trying to implement th...
(1) odpowiedzi
2017-03-11 20:03 How to find a css element on the page if it is display: none? »
I'm running automated testing in Ruby. I'm trying to write a script that finds id with display:none (visible only in mobile form), and clicks it. ...
(2) odpowiedzi
2017-03-11 20:03 Active Record how to preload join for scoped relationships »
Thanks for taking a look at my question. I'm working on a Rails 5 API and am having trouble with a specific query. My db has 2 models - players and ...
(1) odpowiedzi
2017-03-11 19:03 Rails - strong params removing empty fields from nested attributes »
I have been working on this line of code for three days. I have the following strong params: def location_params params.require(:location).permit(...
(1) odpowiedzi
2017-03-11 18:03 Rails - how to protect an attribute against updating from outside of the model »
In Rails 5 I have a model with an attribute, value of which is never set directly but is always calculated in before_save callback instead. I would li...
(1) odpowiedzi
2017-03-11 16:03 Ruby on Rails - Hide JS and some functions from showing in my view »
In my application I have a each do and some JS code that I use to run some functions in my view. My each do is giving some strings that I use as a ar...
(0) odpowiedzi
2017-03-11 16:03 Different home page before signin in rails app rather then login page »
Here, whenever i try to open localhost:3000 it automatically changes into localhost:3000/users/sign_in and login form gets appear. But i don't want ...
(2) odpowiedzi
2017-03-11 15:03 How can I replay web requests on a production clone to control a release candidate? »
I have a critical Rails app running in production with a fairly standard setup: Rails 5 API, Puma, PostgreSQL, Sidekiq, Heroku. I also have a branch t...
(0) odpowiedzi
2017-03-11 15:03 Having trouble with Rspec. Getting routing error »
I'm working on a group project building a chess application & trying to understand why I am getting a routing error when running this test. I am t...
(1) odpowiedzi
2017-03-11 13:03 Why does ruby interpret ++ as +@ »
I am getting bizzare output in irb >> [1, 2] + + [3] NoMethodError: undefined method `+@' for [3]:Array from (irb):2 from /home/marko/....
(3) odpowiedzi
2017-03-11 13:03 Ruby on Rails Audit on Users model - auditable_type and auditable_id is nil »
I have a Rails app 3.2 that is using Audited and rolify for my user model, whenever there is a CRUD action, the audit table is recording it but it's n...
(0) odpowiedzi
2017-03-11 12:03 Rails: Setting locale appropriately to IP address »
I am trying to use request.location (geocoder gem), to set the locale appropriately to the clients IP address. This is what I've got: app/controll...
(1) odpowiedzi
2017-03-11 01:03 How do I find the index of any element from an array within another array? »
I have an array: ["a", "b", "c", "d"] How do I figure out the index of the first element of the above array to occur within a second array: ["next...
(3) odpowiedzi
2017-03-10 18:03 Watir web driver taking too long to get the selected item from drop down »
I am using watir web driver for web scraping, where I fill the form and get the results. The results also includes the dropdown list, from where I hav...
(1) odpowiedzi
2017-03-10 15:03 Ruby strings that appear the same are not equal, why? »
I am importing a CSV and creating rows using ActiveRecord. The CSV is: first_name,middle_name,last_name,degrees,email,induction_year (ie 2017),"induc...
(2) odpowiedzi
2017-03-10 14:03 Rails / RSpec: 'allow_any_instance_of' doesn't return multiple values »
I have this code in one of my tests: it 'returns ids when successful' do allow_any_instance_of(Importer).to receive(:import).and_return('12589', '1...
(1) odpowiedzi
2017-03-10 11:03 nested div tags in rails »
I want to achieve this HTML code in my view <div class="progress "> <div class="progress-bar bgclre3559b" role="progressbar" style="width:...
(1) odpowiedzi
2017-03-10 08:03 Rails Broadcasting log to Graylog Does not work »
I want to forward all logs to graylog server plus I want to maintain my actual Rails Log. I am using ruby gelf gem. https://github.com/Graylog2/gelf-...
(1) odpowiedzi
2017-03-10 07:03 Order and sort_by diffference in Ruby on Rails ActiveRecord »
I am tryig to sort my data according to timestamp field in my controller, note that the timestamp field may be null and may have some value. I wrote t...
(3) odpowiedzi
2017-03-10 06:03 How to test ActionMailer delivery_method in RSpec? »
I have 2 delivery_methods, switchable using a environment variable like so: config.action_mailer.delivery_method = :mailjet OR config.action_maile...
(2) odpowiedzi
2017-03-09 21:03 Testing controllers of a Rails shopify app »
I have a Rails app created through shopify_app gem and I'm trying to test my controllers using rspec. Since all my controllers inherit from ShopifyApp...
(1) odpowiedzi
2017-03-09 15:03 RSpec doesn't show full difference between return and expected »
When a run a test with JSON, the rspec doesn't show the full spec, so I can't see the diference between return and expected. The message of diff is s...
(1) odpowiedzi
2017-03-09 14:03 Why does the Ruby debugger return different values than the code at run time? »
See this simple Ruby class: require 'byebug' class Foo def run byebug puts defined?(bar) puts bar.inspect bar = 'local string' ...
(1) odpowiedzi
2017-03-09 13:03 How can I use Ransack gem to search a date and another value types in multiple columns? »
In my view I wanna search a value in a date column and a string column with the same text_field using Ransack gem. I've already known how to search...
(1) odpowiedzi
2017-03-09 13:03 what is necessary for authentication to be secure »
I'm currently trying to get a grasp on Sinatra, and i noticed there is no up to date authentication gem like devise for rails. I decided to just creat...
(1) odpowiedzi
2017-03-09 11:03 Preferred Log Level in Production »
What is the most preferred log level in production Rails app. I just read in doc that Logging has a small impact on production.Currently the log level...
(2) odpowiedzi
2017-03-09 11:03 Multiple form in rails »
Here I am trying to create a single form through which I want to save multiple data by one key press. For this I have created form in tabular format. ...
(1) odpowiedzi
2017-03-09 10:03 How to find current abstract route in Rails middware »
Rails version: '~> 4.2.7.1' Spree version: '3.1.1' TlDr: How do I get route as /api/products/:id or controller and action of that route in a middlew...
(1) odpowiedzi
2017-03-09 02:03 How to raise an exception instead of returning NaN »
I'm trying to find the place in my code from which a NaN is being generated, and I am thinking that, for that purpose, it would be very helpful to cha...
(1) odpowiedzi
2017-03-08 23:03 How can a ruby method not repond_to a method but also call the method? »
I'm working with a little method that checks to see if a Tenant has a feature enabled. Each Tenant has a TenantPlan which stores the flags. I also hav...
(1) odpowiedzi
2017-03-08 23:03 How do I iterate over a hash by ascending value? »
I'm using Ruby 2.4. I hvae a hash, whose key is a string, and whose value is a number (a positive integer). I iterate over pairs like so my_hash....
(1) odpowiedzi