Data dodania Pytanie
2017-02-18 18:02 Ruby: access values through tap »
I've got a Calculator class that reads like so: class Calculator DEFAULTS = { price: 4.25, size: 10000 }.freeze def initialize(lead) @...
(1) odpowiedzi
2017-02-18 12:02 How to parse email or phone number parameter? »
The parameter email_or_phone_number comes from a client side and I need this for an authentication. However, the model has email and phone number fiel...
(3) odpowiedzi
2017-02-18 09:02 Rails Query with nested association and group ( by associated object) »
Given this model relationships: orders.rb belongs_to user user.rb belongs_to company company.rb has_many users I wanted to count all orders made...
(1) odpowiedzi
2017-02-17 22:02 OwlCarousel Not Showing Chartkick graphs »
In my Ruby on Rails application I am trying to use OwlCarousel to display a slideshow containing pie charts that have been generated using ChartKick. ...
(0) odpowiedzi
2017-02-17 13:02 Rails multiple joins condition query for exact tags with has many through relationships »
I have a problem with filtering products by exact tags as my current query does not return exact matches and I can't seem to get the right query condi...
(1) odpowiedzi
2017-02-17 02:02 How to run coffeescript on page change? »
I'm working on a Rails 4 app without turbolinks. I know I can tell my coffee script to run with: $(document).ready -> $('.toggle_stage_item_edi...
(1) odpowiedzi
2017-02-17 00:02 Disconnecting mysql connections in ruby after a timeout »
My network firewall kills any idle connections after a few minutes. This is causing our rails app to keep reconnecting and eventually the database sta...
(0) odpowiedzi
2017-02-16 21:02 Reblog a post when user repost from another user timeline »
I need to enable a functionality like tumblr or similar blogs, where the the user can see the original poster (creator) and the user who reposted. e....
(0) odpowiedzi
2017-02-16 17:02 Rails 4: Import CSV and edit with AJAX before submission »
I have a CSV that I am directly importing using: CSV.foreach(file.path, headers: @weigh_in_cols) do |row| hashed_row = row.to_hash.except!(nil) ....
(1) odpowiedzi
2017-02-16 11:02 Validate params based on condition in rails-grape »
I am developing APIs for a web app. In one specific case I am facing a situation where I require param2 only when value of param1 is false. I was able...
(1) odpowiedzi
2017-02-16 11:02 Why my user_id is updated to null? »
I have 2 model one for user(amitians) other is about.rb to store their details they have a has_one relationship between them but problem is whenever I...
(1) odpowiedzi
2017-02-16 00:02 How to order records by created_at last 3 days first, then by another column, using rails [Postgresql] »
Using Active Record, How to order by 2 columns (created_at, views): 1st: the records created within the last 3 days 2nd: everything after that shoul...
(2) odpowiedzi
2017-02-15 20:02 rails undefined method `[]' for nil:NilClass on association »
After place a association images right after save the product, rails spitting out about method `[]' for nil:NilClass, why is showing nil, for a assoc...
(1) odpowiedzi
2017-02-15 17:02 Check if user confirmed during login, using devise »
I have a React+Rails app and I'm using devise for authentication. I'm trying to generate a custom error message for users who try to login after their...
(2) odpowiedzi
2017-02-15 16:02 Refactoring record retrieval in Rails controller »
I have the code above and the following route's resources : resources :products, only:[:index] do resources :orders, :path => 'order', only:[:...
(2) odpowiedzi
2017-02-15 09:02 Custom styles of devise error messages display on sign-up page but don't appear on sign-in page »
I made a helper_class named: devise_helper.rb: module DeviseHelper def devise_error_messages! return '' if resource.errors.empty? message...
(0) odpowiedzi
2017-02-15 07:02 Time Difference is wrongly calculated in Rails 4 »
I am working on a project using Ruby 2.2 and Rails 4 and sqlite database in which time difference is wrongly calculated. I have used TimeDifference m...
(1) odpowiedzi
2017-02-14 23:02 Rails remove additional www on subdomain »
I'm having some security issues with certain subdomains when I have force_ssl enabled in production.rb. It seems something like https://subdomain.exa...
(0) odpowiedzi
2017-02-14 21:02 Rails how to build on iteration »
After trying to save a set of images with dropzone without iteration. i switch to iterating the images and try to save on the loop. but rails spitting...
(1) odpowiedzi
2017-02-14 19:02 NoMethodError in Controller#index »
undefined method `search' for # I am keeps on getting the above NoMethodError in controller index even the method is present in the model. Following ...
(1) odpowiedzi
2017-02-14 10:02 How to filter the array of records per model name ruby on rails »
Suppose I have hashes of elements and I need to filter out the results based on the class names in them. so, if records contains elements of PrivateS...
(2) odpowiedzi
2017-02-14 07:02 How to add many to many record which having extra column »
I have following Models User has_many :users_contacts has_many :contacts, through: :users_contacts accepts_nested_attributes_for :contacts, allow_de...
(1) odpowiedzi
2017-02-13 13:02 rails_admin fails when class uses `belongs_to_active_hash` »
I have a class like this class BTR::PaymentDetails < ActiveRecord::Base self.table_name = "btr_payment_details" has_paper_trail belongs_to ...
(0) odpowiedzi
2017-02-13 09:02 Parse date in format 'dd-m-yy' to a valid date »
I need to parse a date from excel file, it's in format 14-3-17 because excel changes it to that... What is the best way to parse it to a valid date? ...
(2) odpowiedzi
2017-02-13 05:02 How do I edit .xslm file in ruby/rails without losing VBA macros? »
I have some .xslm files in my project which I have to edit. My application is written in Rails. I know macro enabled files can not be edited with ruby...
(0) odpowiedzi
2017-02-12 14:02 Doorkeeper password grant_type -Token Revocation on password change (with Devise) and Refresh token methods »
I'm currently working with Doorkeeper (+Devise) for a Rails server and trusted iOS app. I've got an implementation working but I am confused on a few ...
(0) odpowiedzi
2017-02-12 08:02 rails – AJAX Search, Sort, Paginate with Ransack and Kaminari »
I have been following this tutorial https://techbrownbags.wordpress.com/2014/01/17/rails-ajax-search-sort-paginate-with-ransack-kaminari/ and it work...
(0) odpowiedzi
2017-02-11 13:02 Many-To-Many with custom model names in Rails 4 »
In my Rails 4 app I have users and accounts. I want to create a has_many through relationship. Th thing is that I want to change the class name so tha...
(1) odpowiedzi
2017-02-11 12:02 Rails 4: Embed link in string »
I have a string field in one of my controllers which is a message. I want to embed a clickable link in it. Something like this works in the view: &l...
(1) odpowiedzi
2017-02-11 11:02 Database field update, input doesn't change »
Rails 4.1.1 Ruby 2.1.2 I have updated my production database with the following migration... class UpdateLimitOnCustomerNameField < ActiveRecord:...
(1) odpowiedzi
2017-02-10 20:02 Shortcut for conditional variable manipulation in Ruby/Rails »
One of the parameters my API controller receives has a big key name and I need to convert it from string to integer, if it is present, before sending ...
(1) odpowiedzi
2017-02-10 14:02 Rails - how to incorporate 'quantity' bookings using counter_cache and update correctly »
I'm building an events app using Rails and have added a counter_cache association between my Event and Booking models in order to capture the number o...
(1) odpowiedzi
2017-02-10 12:02 Wysiwyg editor with rails »
I am using Rails 4.2.5 & Ruby 2.3. I am trying to use "wysiwyg-rails" gem(https://github.com/froala/wysiwyg-rails) for wsyiwyg editor. I have adde...
(1) odpowiedzi
2017-02-10 12:02 Can't get a link render properly on email »
I am trying to construct a string that will be passed to UserMailer as the body of the email. Here is the code: html_text = "" topic_object.title = ...
(1) odpowiedzi
2017-02-09 17:02 Apply defaults to namespaced ActiveRecord translations »
I have some models with a price attribute, which I want to translate. In my locales file, I have this translation: de: activerecord: attribute...
(1) odpowiedzi