Data dodania Pytanie
2017-04-22 21:04 Stopping counter with rails-timeago »
I am timing a task from the date with the gem rails-timeago. The count appears in the view and I use the following code for this: <% = Timeago_tag...
(1) odpowiedzi
2017-04-22 12:04 Angular 2 redirect if user have shop »
How i can make redirect if User -id(this.authTokenService.currentUserData.id) have shop (owner_id) . Shop.component.ts owner_id :number; pri...
(3) odpowiedzi
2017-04-22 11:04 Hello everyone, my blog app with paperclip gem throws error while pushing it on heroku »
remote: ! remote: /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3c...
(1) odpowiedzi
2017-04-22 05:04 RSpec how to test an argument data type passed to a method »
I need to test the passed argument type is an integer. Here is my test spec: require 'ball_spin' RSpec.describe BallSpin do describe '#create_ball...
(2) odpowiedzi
2017-04-22 04:04 How do I know that a gem is compatible with a version of rails? »
I'm just getting started with ruby on rails and as I follow the tutorial, there isn't an explanation of how certain gems were gathered and placed in t...
(3) odpowiedzi
2017-04-21 23:04 EJS in rails production not compiling properly »
I have a rails app that uses EJS templates. It is running perfectly on development, but in production, it acts like the EJS processing step is skipped...
(0) odpowiedzi
2017-04-21 22:04 Rails advanced Active Record query »
I want to do an advanced Active Record query on my models through a join and count all the records. I don't know whether it's possible to do what I wa...
(2) odpowiedzi
2017-04-21 22:04 Rspec nested controller test not passing params into my controller »
I'm having trouble passing my params into a nested route through rspec. I'm using Rails 5 and Rspec 3.5 My spec looks like this: require 'rails_hel...
(1) odpowiedzi
2017-04-21 20:04 A form inserted through ActionCable wont verify »
I have a setup where User A rejects User B's offer. This triggers ActionCable to push a form created using button_to to User B informing him of this, ...
(0) odpowiedzi
2017-04-21 18:04 "NameError: wrong constant name" after upgrading Rails 3.2 to 4.2 »
I'm upgrading a Rails app from 3.2 to 4.2 and when running tests, I'm getting NameError: wrong constant name (that's the full error message, nothing s...
(2) odpowiedzi
2017-04-21 17:04 Are ActiveRecord's find_or_create* methods fundamentally flawed? »
There are a few methods: first_or_create_by, find_or_create_by, etc which work on the principle: talk to the database to try to find the stuff we wa...
(2) odpowiedzi
2017-04-21 16:04 Ruby on Rails: how to copy objects from one category to another »
I'm trying to copy some latest recipients (subscribers) to a new category in my newsletter app. I ran following lines of code in Rails console but ins...
(1) odpowiedzi
2017-04-21 14:04 Rails nested fields_for with has_many relationship »
Rails: 3.2.18 I am attempting to build a nested form which accepts attributes for a has_many relationship. In this case the form is for a Listing whi...
(1) odpowiedzi
2017-04-21 14:04 Rails: Allow one session to be :pinned at a time »
I'm working on pinning a session for a company to the top of a list. A company should be able to pin a single spark session to the top of their list...
(1) odpowiedzi
2017-04-21 12:04 How do I capture server-side errors on Capybara Feature JS Tests using a lazy loader? »
Versions: Rails 5.0.2 rspec 3.5.0 rspec-rails 3.5.1 capybara 2.12.1 (w/ chromedriver/selenium for JS tests) ruby 2.3.3 gitlab-ci Past (and desired...
(1) odpowiedzi
2017-04-21 09:04 Unpermitted parameter when trying to update record »
I have two models, ProjectCategory and ProjectQuestion. A ProjectCategory can have many questions related to it, and a ProjectQuestion can only have o...
(1) odpowiedzi
2017-04-21 05:04 Multiple Aggregations on same level in Elasticsearch-rails »
I am trying to perform multiple aggregations at the same level with ElasticSearch using the elasticsearch-rails and elasticsearch-model gems. In the ...
(0) odpowiedzi
2017-04-21 01:04 I want to get the data from many to many table »
I want to get the data from many to many relationship table (Tag-Service-Category) like this below in tag/show.html.erb. class Tag < ActiveRecord:...
(1) odpowiedzi
2017-04-20 22:04 Argument validation error in rspec »
I am working on a project which built on ROR framework. Suppose there are two /lib files 1. lib_file1 2. lib_file2 lib_file1 :- doing some task prede...
(0) odpowiedzi
2017-04-20 19:04 Format Months in Rails views »
In the rails console I can put in: 3.months => 3 months 1.months => 1 month I would like to have this output in my views as well, I tried: &...
(1) odpowiedzi
2017-04-20 19:04 Rails view helpers and formatting very long lines in html.erb files »
Some of my html.erb files are very long. Due to multiple attributes and sometimes conditions. For example: <div class="comment-container"> &...
(1) odpowiedzi
2017-04-20 16:04 Make single ActiveRecord query through several associated models »
I have the following models and associations: class Organization has_many :buildings end class Building has_many :counters end class Counter ha...
(1) odpowiedzi
2017-04-20 15:04 Simplecov- " # :nocov: " not ignored in coverage metrics »
I've wrapped my ApplicationMailer file inside a # :nocov: block because it's not yet implemented and I don't want it included in code coverage metrics...
(0) odpowiedzi
2017-04-20 15:04 More than one enum value for an attribute »
Suppose I have the following very simple code snippet enum role: [ :admin, :enginier, :medic, :user ] I want one of my users to have the role of [:a...
(1) odpowiedzi
2017-04-20 14:04 Search in jsonb and array combination in postgres with rails4 stored_accessor »
I have a model called Event, where I have stored_accessor "list" (stored like data: {"list"=>[{"key"=>"key1", "value"=>"value1"}]}). I need...
(1) odpowiedzi
2017-04-20 10:04 Instances of a model belonging to the same model Rails »
I have planned to build a complex sidebar menu with several layers of nesting, which displays links to different types of pages. Hence the model clas...
(2) odpowiedzi
2017-04-20 06:04 Ruby - Custom Marker with Logo (Google Maps) »
Hi to the person/s that can help. At the moment, I'm working on Google Maps that will have multiple markers but each marker will be unique with a com...
(0) odpowiedzi
2017-04-20 06:04 action cable - not receiving response on client »
When I run my react-native mobile app, the server says it connects to the PostChannel. It creates the post, however I get no response in the 'received...
(0) odpowiedzi
2017-04-19 23:04 Schedule an ActiveJob in Rails »
I'm doing a weather API which will get, process and save data from another API. In order to get the daily updates (request URL info, get the JSON/XML ...
(3) odpowiedzi
2017-04-19 16:04 ActiveRecord multiple where date range »
Is there a more ActiveRecord idiomatic way to find which records have a start_at or end_at within a certain date_range? (Basically, need to find the r...
(2) odpowiedzi
2017-04-19 12:04 ActiveRecord - Use Include together with Select »
client.rb class Client < ApplicationRecord belongs_to :address end address.rb class Address < ApplicationRecord has_one :state ...
(2) odpowiedzi
2017-04-19 12:04 Rspec test view renders another partial »
I have a view: pugin/elements/_list Inside this view it renders a different partial given that conditions are met. I'm looking to test that the view ...
(0) odpowiedzi
2017-04-19 07:04 How do I make certain pages of my ruby on rails application inaccessible to one of my STI based Devise User model types? »
I want one pages of my ruby on rails web application inaccessible to one of my STI model types. I have two models typeA and typeB inheriting from User...
(2) odpowiedzi
2017-04-19 04:04 Capybara InfiniteRedirectError »
I am getting the same behavior whether it's in the browser or running rspec... How can this issue get resolved? I have tried removing the before_fil...
(1) odpowiedzi
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