« Back to channel list

#RubyOnRails - 21 February 2019

« Back 1 day Forward 1 day »
[00:04:28] sf_starfox: has joined #RubyOnRails
[00:04:46] sf_starfox: which website do you guys use to quickly search thru documentation?
[00:05:15] sf_starfox: I remember seeing some website with a nifty search functionality that aggregated documentation from a number of different places
[00:12:46] davidh38: has joined #RubyOnRails
[00:12:47] snk: has joined #RubyOnRails
[00:12:47] snk: This might be a predictable answer 🙂, but https://api.rubyonrails.org
[00:13:10] snk: I don’t have anything bookmarked that searches api docs other than rails though
[00:14:59] snk: https://devdocs.io looks nice
[00:17:24] sf_starfox: snk: devdocs is what I was looking for :)
[00:17:44] snk: You’re welcome
[00:37:35] tdy1: has joined #RubyOnRails
[00:42:16] truenito: has joined #RubyOnRails
[00:51:18] mikecmpbll: has joined #RubyOnRails
[00:57:55] bruul: has joined #RubyOnRails
[00:57:55] blackmesa1: has joined #RubyOnRails
[00:59:55] agent_white: has joined #RubyOnRails
[01:34:45] orbyt_: has joined #RubyOnRails
[01:42:17] srinidhi: has joined #RubyOnRails
[01:42:53] sevenseacat: has joined #RubyOnRails
[01:51:29] hnanon: has joined #RubyOnRails
[01:53:51] hnanon: I have a States in a select form field. I want to display a checkbox collection of Cities depending on which state is selected. So, I imagine I need to use some javascript.
[01:54:16] hnanon: Is this a use case for something like stimulus or vue?
[01:54:42] hnanon: Can someone point me to an article or some docs I can read to help with that?
[01:57:47] davidh38: has joined #RubyOnRails
[02:09:02] barhum2013: has joined #RubyOnRails
[02:12:22] tdy1: has joined #RubyOnRails
[02:22:28] Saukk: has joined #RubyOnRails
[02:33:00] barhum2013: has joined #RubyOnRails
[02:36:08] nones: has joined #RubyOnRails
[02:46:54] barhum2013: has joined #RubyOnRails
[02:53:00] barhum2013: has joined #RubyOnRails
[03:06:41] pd09041999: has joined #RubyOnRails
[03:06:47] pd_09041999: has joined #RubyOnRails
[03:13:01] barhum2013: has joined #RubyOnRails
[03:17:08] ebsen: has joined #RubyOnRails
[03:19:45] carbone5: has joined #RubyOnRails
[03:36:52] barhum2013: has joined #RubyOnRails
[03:42:25] barhum2013: has joined #RubyOnRails
[03:49:07] gambl0r3: has joined #RubyOnRails
[03:51:13] NeXTSUN: has joined #RubyOnRails
[03:51:21] quazimodo: has joined #RubyOnRails
[03:57:03] davidh38: has joined #RubyOnRails
[04:03:09] barhum2013: has joined #RubyOnRails
[04:09:35] braincrash: has joined #RubyOnRails
[04:14:10] bruul: has joined #RubyOnRails
[05:00:01] pd09041999: has joined #RubyOnRails
[05:02:04] duderonomy: has joined #RubyOnRails
[05:18:41] Linuus: has joined #RubyOnRails
[05:23:17] pd09041999: has joined #RubyOnRails
[05:26:47] aidanh010: has joined #RubyOnRails
[05:29:21] v01d4lph4: has joined #RubyOnRails
[05:49:58] uksio: has joined #RubyOnRails
[06:04:09] quazimodo: has joined #RubyOnRails
[06:18:59] conta: has joined #RubyOnRails
[07:12:34] ravenousmoose: has joined #RubyOnRails
[07:26:59] hd1: has joined #RubyOnRails
[07:27:22] hd1: anyone around?
[07:43:42] TimHugh: has joined #RubyOnRails
[07:55:57] davidh38: has joined #RubyOnRails
[07:59:14] rserkov: has joined #RubyOnRails
[08:08:09] rserkov: has left #RubyOnRails: ("WeeChat 2.3")
[08:22:19] ravenousmoose: has joined #RubyOnRails
[08:26:44] ur5us: has joined #RubyOnRails
[08:29:16] blackmesa1: has joined #RubyOnRails
[08:39:53] Psy-Q: i've set debug_exception_response_format to :api and am sending requests with "Content-Type: application/vnd.api+json" but still getting error responses in text/html. what might be the problem?
[08:57:24] mikecmpbll: has joined #RubyOnRails
[09:12:33] prestorium: has joined #RubyOnRails
[09:30:52] arup_r: has joined #RubyOnRails
[09:33:45] lxsameer: has joined #RubyOnRails
[09:35:12] Majadon: has joined #RubyOnRails
[09:43:56] lunarkitty: has joined #RubyOnRails
[10:33:29] conta: has joined #RubyOnRails
[10:34:14] Psy-Q: and i still haven't figured out how i can trap RoutingError and give a JSON response
[11:06:37] barhum2013: has joined #RubyOnRails
[11:12:20] mikecmpb_: has joined #RubyOnRails
[11:18:42] Technodrome: has joined #RubyOnRails
[11:18:47] GeorgesLeYeti: has joined #RubyOnRails
[11:19:00] GeorgesLeYeti: Hello. It's me again (not Mario) :D
[11:21:04] davidh38: has joined #RubyOnRails
[11:21:24] davidh38: has joined #RubyOnRails
[11:46:56] ldnunes: has joined #RubyOnRails
[11:47:00] lankanmon: has joined #RubyOnRails
[11:55:31] ariedler: has joined #RubyOnRails
[11:57:22] ariedler: has joined #RubyOnRails
[12:04:08] davidh38: has joined #RubyOnRails
[12:04:35] phaul: has joined #RubyOnRails
[12:35:03] beholders_eye: has joined #RubyOnRails
[12:42:36] arooni_team_b: has joined #RubyOnRails
[12:52:28] srinidhi: has joined #RubyOnRails
[13:20:08] beholders_eye: has joined #RubyOnRails
[14:30:22] Puppet`: has joined #RubyOnRails
[15:05:04] srinidhi: has joined #RubyOnRails
[15:10:43] davidh38: has joined #RubyOnRails
[15:26:37] pd09041999: has joined #RubyOnRails
[15:38:27] tdy: has joined #RubyOnRails
[15:42:37] orbyt_: has joined #RubyOnRails
[15:42:58] gaussblurinc1: has joined #RubyOnRails
[15:43:19] jobewan: has joined #RubyOnRails
[15:44:19] gaussblurinc1: Hi! I've just updated project to Rails 5.2. How could I add missing output option wrapping by inserting root node "comments" for route /comments.json?
[15:55:17] agent_white: has joined #RubyOnRails
[15:55:25] srinidhi: has joined #RubyOnRails
[16:00:56] Net: Could someone explain to me how putting nginx in front of puma helps parallelize requests? Does it involve running multiple puma servers and having nginx balance between them?
[16:01:31] Net: Does puma buffer requests from and responses to slow clients?
[16:06:28] ravenous_: has joined #RubyOnRails
[16:07:16] havenwood: Net: Yes, Puma buffers requests and only passes them to a worker when complete.
[16:10:12] Net: havenwood: thanks
[16:11:13] Net: Trying to find if there’s still a reason to proxy puma
[16:12:22] havenwood: Net: Nginx can provide HTTP/2 up to Puma. I'm used to setting up SSL with Nginx.
[16:13:16] havenwood: Net: Falcon provides those things out of the box, but it's newer and you'll need to make sure you have async adapters for all your IO stuff.
[16:13:25] havenwood: Net: There might not be a compelling reason for you to use Nginx.
[16:18:35] Net: what about gzip or other possible static file advantages?
[16:19:19] Net: havenwood: and what about parallelizing requests if using MRI?
[16:26:10] ericboehs: has joined #RubyOnRails
[16:39:25] havenwood: Net: Puma uses separate processes for parallel thread pools.
[16:39:46] havenwood: Net: You can gzip in Rack middleware if you care to.
[16:39:58] jobewan: has joined #RubyOnRails
[16:40:07] havenwood: Net: If you need suuuuper fast static file serving, Nginx is good at that.
[16:40:58] Net: I see, thanks
[16:43:02] Inside: doot doot
[16:43:04] Inside: updating to rails 5.1 finally
[16:53:54] Inside: https://gist.github.com/Insood/5e7b13e27168661491fa7b99e8c8120e
[16:54:23] Inside: So this is a pretty smelly piece of code. I just don't know to how refactor it or test it.
[16:54:56] Inside: Basically I'm trying to guard against Component's validations changing in the future
[16:57:34] Ryanar: has joined #RubyOnRails
[17:01:41] pd09041999: has joined #RubyOnRails
[17:13:57] conta: has joined #RubyOnRails
[17:15:42] tweaks: has joined #RubyOnRails
[17:16:50] [Butch]: has joined #RubyOnRails
[17:17:36] wmoxam: has joined #RubyOnRails
[17:18:12] dionysus70: has joined #RubyOnRails
[17:31:11] maryo: has joined #RubyOnRails
[17:31:13] orbyt_: has joined #RubyOnRails
[17:44:42] razenha: has joined #RubyOnRails
[17:46:53] maryo: has joined #RubyOnRails
[17:48:23] maryo: has joined #RubyOnRails
[17:50:32] Dreamer3: has joined #RubyOnRails
[17:50:37] Saukk: has joined #RubyOnRails
[17:54:43] gambl0r3: has joined #RubyOnRails
[17:56:12] maryo: has joined #RubyOnRails
[17:56:39] v01d4lph4: has joined #RubyOnRails
[17:56:55] AGMS: has joined #RubyOnRails
[18:01:20] orbyt_: has joined #RubyOnRails
[18:09:10] maryo: has joined #RubyOnRails
[18:10:13] IGnorAND: When doing Company.includes(:addresses).first in console, shouldn't you see the sub-objects as well (in this case all addresses)?
[18:11:22] Inside: Company.includes(:addresses).first.addresses
[18:13:07] IGnorAND: Inside: why would one run that instead of Company.first.addresses then?
[18:13:31] Inside: It'll be the same number of queries
[18:13:48] Inside: You understand the n+1 problem?
[18:14:06] IGnorAND: I onderstand complexity and order of magnitude if that's what you're asking
[18:14:51] Inside: https://guides.rubyonrails.org/active_record_querying.html#eager-loading-associations
[18:16:02] Inside: .includes(..) is a hint to preload all of the records associated with the main model(s) instead of loading the associations one by one
[18:16:25] IGnorAND: Inside: thanks, that clears it up. So I'll save when I do a for loop on companies
[18:16:47] Inside: You're just loading one so it doesn't actually do anything
[18:16:58] Inside: Are you using the 'bullet' gem?
[18:17:09] IGnorAND: no bullet gem
[18:17:22] Inside: I'd recommend using it - during development it'll warn you if you're doing n+1
[18:22:57] mikecmpbll: has joined #RubyOnRails
[18:23:52] IGnorAND: Inside: I have a related question.
[18:23:58] IGnorAND: I have a list of employees
[18:24:08] IGnorAND: they have an insurance with expiration date
[18:26:09] IGnorAND: a certificate with expiration date
[18:26:41] IGnorAND: I now would like to list my employees with their different expiration dates
[18:26:51] IGnorAND: this would probably then qualify for the n+1 rule
[18:30:06] IGnorAND: My question: how would the index query be like?
[18:31:36] IGnorAND: For the insurance I'd like a "select DISTINCT on insurance, ordering it by exp date"
[18:31:58] IGnorAND: my solution for now was to create a view in my db and create a 'seperate model' for this view
[18:35:58] blackmesa1: has joined #RubyOnRails
[18:36:31] dionysus70: if you have experience with rspec, can you share where did you learn it? if any specific resources of course
[18:41:25] IGnorAND: dionysus70: well, not exactly learn, but I liked this writeup: https://scotch.io/tutorials/build-a-restful-json-api-with-rails-5-part-one After that I tried checking what I did wrong with http://www.betterspecs.org/
[18:43:04] dionysus70: will take a look thanks IGnorAND, yea I checked betterspecs.org before but the information seemed overwhelming without base knowledge.
[18:43:48] IGnorAND: dionysus70: try the scotch.io one. It is more related to API writing with rails though
[18:43:57] IGnorAND: are you doing the view side with rails as well?
[18:46:39] dionysus70: IGnorAND: yeas full stack Rails :P
[18:47:35] IGnorAND: dionysus70: I recently started with vuejs. I like writing complex forms in there better
[18:47:56] dionysus70: I may not test front-end for a while until I get feel of the backend first
[18:48:13] gambl0r3: has joined #RubyOnRails
[18:48:24] dionysus70: yea SPA has its adventages but I find it hard dealing with an extra layer, there are so many layers already
[18:48:26] IGnorAND: Well, I'm no star programmer yet either :)
[18:49:09] IGnorAND: dionysus70: Well, start making a simple app :)
[18:49:28] dionysus70: I've done one such app in emberjs which I liked but overall I spent more time xD
[18:50:06] dionysus70: I dont see problem with bare html + turbolinks hasn't yet created an existential problem for me so it is SPA like performance without one :P
[18:51:18] AGMS: has joined #RubyOnRails
[18:54:07] ravenous_: has joined #RubyOnRails
[18:54:25] IGnorAND: @dionysus70 I started with vuejs. I think overall I spend more time as well, but it gets prettier, more responsive and such
[18:58:30] conta: has joined #RubyOnRails
[19:00:27] sameerynho: has joined #RubyOnRails
[19:12:16] ericboehs: has joined #RubyOnRails
[19:15:23] SteenJobs: has joined #RubyOnRails
[19:21:43] ravenous_: has joined #RubyOnRails
[19:27:45] conta: has joined #RubyOnRails
[19:33:08] ravenous_: has joined #RubyOnRails
[19:33:20] tdy: has joined #RubyOnRails
[19:33:33] NeXTSUN: has joined #RubyOnRails
[19:37:56] MrCrackPot: has joined #RubyOnRails
[19:47:40] ravenous_: has joined #RubyOnRails
[19:47:55] orbyt_: has joined #RubyOnRails
[19:49:24] defsdoor: has joined #RubyOnRails
[19:54:23] ravenous_: has joined #RubyOnRails
[19:56:06] conta: has joined #RubyOnRails
[20:48:11] conta: has joined #RubyOnRails
[20:54:05] atrius: has joined #RubyOnRails
[21:04:03] ravenous_: has joined #RubyOnRails
[21:04:55] mbd2: has joined #RubyOnRails
[21:09:45] orbyt_: has joined #RubyOnRails
[21:21:54] orbyt_: has joined #RubyOnRails
[21:21:55] tdy: has joined #RubyOnRails
[21:25:07] atrius: has joined #RubyOnRails
[21:27:53] Dreamer3: has joined #RubyOnRails
[21:52:04] my1es: has joined #RubyOnRails
[21:53:08] atrius: has joined #RubyOnRails
[22:00:47] IGnorAND: with polymorphic models like addressable, how do I figure out what to show in the index? @addressable = Company.find(params[:company_id]) or @addressable = Person.find(params[:person_id]), do I do a does param exist?
[22:02:04] havenwood: IGnorAND: I'd suggest just looking at the params. What's in them?
[22:02:49] IGnorAND: @havenwood /api/v1/companies/:company_id/addresses vs /api/v1/people/:person_id/addresses all come down to the same controller right
[22:03:27] IGnorAND: so for index I do a if(params.has_key?(:company_id) else if (params.has_key?(:person_id)?
[22:03:51] IGnorAND: and everytime I add adressable I modify the if statement again?
[22:19:24] atrius: has joined #RubyOnRails
[23:00:48] Technodrome: has joined #RubyOnRails
[23:17:29] orbyt_: has joined #RubyOnRails
[23:30:36] bruul: has joined #RubyOnRails
[23:35:46] NeXTSUN: has joined #RubyOnRails
[23:46:44] mbd2_: has joined #RubyOnRails