Skip to main content

Community

Subscribe to GoRails to join the conversation. Ask questions about your code, get help adding a new feature, and discuss implementation details with other members.

2 posts Gravatar

One form, two separate controllers, created at once.

Rails • Asked by Masud Hossain

I'm trying to create a sign_up form where the user will choose his email + password AND and Article at the same time as creating a user account. So assentially, one form will create a new Use...


9 posts Gravatar

Opt-in to receiving thread notifications

Site Feedback • Asked by Nick McNeany

Hey Chris, It would be great if users had the ability to opt-in to receiving new thread post notifications. Sometimes I like to just throw my two cents in, but don't really intend on following ...


1 post Gravatar

How to perform bulk update in rails?

Databases • Asked by Srinivasa Varma

Hi there, Here is the problem in more detail. I tried to perform bulk update on rails model, but ended up with normal save method. I have some number of records and i wanted to update their valu...


7 posts Gravatar

What are the best practices for generating SEO friendly urls in Rails 5?

Rails • Asked by William Kennedy

What is the best way to generate SEO friendly urls? The Rails default is to put the id in the URL e.g articles/2 I want to be able to have a url like this articles/article-heading Prev...


8 posts Gravatar

What is your dream app?

General • Asked by shakycode

If you could build anything (think outside of the box), what would it be? Things I'm working on that are fun to build: * Whisper clone with material design UI for mobile and web * Anonymous ...


3 posts Gravatar

Duration of a video in the listing page

Site Feedback • Asked by rabin prithvi

Duration of a video in the listing page would be highly useful to select a video to watch.


6 posts Gravatar

`fresh_when` usage for dynamic queries

Rails • Asked by Nicolas Brousse

Hey! I'm recently looking to use `fresh_when` method on my `PostController`. ```ruby class PostsController < ApplicationController def index @posts = Post.published.order(published_a...


4 posts Gravatar

Optimizing Queries in Service Objects

Ruby • Asked by Jacob Warren

I'm currently building an app and using namespaced service objects containing a single call method in each class. Below is an actual method (I'm aware the ABC size is too large, I'm wanting to g...


2 posts Gravatar

Is possible to check boolean value by JS?

Javascript • Asked by Dmitry Amelchenko

In Rails 4 app i need to implement bootstrap modal when user comes for first time and accept the terms. I'm trying to do something like this: **application.html.haml** ``` ... = content_tag :b...


8 posts Gravatar

Just sharing: Squash your migrations

General • Asked by Roman Storm

I've gone into problem when my test db is using sqlite and I use postgres in prod Sqlite doesn't have `inet` attribute like postgres and I went into some old migration that I don't use anymore. S...


2 posts Gravatar

Resource on how to do filters with checkboxes

General • Asked by Masud Hossain

I'm trying to create a way to filter my User results based on these filters. I'm looking for a guide with example on how to do this. http://image.prntscr.com/image/07e7113ac239436fa129fa874b5ac...


7 posts Gravatar

Simple_form Chrome browser bug

General • Asked by Stan Smith

This is annoying. The select menus are overlapping in Chrome. ![](https://s3.amazonaws.com/ps-toolbox/downloadables/toolbox_pushingsocial_com_articles_culture-branding-checklist_edit.jpg) Has ...


2 posts Gravatar

Rail API Knock User Authentication

Rails • Asked by Anand Padia

Application Strucutre **Rails API** user model & controller - CRUD blog model & controller - CRUD comments model & controller - CRUD Standard Blog App with Knock Authentication for access To...


1 post Gravatar

How do I mark content as "seen" or "read" when it's in the user's view?

Rails • Asked by Sam

Hi everyone, I'm trying to mark messages as "seen" when the div has entered the user's view (for example, the Facebook behavior of seen posts). My current attempt is a mix of the Unread gem (htt...


3 posts Gravatar

How to delete records in a join table?

Rails • Asked by Adrian DeGus

I'm using Refile for uploads and am having a tough time figuring out how to delete individual files. I need to display a delete link under each thumbnail, so my first thought was to do something li...


2 posts Gravatar

Why devise helpers are not available in application controller, except authenticate_user! ?

Rails • Asked by naveen kumar

undefined local variable or method `user_signed_in' in application controller but working fine in application.html.erb if user_signed_in layout 'admin_lte_2' else layout 'some_other_lay...


5 posts Gravatar

DRY Validations for Similar Models

Rails • Asked by Sillico

In my app I have restaurants which have a name, address, state, zipcode, country, and some other stuff. These restaurants have many locations, and each location belongs to a restaurant. The locatio...


10 posts Gravatar

Updating sort_index attr on a collection of models

Rails • Asked by Sean Washington

Hey there! I've got a collection of models (Product) and each product has an attribute called `sort_index` that allows the store owner to set a specific order for their products. The UI allows t...


11 posts Gravatar

Best way to create or save a record (with associations) as a template

General • Asked by Todd Quillen

I'm curious as to what people think is the best to create a new record, or save an existing record... as a template. The template would be used as a starting point to duplicate that record easily ...


19 posts Gravatar

Structure Guidance - Multi Tenancy Authentication / Authorization

Rails • Asked by Dan Tappin

I while back I was playing around building an app where you had multiple tenants (Company Model) and a single login (User Model). I then created roles (Role Model) to link the users to the tenants....