Data dodania Pytanie
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 17:06 How to customize the JSON that respond_with renders in case of validation errors? »
In a controller, I want to replace if..render..else..render with respond_with: # Current implementation (unwanted) def create @product = Product.cr...
(2) 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 16:06 Many-to-many User and Company association with multiple user 'groups' »
I'm having a bit of trouble wrapping my head around this. My goal is to create a relationship like this: Companies can have many Users (team members...
(2) 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 10:06 How to use multiple databases for Rails server? »
I have a Rails application which is using PostgreSQL database and a huge user base is expected. Is there a way to use multiple databases, may be one d...
(2) odpowiedzi
2017-06-12 04:06 Rails 5 form for submitting array passed as string »
I have a serialized Array field in my model called :cords, and part of my form looks like so: <%= form_for @group do |f| %> .... <p&...
(1) odpowiedzi
2017-06-12 03:06 ActionController::InvalidAuthenticityToken in Rails 5 »
I'm getting ActionController::InvalidAuthenticityToken in rails 5. It was working correctly for a while, and then just gave up working. # Applicatio...
(3) odpowiedzi
2017-06-11 22:06 Rails query with Countries gem »
I have a model: Car. Each car belongs to a Museum and each museum is in a particular country. The country is stored as a two-character country code. ...
(1) odpowiedzi
2017-06-11 19:06 Subscription class not found 'MyChannel' in ActionCable »
I am facing a problem while working with Action Cable, whenever I run my program I receive an error that says Subscription Class not found Conversatio...
(2) odpowiedzi
2017-06-11 03:06 How can I return nil instead of an error from a missing hash key? »
I have a hash, and I'm looking for a certain key inside it. But sometimes hash itself can be nil. In this event, I don't want hash["key"] to return an...
(4) odpowiedzi
2017-06-11 03:06 Ruby on Rails Best Design Pattern Instead of Single Table Inheritance? »
I'm a junior developer working on a new Rails App and need some assistance in deciding which design pattern is best to use to model different types of...
(1) odpowiedzi
2017-06-11 00:06 Create ActiveRecord has_one through association »
Given the ActiveRecord models and associations below, I need to add a has_one :owner association on the account model to reference a user whose accoun...
(1) odpowiedzi
2017-06-10 19:06 Ruby 2.4.1 - warning: constant ::Fixnum is deprecated »
I'm new to StackOverflow and Rails, so I am hoping this is not too naive a question. I am trying to run my application locally using bin/rails server....
(1) odpowiedzi
2017-06-10 19:06 Rails compatible photo archive »
I'm looking for a free cloud based photo archive that would allow me to access folders (or albums). Preferably something that would allow me to just ...
(0) odpowiedzi
2017-06-10 17:06 RSpec Issue with have_css »
I'm using Rails 5.1.1, RSpec 3.5.0 & Capybara 2.7.1. I want to have a test that checks for a navbar on the home page, according to some documents...
(1) odpowiedzi
2017-06-10 16:06 How to upload images for ruby on rails app using paperclip gem onto IBM Bluemix Object Storage using S3 API? »
I have been using the tutorial: https://devcenter.heroku.com/articles/paperclip-s3 For adding images to S3 storage on AWS, but now want to use IBM's ...
(2) odpowiedzi
2017-06-10 04:06 How is the best way to refactor a long string line in ruby? »
I have a line of code like this "#{envelope_quantity} - envelope #{Budget::util_name(envelope_size)} #{Budget::util_name(envelope_paper)} #{Budget::u...
(3) odpowiedzi
2017-06-09 22:06 Rails 5 allowing a JSON field through strong parameters not working »
I'm trying to let through a deeply nested JSON field in my model (document => field_instance => value). I was using an empty hash due to a misundersta...
(1) odpowiedzi
2017-06-09 18:06 How to fetch record from deep nested association? »
I'm just starting up with RoR so bare with me if I call things wrong. I have these 3 models for example. Board, Truck, Driver. Here's a sketch of wh...
(3) odpowiedzi
2017-06-09 16:06 Rails: Query using relation or directly using #where »
I am from UI/ColdFusion background, sorry if I am asking a silly question. Let's say we have two models Book & Page and a book has many pages. No...
(2) odpowiedzi
2017-06-09 14:06 How to check user input against pattern? »
In my Ruby on Rails application I need to check user input against patterns consisting of letters, numbers and a few special characters (like dashes a...
(5) odpowiedzi
2017-06-09 13:06 rails query not in statement formatting correct »
I do this: check1 = inquiries.select("question_id").where(:membership_id => self.id) This returny a active Record array with entries like th...
(2) odpowiedzi
2017-06-09 13:06 Use joins for condition over each specific record - rails »
I'm new to rails and stuck in between when I'm facing this situation: I have a Car model, Location Model and a Ride Model and relationships like as:...
(1) odpowiedzi
2017-06-09 07:06 WebMock stub data from Aws CognitoIdentityProvider »
I have the following module in a Rails controller concern: module AwsAuth extend ActiveSupport::Concern require 'aws-sdk' def get_cognito_use...
(1) odpowiedzi
2017-06-09 00:06 Asynchronously set rails authenticity token »
I have a page that is cached at the CDN level that I would like to have a form submission on. I have followed technique 3 of this post in order to as...
(1) odpowiedzi
2017-06-08 22:06 Devise confirmable not sending email on test on Rails 5.1 »
ActionMailer::Base.deliveries is an empty array on test env with rspec, so emails are not being sent. visit root_url(subdomain: false) fill_in "claim...
(0) odpowiedzi
2017-06-08 20:06 Devise - How to trigger a sign_in on page user already has access to »
I am using Devise 3.5.2. I have an Item model with a show action that anyone can access( before_filter :authenticate_user!, except: :show). On the sh...
(2) odpowiedzi
2017-06-08 18:06 How to associate two joining models in ActiveRecord? »
Lets assume we have 2 AR models: class User < ApplicationRecord has_many :proposals has_many :concerns end class Job < ApplicationRecord ...
(1) odpowiedzi
2017-06-08 13:06 Is this failing radio button feature test a Capybara syntax issue? »
I have a form with a radio button for a boolean attr prev_cover, displays Yes or No in browser with param values of true or false and saved in db as t...
(2) odpowiedzi
2017-06-08 13:06 Wicked PDF: How to remove top margin from COVER page? »
I'm generating pdf's from html using wicked_pdf. Right now, I want to remove top margin on the first/cover page . This is a snipped code from my cont...
(0) odpowiedzi
2017-06-08 07:06 Paperclip image not showing, unpermitted params and routing error »
I'm trying to display images on the homepage with paperclip and I have unpermitted params and a routing error. I have tried various solutions includin...
(1) odpowiedzi
2017-06-08 01:06 Accurately measuring rspec/capybara testing time? »
I'm trying to speed up tests and so far have done things like remove unnecessary database writes (using new instead of create and not using factorygir...
(1) odpowiedzi
2017-06-08 00:06 Why do I need to migrate the test database in Rails? »
After creating a new migration file, running the migration, then running my tests I receive: Failure/Error: ActiveRecord::Migration.maintain_test_sch...
(3) odpowiedzi
2017-06-07 23:06 Is there a cleaner way to get a hold of an ActiveRecord query interface? »
I have this which works, but I thought there might be a specific method for it. @deals = Deal.where("1=1") if @dealFilter.min.to_i > 0 @de...
(1) odpowiedzi