Data dodania Pytanie
2017-07-29 11:07 crontab shows the mysql error »
I am creating the rails app with 'whenever' gem. And I defined the function in the User model and I want to execute the function every 7am. But my fu...
(1) odpowiedzi
2017-07-29 00:07 Google Directions/Geocoder API gives different results in Postman and Rails 5 »
I am using the Google Maps Directions API to calculate routes. Usually without problems. Now I have a case where I don't know whats happening. I hav...
(0) odpowiedzi
2017-07-28 19:07 Ruby how to write a consecutive division »
How to write a method to achieve this function efficiently? divide_array([a,b,c]) # return a.to_f / b.to_f / c.to_f divide_array([a,b,c,d,e]) # retur...
(2) odpowiedzi
2017-07-28 14:07 How to get key name from a enum value in Rails? »
I have a enum in my Model that corresponds to column in the database. The enum looks like: enum efficency: { High: 0, Medium: 1, Low: 2 } How can ...
(1) odpowiedzi
2017-07-28 14:07 get self as invoking class in parent in Ruby »
My first class which has constant. I want to make it to work somehow as dynamic value. class Post < ActiveRecord::Base TEST = ["#{self.name}", ...
(3) odpowiedzi
2017-07-27 18:07 Rails 4: Parsing large csv file »
I have a very large csv file that I need to read, parse, and then present the user with the data so they can make adjustments / verify that things loo...
(1) odpowiedzi
2017-07-27 14:07 Is there difference between using self.attribute and attribute in a model callbacks conditions? »
is there any difference in callback adding conditions by using self.attribute_changed? or attribute_changed? class PlayEvent < ActiveRecord::B...
(1) odpowiedzi
2017-07-27 12:07 How to fill dynamic form fields using capybara »
I have a form that contains a select box and a text field. The text field is displayed dynamically based on the selectbox selection. If the value of ...
(2) odpowiedzi
2017-07-26 22:07 how to set an unique id for link_to tag in rails? »
I need to separate unique ids for some linking purpose, I just want to know how to make an unique id for link_to? Like I am using: <%= link_to "E...
(1) odpowiedzi
2017-07-26 16:07 Error when creating new action to scaffold created controller in rails »
I am trying to create a new action list in my previously created Blog using scaffold. I am getting an error in Couldn't find Blog with 'id'= on...
(2) odpowiedzi
2017-07-26 10:07 Strip special characters and space of a DB column to compare in rails »
I have 4 types of last_name: "Camp Bell" "CAMPBELL" "CampBellJr." "camp bell jr." Now, in rails when an user is searched by it's last name like ca...
(2) odpowiedzi
2017-07-25 14:07 Get all unique associations in Rails 5 »
I have and object rides and ride belongs_to company. I get a list of rides @rides = Ride.where(...) What I need now is to store all companies of t...
(2) odpowiedzi
2017-07-25 14:07 Best way to get records from another model again and again - Rails »
I have a model Booking which contains space_id attributes associated with Space Model by belongs_to :space. Now I have multiple spaces and want to co...
(1) odpowiedzi
2017-07-25 08:07 After successful PayPal payment in rails how I save transaction id ND all the details into the model? »
After successful Pay Pal payment in rails how I save transaction id AND all the details into the model how i save payee's information to database aft...
(0) odpowiedzi
2017-07-24 17:07 Rails will_paginate endless scroll with an array that drops the first 3 items »
I have a partial where I'd like to drop or not show the first three articles in the array because they are in a featured articles section. I also want...
(2) odpowiedzi
2017-07-24 13:07 NoMethodError in Reviews#new »
i am trying to write a new review that is nested inside resturants but i keep getting no method error in reviews# new action. i keep getting a red lin...
(2) odpowiedzi
2017-07-24 08:07 Images are not retrieving on error »
I am storing multiple images using the nested fields for. If we upload invalid image, then the form throws error and uploaded image is not displaying ...
(1) odpowiedzi
2017-07-24 07:07 Stripe Payment Gateway issue ruby on rails (TypeError: window. multimedia (...) is null) »
Got this error on firebug console => (TypeError: window.matchMedia(...) is null) When I click on the paywithcard button than I will get (TypeError:...
(1) odpowiedzi
2017-07-23 19:07 How to submit Form inside From in Rails 4? »
I have two form (form inside the form) While I inspect form two then I am not getting as a form. So how can submit the form so that I am able to get p...
(0) odpowiedzi
2017-07-23 17:07 How to subtract time in ruby? »
New to Rails, so please bear with me. I have a :time type column in db for the field start_time. Now, I have to check whether the start_time is greate...
(3) odpowiedzi
2017-07-23 16:07 Why one method work perfectly for one action and do not work for another? »
I'm newbee in rails, so could you explain why method survey_type works for this (attempts/new): <h2 class="survey-title"> <%= @survey.name %...
(1) odpowiedzi
2017-07-22 16:07 Ruby on Rails Activerecord - ids are Exchanged in Model »
I use Ruby in Rails 4.2.0 with Ruby 2.1.0 and I have a self join association. Here is my migration: class CreateStateTemplates < ActiveRecord::M...
(1) odpowiedzi
2017-07-22 11:07 Rails - return last group (by date) »
I have some data that looks like this: generated_at code 1/7/17 aa 1/7/17 ua 1/7/17 tr 20/6/17 ua 20/...
(1) odpowiedzi
2017-07-21 22:07 Are arguments passed into UserMailer available to before_actions? »
I want to assign the same set of instance variables for multiple emails based on the argument passed into mailer. Something like this: class UserMail...
(1) odpowiedzi
2017-07-21 12:07 Capistrano deploy one server at a time »
I am using capistrano for our RAILS deployment. We want to deploy to one server first, and after deployment is finished on the first server, then we w...
(2) odpowiedzi
2017-07-21 01:07 Ruby/rails: saving a sample of has_many relationship to database? »
Asking this question re: a student project I'm working on and I have tinkered for too long without being able to come up with a solution. I have a cl...
(2) odpowiedzi
2017-07-20 19:07 Passing value params from one method to another method rails »
I have a method: index that gets the value of the checkbox per post def index session[:post] = params[:checkbox_array] end The value of params[:c...
(1) odpowiedzi
2017-07-20 17:07 Add custom name to time_zone_select field in Rails form »
I want to add a custom name to a select field in my Rails form. The field is generated using the time_zone_select form option helper. I used 'name'=&g...
(1) odpowiedzi
2017-07-20 15:07 Inserting a space after appending multiple actions in activeadmin »
I'm having an issue while trying to append multiple actions in the index page in activeadmin. I used this code to append two actions in activeadmin....
(1) odpowiedzi
2017-07-20 14:07 Rails how to organize views »
I have one app with two different views per controller. So I want to have mysite.com/old/accounts should be rendered old templates. At mysite.com/ne...
(1) odpowiedzi
2017-07-19 15:07 Rails 4 Conditional Elastic Search, adding a select field to the index for searching »
I have a automotive production website, that i was tasked to add to the UI and using an existing elastic search, the new select input must filter the ...
(0) odpowiedzi
2017-07-19 15:07 Rails Spring configuration similar like in Zeus? »
I have something like this in Zeus custom plan, where I run some rake tasks: require 'zeus/rails' class CustomPlan < Zeus::Rails def rots `...
(1) odpowiedzi
2017-07-19 07:07 Render custom layout instead of application layout »
When an error occurs during create process, render new action is invoked. I need to display the custom layout for new. Instead it is displaying the ap...
(2) odpowiedzi
2017-07-18 17:07 ActiveModel::Serializer - How can I catch and handle errors for individual resources during collection serialization? »
In a rails application, I have a collection I'd like to render as json. Some of the items in the collection may not successfully serialize due to err...
(0) odpowiedzi
2017-07-18 13:07 Includes associated objects without reloading current instance »
I'm trying to find a way to load associated objects to my current instance of user. I've an instance of user which I want to pass to a service for bu...
(0) odpowiedzi