Skip to main content
INSERT multiple records with accepts_nested_attributes_for
General • Asked by sacko idriss
Hi evry bady. I have three models. I want a form that gives the product list, just added the amount for inclusion in ventelinges. ```produit.rb class Produit < ActiveRecord::Base has_m...
10
posts

has_one association on polymorphic model
General Solved • Asked by Greg Answer
I have the following models (stripped down for simplicity) : ```ruby class Activity < ActiveRecord::Base belongs_to :trackable, polymorphic: true belongs_to :user has_one :comment, ...
5
posts

How "expensive" are API calls?
General Solved • Asked by Isaac Ben Hutta
I was thinking about an SPA that has a like button. In "Liking Post" tutorial you wrote a method that checks if the current user liked the post, but in an SPA that means I will have to make a call ...
3
posts

Any good tutorials on using rbenv?
General Solved • Asked by tquill
I setup my rails environment using the ubuntu installation guide found on gorails (amazingly helpful, thank you) but I'm not really sure how to use rbenv. I have a few rails apps, and I'm wonder...
4
posts

Access rights and roles logic in third model ("has_many through" association)
General • Asked by Jaromír Červenka
Hello, this question is more conceptual, than technical one. Do you think that it's a good idea to handle different types of "access rights" and "roles" in third model like this? ```ruby cla...
4
posts

Pundit scopes
General Solved • Asked by Dmitry Amelchenko
Hi, i have no idea how to choose best way. There are three models User, Department and Task. Each user assigned to one department (belongs to). Department has many tasks. How to write a policy or s...
3
posts

How to use devise with Adminitrate?
Gems / Libraries • Asked by Oyewole Samuel
Great tuts, please how can i use this with devise? when i run rails generate administrate:install, it generate error... says admin is not a class, already have a devise called admin, also have a vi...
8
posts

URL Based multi tenancy
General Solved • Asked by Oyewole Samuel
I'm new to Ruby on Rails, trying my best to catch up. for example... i've a domain and a username append to it, www.domain.com/samsoft, how can i achieve this and also routing? sample code will be ...
2
posts

Display user
General • Asked by Nick McNeany
Hi Everyone, I'm trying to display a users profile image, along with their username in an autocomplete dropdown. The autocomplete functionality works fine, I'm just having trouble displaying ...
4
posts

Elastic search & search kick incorporating dates fields and integers
General Solved • Asked by John Munyi
HI Chris, I implemented elastic search using search kick gem and all went well from search, autocomplete and suggestions when dealing with text. Now i wanna perform a similar search on tabl...
11
posts

How to raise a warning message from the model
General • Asked by Sascha M.
Hi there, In my rails app I have the parent model ORDERS with SALES as a child (as nested routes). So 1 Order has_many Sales and 1 Sale belongs_to Order. In my USER model I have the column "maxd...
1
post

GoRails Screencast suggestion: Caching
Site Feedback • Asked by Sascha M.
Hi there, just a quick suggestion. I'm at a stage where I'm struggling with Caching. Since you haven't covered this topic yet I would be very happy if you do, especially Database query caching. ...
3
posts

CSV Import: Whitespace (blank) results in an error
General • Asked by Sascha M.
Hi there, I`m using the CSV Upload as described in one of your pro-tutorials. The code loops through the csv and adds records to the specific table. But if there is a whitespace inside a row...
4
posts

Using multiple theme in Multi tenancy application
General • Asked by Oyewole Samuel
Great work Chris, this my second month in this forum and i really enjoy the series of tuts, please i'm currently working on multi tenancy application that require user to select desired theme. plea...
4
posts

Single Devise User Model or Multiple Devise Models?
Gems / Libraries Solved • Asked by ronald chacon
Hi all, I am planning to create an application that will have several types of users with a couple shared fields and many unrelated fields. What would be my best option? After doing some rese...
9
posts

Survey - adding options though nested models
General • Asked by Chris Ma
Hey guys, a while ago, I tried to follow a railscast tutorial(notably http://railscasts.com/episodes/197-nested-model-form-part-2?view=asciicast) on nested models where i was trying to build a sur...
2
posts

Rspec Test on Multi tanent app with aparment gem
General Solved • Asked by Francisco Quinones
Hi I'm having a hard time figuring this out. https://gist.github.com/Frank004/8aa4acf20f60a3666a42 Im starting to do test on my Multitenant app and encounter a problem when trying to run the...
2
posts

Front-end frameworks and Turbolinks
Javascript • Asked by Nick McNeany
Hey Everyone, I'm having a small problem with the JavaScript components of the [Uikit framework](http://www.getuikit) and I know it has to do with turbolinks. Here's the gem I'm using [Uikit2-Ra...
3
posts

Displaying previous score in current record
General • Asked by John Munyi
Hi Chris I got a lil logic issue going on here, have a look at this gist https://gist.github.com/bl4ckdu5t/ec48cc9d6eedeb877d06 so technically what i want is for each new weekly_perfo...
17
posts

how to create in db this hash with Model.create
General • Asked by sacko idriss
```"livraisonlog"=>[{"vente_id"=>"3", "type_liv"=>"L", "produit_id"=>"57", "qte"=>"4.0"}, {"vente_id"=>"3", "type_liv"=>"L", "produit_id"=>"66", "qte"=>"5.0"}, {"vente_id...
1
post

Subscribe to the newsletter

Join 20,000+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.