Data dodania Pytanie
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 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 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 16:06 How to debug asset precompilation errors in Rails? »
Command: (ran in console on local environment) RAILS_ENV=production bundle exec rake assets:precompile --trace What happens: A lot of assets get p...
(0) 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-07 20:06 ActiveRecord::Fixture::FixtureError: table "users" has no column named "monkey" »
Hi I just started coding with rails, following Michael hartl tutroial, I got this error while writing test for my app, my fixture on test/fixtures/use...
(1) odpowiedzi
2017-06-07 16:06 Rails server suddenly not responding »
My Rails 4.2.6 production server worked perfectly for long time. Today I've added some functionality & migrated the server, everything looked fine...
(0) odpowiedzi
2017-06-07 11:06 undefined method `two_dimensional?' using Barby CairoOutputter »
I just want to generate a QR code using rqrcode gem. When I create my new rqrcode instance: qr = RQRCode::QRCode.new('test') I get the following in...
(1) odpowiedzi
2017-06-06 21:06 Submitting a selection with ajax using options_from_collection_for_select in Rails 4 »
I use select_tag on many occasions in an application. Here's an example. <%= select_tag pg.id, options_from_collection_for_select(@misc_options, :...
(0) odpowiedzi
2017-06-06 15:06 ruby on rails diff two dates »
I have two differnt dates in Rails the current date: DateTime.now and one which is stored in database (belongs to a object) The format of those ...
(1) odpowiedzi
2017-06-06 15:06 Low level caching in rails 4 »
I have two models Employee and Organization class Employee < ActiveRecord::Base belongs_to :organization, touch: true end class Organization &l...
(1) odpowiedzi
2017-06-05 23:06 AR Query for jsonb attribute column »
I'm using Postgres for my db, and I have a column in my Auction model as a jsonb column. I want to create a query that searches the Auction's json col...
(2) odpowiedzi
2017-06-05 18:06 Error when trying to add counter_cache to a self-join rails model »
class Product < ActiveRecord::Base belongs_to :parent, :class_name => 'Product', :foreign_key => :parent_id has_many :children, :cla...
(1) odpowiedzi
2017-06-05 17:06 How to pass system system properties from jruby to Rails server »
I'm running a local Rails server (WEBrick) via JRuby and want to test some code that will eventually be running on Torquebox. I'm trying to access so...
(1) odpowiedzi
2017-06-04 21:06 How to iterate through array of arrays on Rails template? »
I've got an array in the following form: [["First", ["a", "b", "c"]], ["Second", ["d", "e"]], ["Third", ["g", "h", "i"]]] Is there a way to somehow...
(1) odpowiedzi
2017-06-04 19:06 ActiveModel::ForbiddenAttributesError in UrlsController#create »
I have the following code: class UrlsController < ApplicationController def new @shortened_url = Url.new end def create @shortened_url = Url.new...
(1) odpowiedzi
2017-06-04 16:06 AWS paperclip Rails. Working but when I upload image it updated all objects in Heroku »
I've update my Rails app to store uploaded images in an AWS bucket when in production mode. It's working fine and I can see the image getting uploaded...
(1) odpowiedzi
2017-06-03 05:06 Rails - Dinamically select attributes to be serialized »
I'm using ActiveModel Serializers to serialize my models and I'm constantly in need to create a new serializer in order to satisfy the needs of an con...
(1) odpowiedzi
2017-06-02 21:06 Rspc: How to stub the MandrilApi dynamic template API »
I have tried this But its not working I am using GEM mandrill-api https://bitbucket.org/mailchimp/mandrill-api-ruby/wiki/Home config.before(:all) do...
(0) odpowiedzi
2017-06-02 18:06 CSS not loading in my Rails 4 app »
Everything was working fine on my app, after I overhauled the entire front-end design. I attempted to push to my staging server on heroku, and I was g...
(1) odpowiedzi
2017-06-02 11:06 Getting all videos belonging to a user's categories (Rails many to many associations querying) »
We have the following associations for our models. class User < ActiveRecord::Base has_and_belongs_to_many :categories, join_table: :spree_users...
(0) odpowiedzi
2017-06-01 16:06 Rails Capistrano 3: Permission denied (publickey) on AWS EC2 »
I am trying to deploy my rails (4.2) application on Amazon ec2 through bitbucket. I have added my id_new_rsa.pub key in authorized_keys on the server....
(1) odpowiedzi
2017-06-01 13:06 How to change Rails database sqlite to mongodb »
Just started to make simple Rails apps. The default database is SQLite3 now, but I would like to switch to mongodb. Is there any simple way to expor...
(2) odpowiedzi
2017-06-01 00:06 Serving files through a controller with carrierwave and restricts with Pundit gem on Post model »
I'm trying to upload a file of a photo with carrierwave and restrict(for be protected of others who don't be allowed to watch that file and after do t...
(0) odpowiedzi
2017-05-31 13:05 Rails 4 - Validates uniqueness with has_many through »
I have these three models: User: class User < ActiveRecord::Base validates :name, presence: true validates :surname, presence: true validat...
(1) odpowiedzi
2017-05-31 05:05 Attachment Param Only Passing Name of File - Rails 4 »
I'm trying to pass a document in a nested form in Rails 4, but the params are only taking the attachment name. I've done some looking and most of the ...
(2) odpowiedzi
2017-05-31 01:05 Ruby on Rails - check if user have added any domain and if they have been approved »
In my application I have models Post & Domain. My application works as, user have to submit a domain to be able to see all posts in posts#index. ...
(1) odpowiedzi
2017-05-30 20:05 Best practice for Rails setup w/ Docker on a Windows machine »
I am brand new to Rails and Docker, and am looking to develop a website that runs on Rails and deploys to Production with the help of Docker (likely t...
(2) odpowiedzi
2017-05-30 11:05 Rails unpermitted params »
I'm trying to recieve some params within my controller, but I'm having issues when permitting them. This is my request payload: { contacts: [{ ...
(2) odpowiedzi
2017-05-30 11:05 Ruby backup Gem s3 upload not working »
I am testing the backup gem and the size of the db is very small. I have mongodb with me. My configuration is: Backup::Model.new(:backup_db, 'Backu...
(1) odpowiedzi
2017-05-30 11:05 Group By records based on start date and end date with count Rails »
Suppose, its May 2017 and I want to get records of April 2017. My query fetches the record of April 2017 with count but I want to include empty date...
(3) odpowiedzi
2017-05-29 17:05 for each loop help in Rails. Trying to count data in each table. »
Quick one. How can I pull in the number of courses that are completed to show in a for each block in the a view. Currently as the code loops through a...
(1) odpowiedzi
2017-05-29 14:05 Rails respond_with works on Heroku but not on AWS »
I have a Rails 4 application that uses respond_with after creating or editing objects. respond_with @account In my staging environment on Heroku th...
(0) odpowiedzi
2017-05-29 10:05 NameError: uninitialized constant DeviseMultipleTokenAuthDevice »
Hello Programmers & Developers!!!, I'm facing a problem in rails console when I tried to access DeviseMultipleTokenAuthDevice then I'm getting the...
(1) odpowiedzi
2017-05-28 23:05 Rails 5 nested form find or create »
I have two models Run and Patient. Run belongs_to Patient and Patient has_many runs. On the Run model I'm using accepts_nested_attributes in which t...
(0) odpowiedzi