Data dodania Pytanie
2017-06-15 13:06 Ruby on Rails - Security Notifications »
I'm working on a project with ROR framework and the gem "Devise" for the authentication. Actually i have 3 model of users : User Admin Company I ...
(0) odpowiedzi
2017-06-15 09:06 Put gem class into namespace »
To my Rails Gemfile I added a new gem. It is used like this: Email::Client The issue I'm having right now is that I also have a class in my rails a...
(1) odpowiedzi
2017-06-15 09:06 Update with original value »
I have a Bank model with attributes id, name, code and rate. I just changed the rate method of bank model. But the problem is when I am updating the b...
(0) odpowiedzi
2017-06-15 07:06 Create a template and replace placeholders dynamically in Ruby On Rails »
I have a set template in which there is address informations and other set of user information. I have created a html file in the public folder and l...
(2) odpowiedzi
2017-06-15 06:06 Create an array of a range of letters starting after A and finishing after Z ie (B to AC) »
I am working with the Roo Gem and wanted to pull data from a spreadsheet based on standard A1 syntax. I have columns in the spreadsheet beyond Z so E...
(3) odpowiedzi
2017-06-15 05:06 Ruby on Rails: Why does calling a partial in my views take an extended time to render? »
For example, I'm calling three partials in my recipes/_cuisines.html.erb file: <%= render "recipes/cuisines/denmark.html %> <%= render "...
(1) odpowiedzi
2017-06-15 04:06 rails cannot create a new item »
I am working on creating a small rails app, and I have ran into a problem that I believe is in the backend of my database, but I don't know how to sol...
(3) odpowiedzi
2017-06-15 02:06 How to merge two array objects in ruby? »
If I start with two arrays such as: array1 = [{"ID":"1","name":"Dog"}] array2 = [{"ID":"2","name":"Cat"}] How to merge this array into one array li...
(4) odpowiedzi
2017-06-14 23:06 Rails ActiveRecord access record through has_many association using a different key »
Scenario I'm building an admin panel in Rails for an old app that i wrote a while ago therefore the database is not designed to work with ActiveRecor...
(3) odpowiedzi
2017-06-14 21:06 Scrape an entire API or rely heavily on it? »
I'm building a resort review site in rails. Currently, a User has many reviews, and each Review belongs to a User. The reviews table contains an exp...
(1) odpowiedzi
2017-06-14 17:06 How to cache a ActiveRecord model object which contains carrierwave uploader to Redis »
I have a user model which has a carrierwave uploader for storing ths users profile picture class User < ActiveRecord::Base mount_uploader :pro...
(1) odpowiedzi
2017-06-14 11:06 What's the cleanest way of chaining stream functions in Ruby? »
Let's say I have an array of stuff that I want to perform all sorts of wacky operations on. For example: my_array = [ { name: 'Lyra', age: 12 }, ...
(1) odpowiedzi
2017-06-14 11:06 Ruby on rails, Validation failed: Countries can't be blank »
it "renders index page" do projects_user = FactoryGirl.create(:projects_user) get :index, id: projects_user.id expect(response).to render_templa...
(1) odpowiedzi
2017-06-14 10:06 ruby set isn't unique »
For some reason the following code produce a set with duplicate values. I'm not sure how uniqueness of an array in ruby is defined so maybe this is so...
(1) odpowiedzi
2017-06-14 09:06 rspec - uninitialized constant Rails (NameError) - a new case »
Off course I read this: rspec testing throws Uninitialized constant Rails (NameError) But I am sure that there is nothing wrong with my code. Just ...
(0) odpowiedzi
2017-06-14 09:06 Testfirst.org - Learn ruby course - Rspec issue unresolved »
I would like to do the testfirst.org exercises although can't seem to get to the starting line due to a version issue/lack of knowledge on my part as ...
(1) odpowiedzi
2017-06-14 05:06 Why does this code throw an error when used inside the controller, but not the view? »
I have the following model: class User include DataMapper::Resource property :id, Serial property :name, String, required: true property :em...
(1) odpowiedzi
2017-06-13 22:06 Rails ActiveRecord_Associations_CollectionProxy with Single Table Inheritance »
I used Single Table Inheritance to model out Stores, Tailors, Orders, and TailorOrders. Orders belong to a tailor, but I am not able to access the ord...
(2) odpowiedzi
2017-06-13 21:06 Polymorphic has many though with STI in rails »
I've faced unusual situation with rails association and created simple sample to show that. Assume we have 4 models: 1) list.rb class List < App...
(1) odpowiedzi
2017-06-13 18:06 RSpec test for update within another action »
I am building an application in Rails 5 that sends user inputs back to a controller called "TestsController." If the params[:answer] matches the "corr...
(2) odpowiedzi
2017-06-13 17:06 Adding Hashes from an array »
I am trying to create an array/hash from an array of multiple hashes with same keys and an average of values. My array: [{:amount=>897500, :gross_...
(4) odpowiedzi
2017-06-13 17:06 Correct semantic usage of map »
I am trying to understand what is a semantically right way to use map. As map can behave the same way as each, you could modify the array any way you ...
(2) odpowiedzi
2017-06-13 12:06 Is incrementing an integer (using +=) thread-safe in (recent versions of) Ruby? »
I have used the following Python code to show that it is not thread-safe to increment an integer i on multiple threads: >>> i = 0 >>&g...
(1) odpowiedzi
2017-06-13 10:06 Editing existing record creates duplicate Rails 5 »
I had just been having problems with creating new records as posted here Can't create new record via form in Rails 5 app, so not sure if this coul...
(3) odpowiedzi
2017-06-13 09:06 Best Practices for RSpec expect raise_error »
I have some code for RSpec. My (or not my) Class can (or not) call specific exception. Ex, Class::Foo::Bar::TimeOutError. I want check it. describe :...
(0) odpowiedzi
2017-06-13 09:06 How to validate email is real or fake in Rails? »
I have a problem I need write validator in rails to checking an email is real or fake? I try to research but nothing. Can someone help me? Thanks ! ...
(3) odpowiedzi
2017-06-13 01:06 Rails 4: why is one way of rendering partials so much faster? »
I'm not sure if this is a Rails specific issue, hence the reason I tagged it ruby as well. I'm rendering a collection of event records via a partial....
(1) odpowiedzi
2017-06-12 23:06 My User_id is updated to nil every time I refresh my page in Rails »
I know what is causing this issue, but can't find the working alternative of it. I will describe the problem and hope for a good answer. So, I have ...
(0) odpowiedzi
2017-06-12 18:06 Why am I getting error "#let or #subject called without a block"? »
I wonder how to pass code to shared examples. I have these specs (snipped) let(:property) { subject.send(type) } context 'when one or both depe...
(0) odpowiedzi
2017-06-12 17:06 Getting all users from db that participated for an activity »
I am currently facing the following problem: Users are able to create activities. Other users have the possibility, to participate the activity. I now...
(1) odpowiedzi
2017-06-12 17:06 ruby on rails extending module in class instance »
using ruby 2.2, rails 4.1 I have a search result class that I would like to use to format the correct results depending on the type of search, ie ful...
(0) odpowiedzi
2017-06-12 16:06 RSpec working on Mac but not Windows »
I'm trying to run a very simple RSpec script on Windows, however whenever I use the command rspec <filename>.rb the command prompt just prints a...
(0) odpowiedzi
2017-06-12 15:06 create time steps array in ruby on rails in 30 or 60 minute increments »
I am creating a simple appointment keeper in Rails 4, and I need to create an array of times for the user to choose between a min/max. The user can a...
(1) odpowiedzi
2017-06-12 08:06 How do I get the whole error backtrace for rspec? »
Currently I am using parallel tests rspec allure 0.8.0 After I run the tests I get the following error: RSpec::Core::MultipleExceptionError I n...
(1) odpowiedzi
2017-06-12 07:06 Ruby default assignment ( ||= ) vs Rescuing error »
Since a ||= 1 is equivalent to a || a = 1, one can state that this is synctactic sugar for this: if a.nil? a = 1 end Likewise, given that session...
(3) odpowiedzi