Rendering an image from the Unsplash API in Rails

I have extensively researched this matter both on Stack Overflow and Google but found nothing conclusive. Since I'm completely new to the concept of API usage within Rails I have to ask for some advice. I have followed the procedure from the github ...
more »

2017-10-03 19:10 (1) Answers

Using fineuploader with react-rails

I'm trying to use fineuploader with react and have installed all the relevant dependencies. Following is the code I use:- import React, { Component } from 'react' import FineUploaderTraditional from 'fine-uploader-wrappers' import Gallery f...
more »

2017-10-03 10:10 (2) Answers

Ruby on Rails - Passing parameters to set in url

this maybe is an usual and easy ask to answer but Im new in this. I have my route and view asociated to my webtool ready and working, the route is like this "". Its about some charts which change their values depends of choices i...
more »

2017-10-02 17:10 (1) Answers

Email and social sharing functionality

I have an web app where users can create their own stores. To help them promote their stores I'd like to add the ability for them to type in their email, and share their store listing with their email contacts whether it's gmail, outlook, yahoo, hotm...
more »

2017-09-28 20:09 (1) Answers

Rails, subtracting dates in nested model

Hoping someone can help me here, think I am not seeing something simple. I'm trying to subtract from a date field in a nested model. When I have: - Photo.minimum(:date) This works fine, and calculates the difference between...
more »

2017-09-28 16:09 (1) Answers

Generate rails public cache from rake task

rails has a fantastic cache system. But there is one thing that i havenĀ“t figured out. How to generate a fragment cache directly from a rake task to prevent that the first user have to generate it. Either generating it from a rake task every minut...
more »

2017-09-27 13:09 (0) Answers

How to use 'stale?' in rails with eTAg

I am new to rails. I am trying to use cache and Etag to throw 304 status when the content is not modified. My controller code is like this: def index @projects = @current_user.projects if stale?(@projects, public: true) render json:...
more »

2017-09-27 12:09 (1) Answers

Rails 5 custom validate

I am learning Rails and I stuck with this custom validation. I tried many different approaches to pass the form field called (:cpf) to validate without success. I also tried using ActiveModel::EachValidator, but I get more confused. The validation is...
more »

2017-09-26 22:09 (1) Answers

How to connect a rails app to a oracle database?

I am unable to find step by step instructions on this topic. I want a Rails 5.x app to be able to connect to an Oracle Database. I know that there are adapters out there, but I want to start from a default Rails 5 app and connect to a Oracle Databa...
more »

2017-09-26 17:09 (1) Answers

share images to facebook from rails app

Tried researching this for a long time, but really not understanding the facebook API. Only thing I've been able to successfully link to is the root of the site. Here's the issue: I have a site with user profiles. User profiles each have a number ...
more »

2017-09-23 18:09 (0) Answers

A dot added to at the end of my domain

I have unusual error on url address of my site. I don't know the reason. inside of my system has the reason.. but i think it happen from outside. A dot is added at the end of my domain inside of url. example : "
more »

2017-09-23 17:09 (0) Answers

Date Params minimum date is today in URL

I have a booking application, and I'm passing Date params to URL from Bootstrap Date-picker in Ruby rails application, it also detects and handles manual entry for invalid dates on URL. However, in URL user can change Date params to date in past an...
more »

2017-09-23 13:09 (1) Answers

Way to set default Rails Cache-Control header?

I know that to set the Cache-Control header in my own controllers I can call #expires_now, but my Rails app uses an engine (apitome), and on those requests, the Cache-Control header gets set to max-age=0, private, must-revalidate. I see that may be t...
more »

2017-09-23 01:09 (0) Answers

Rails adding a random path to URLs

So when the link to my website is clicked (not typed), rails app adds paths to url like the "NgOLZ" is added and it's unique every time. I have no idea why. Here's my code: # Define root URL root 'pages#in...
more »

2017-09-17 13:09 (0) Answers

Reform: Validate if it has changed

I'm using Reform for validating my form. I want to change one attribute only if that attribute has been changed. Otherwise, I don't want my form to fail. module Forms module Users class Update < Reform::Form property :registration_st...
more »

2017-09-15 15:09 (0) Answers