« Back to channel list

#RubyOnRails - 18 September 2017

« Back 1 day Forward 1 day »
[00:00:37] jrabe: has joined #RubyOnRails
[00:05:44] orbyt_: has joined #RubyOnRails
[00:06:31] kn-928: has joined #RubyOnRails
[00:32:56] wethu: has joined #RubyOnRails
[00:32:57] funkytwig: has joined #RubyOnRails
[00:41:24] jhfisc: has joined #RubyOnRails
[00:47:19] jhfisc: has joined #RubyOnRails
[00:54:32] irishfromua: has joined #RubyOnRails
[00:56:17] jhfisc: has joined #RubyOnRails
[00:59:28] quazimodo: has joined #RubyOnRails
[01:15:12] jhfisc: has joined #RubyOnRails
[01:24:02] jhfisc: has joined #RubyOnRails
[01:36:12] kn-928_: has joined #RubyOnRails
[01:40:00] bronson: has joined #RubyOnRails
[01:48:13] jhfisc: has joined #RubyOnRails
[01:56:46] jhfisc: has joined #RubyOnRails
[02:03:13] jhfisc: has joined #RubyOnRails
[02:09:47] Salve: has joined #RubyOnRails
[02:21:47] jhfisc: has joined #RubyOnRails
[02:25:14] Jameser: has joined #RubyOnRails
[02:29:22] Jameser: has joined #RubyOnRails
[02:30:49] orbyt_: has joined #RubyOnRails
[02:32:43] jhfisc: has joined #RubyOnRails
[02:40:26] dviola: has joined #RubyOnRails
[02:43:21] jhfisc: has joined #RubyOnRails
[02:45:35] jamespotz: has joined #RubyOnRails
[02:52:24] jmay: has joined #RubyOnRails
[03:00:25] sandstrom: has joined #RubyOnRails
[03:06:57] Jameser: has joined #RubyOnRails
[03:11:15] jhfisc: has joined #RubyOnRails
[03:16:47] fschuindt: has joined #RubyOnRails
[03:22:13] jhfisc: has joined #RubyOnRails
[03:24:19] lektrik: has joined #RubyOnRails
[03:27:02] bronson: has joined #RubyOnRails
[03:34:54] knight33: has joined #RubyOnRails
[03:44:57] srinidhi: has joined #RubyOnRails
[03:54:37] jhfisc: has joined #RubyOnRails
[04:11:36] jhfisc: has joined #RubyOnRails
[04:23:50] jhfisc: has joined #RubyOnRails
[04:33:33] srinidhi: has joined #RubyOnRails
[04:41:28] jhfisc: has joined #RubyOnRails
[04:42:09] wethu: has joined #RubyOnRails
[04:46:08] jhfisc: has joined #RubyOnRails
[04:46:55] bronson: has joined #RubyOnRails
[04:50:20] egray: has joined #RubyOnRails
[04:58:22] jhfisc: has joined #RubyOnRails
[05:03:37] jhfisc: has joined #RubyOnRails
[05:11:39] knight33: has joined #RubyOnRails
[05:24:49] jhfisc: has joined #RubyOnRails
[05:36:15] volix: has joined #RubyOnRails
[05:37:11] jhfisc: has joined #RubyOnRails
[05:43:08] jhfisc: has joined #RubyOnRails
[05:46:08] jhfisc: has joined #RubyOnRails
[05:46:43] krz: has joined #RubyOnRails
[05:51:26] jhfisc: has joined #RubyOnRails
[05:56:39] jhfisc: has joined #RubyOnRails
[05:59:17] knight33: has joined #RubyOnRails
[06:00:00] jhfisc: has joined #RubyOnRails
[06:12:15] jhfisc: has joined #RubyOnRails
[06:16:08] jhfisc: has joined #RubyOnRails
[06:21:13] jhfisc: has joined #RubyOnRails
[06:24:59] dionysus69: has joined #RubyOnRails
[06:25:00] Jameser: has joined #RubyOnRails
[06:26:19] snickers: has joined #RubyOnRails
[06:27:13] jhfisc: has joined #RubyOnRails
[06:35:10] jhfisc: has joined #RubyOnRails
[06:41:14] jhfisc: has joined #RubyOnRails
[06:42:15] conta: has joined #RubyOnRails
[06:47:18] jhfisc: has joined #RubyOnRails
[06:50:45] knight33: has joined #RubyOnRails
[06:52:02] jhfisc: has joined #RubyOnRails
[07:04:14] Jameser: has joined #RubyOnRails
[07:04:48] banisterfiend: has joined #RubyOnRails
[07:09:17] Ergo: has joined #RubyOnRails
[07:15:26] cgfbee: has joined #RubyOnRails
[07:27:16] ur5us: has joined #RubyOnRails
[07:29:13] jhfisc: has joined #RubyOnRails
[07:29:22] boxmein: has joined #RubyOnRails
[07:30:46] ferr: has joined #RubyOnRails
[07:32:53] FastJack: has joined #RubyOnRails
[07:37:47] jhfisc: has joined #RubyOnRails
[07:48:34] simmerz: has joined #RubyOnRails
[07:51:13] jhfisc: has joined #RubyOnRails
[07:54:38] sandstrom: has joined #RubyOnRails
[07:57:17] jhfisc: has joined #RubyOnRails
[08:03:19] jhfisc: has joined #RubyOnRails
[08:05:29] Doldge: has joined #RubyOnRails
[08:06:32] defsdoor: has joined #RubyOnRails
[08:07:11] srinidhi: has joined #RubyOnRails
[08:10:09] ur5us: has joined #RubyOnRails
[08:11:03] marr: has joined #RubyOnRails
[08:12:02] jhfisc: has joined #RubyOnRails
[08:15:57] hervie: has joined #RubyOnRails
[08:18:09] jhfisc: has joined #RubyOnRails
[08:20:57] jhfisc: has joined #RubyOnRails
[08:22:41] Ergo: has joined #RubyOnRails
[08:26:10] jhfisc: has joined #RubyOnRails
[08:31:08] jhfisc: has joined #RubyOnRails
[08:35:11] lxsameer: has joined #RubyOnRails
[08:39:12] jhfisc: has joined #RubyOnRails
[08:57:09] jhfisc: has joined #RubyOnRails
[09:05:55] jhfisc: has joined #RubyOnRails
[09:18:41] jhfisc: has joined #RubyOnRails
[09:25:48] mikecmpbll: has joined #RubyOnRails
[09:36:10] jhfisc: has joined #RubyOnRails
[09:44:07] arBmind: has joined #RubyOnRails
[09:45:43] m_abdelfattah: has joined #RubyOnRails
[09:46:11] m_abdelfattah: I've a problem with concerns in controllers, I'm getting `undefined method`
[09:48:32] m_abdelfattah: I tried to define the method with self, without self, within class_methods block and still getting that `undefined method` error
[09:48:50] helpa: Clearly explain what is happening and create a Gist (http://gist.github.com), (formatted neatly please: http://bit.ly/1q75oia) of the code that is causing the problem you are encountering, as well as any useful output like stacktraces.
[09:53:39] m_abdelfattah: dminuoso, https://gist.github.com/anonymous/3ac383163598332c5e2debf255ab9a1c
[09:56:38] dminuoso: m_abdelfattah: module A; C = ...; D = ...; end
[09:56:50] dminuoso: m_abdelfattah: C is not in Ds inheritance chain
[09:56:55] dminuoso: (And vice-versa)
[09:57:15] dminuoso: Method lookup just cares about .ancestors
[09:57:48] m_abdelfattah: dminuoso, then what is the best way to use them in all ancestors?
[09:59:01] jhfisc: has joined #RubyOnRails
[09:59:32] dminuoso: m_abdelfattah: You cant.
[09:59:37] dminuoso: Not in the sense you are trying.
[10:00:04] dminuoso: m_abdelfattah: That is unless you do this on Api::V1s singleton class
[10:00:38] dminuoso: m_abdelfattah: So lets dispense of that concern because you do not need it. And then replace include with extend, and you are done.
[10:01:01] dminuoso: (extend is just short for singleton_class.include)
[10:02:04] ur5us: has joined #RubyOnRails
[10:03:41] dminuoso: m_abdelfattah: But for your code PoiController is _not_ an Api::V1. It just happens to reside inside it.
[10:04:19] dminuoso: m_abdelfattah: It also requires you to invoke this function differently. Or just include it into Api::ApiController
[10:05:34] m_abdelfattah: dminuoso, Yeah, I just included it in PoiController
[10:06:39] ur5us: has joined #RubyOnRails
[10:06:49] m_abdelfattah: dminuoso, thank you so much man
[10:06:54] dminuoso: m_abdelfattah: concerns gain value in module dependencies as well as making it a bit more compact to fiddle with class methods, but if you dont need either - just use a plain module
[10:36:01] cabotto: has joined #RubyOnRails
[10:38:45] TessaM: has joined #RubyOnRails
[10:39:53] Liothen: has joined #RubyOnRails
[10:41:55] harfangk_: has joined #RubyOnRails
[10:49:23] arBmind: has joined #RubyOnRails
[10:54:46] ur5us: has joined #RubyOnRails
[10:59:06] bruno-: has joined #RubyOnRails
[11:29:09] cabotto: has joined #RubyOnRails
[11:40:41] phedkvist: has joined #RubyOnRails
[11:42:17] baash: has joined #RubyOnRails
[11:45:40] tcopeland: has joined #RubyOnRails
[11:52:17] ShalokShalom_: has joined #RubyOnRails
[11:56:12] drale2k: has joined #RubyOnRails
[11:58:45] baash: Anyone know of a good course on elastic search (sydney area?)
[12:00:41] ahrs: has joined #RubyOnRails
[12:00:49] Jameser: has joined #RubyOnRails
[12:03:17] phedkvist: Hey, I would like to begin contributing to rails. Is there any good beginner issues one can start with?
[12:04:47] keegnotrub: has joined #RubyOnRails
[12:12:48] jhfisc: has joined #RubyOnRails
[12:15:17] ladipo: has joined #RubyOnRails
[12:18:19] EminenceHC: has joined #RubyOnRails
[12:19:08] jhfisc: has joined #RubyOnRails
[12:25:19] jhfisc: has joined #RubyOnRails
[12:25:25] GodFather: has joined #RubyOnRails
[12:37:11] jhfisc: has joined #RubyOnRails
[12:47:02] tbuehlmann: phedkvist, there's a label for good first patches: https://github.com/rails/rails/labels/good-first-patch
[12:49:48] jhfisc: has joined #RubyOnRails
[12:53:14] DTZUZO: has joined #RubyOnRails
[13:01:05] jhfisc: has joined #RubyOnRails
[13:10:00] jhfisc: has joined #RubyOnRails
[13:13:47] Jameser: has joined #RubyOnRails
[13:13:52] roshanavand: has joined #RubyOnRails
[13:16:21] jhfisc: has joined #RubyOnRails
[13:17:11] bronson: has joined #RubyOnRails
[13:24:51] Chernobuk: has joined #RubyOnRails
[13:31:19] jhfisc: has joined #RubyOnRails
[13:36:57] ladipo: has joined #RubyOnRails
[13:37:15] ladipo: has left #RubyOnRails: ()
[13:41:02] jhfisc: has joined #RubyOnRails
[13:47:22] jhfisc: has joined #RubyOnRails
[13:52:43] jhfisc: has joined #RubyOnRails
[13:53:50] drale2k: has joined #RubyOnRails
[13:55:59] jhfisc: has joined #RubyOnRails
[13:58:07] lxsameer: has joined #RubyOnRails
[14:03:01] ams__: has joined #RubyOnRails
[14:08:43] jhfisc: has joined #RubyOnRails
[14:13:24] jhfisc: has joined #RubyOnRails
[14:17:22] dionysus70: has joined #RubyOnRails
[14:17:34] bronson: has joined #RubyOnRails
[14:27:15] jhfisc: has joined #RubyOnRails
[14:33:55] jmay: has joined #RubyOnRails
[14:36:28] bruno-: has joined #RubyOnRails
[14:39:34] jhfisc: has joined #RubyOnRails
[15:01:21] jhfisc: has joined #RubyOnRails
[15:03:53] gusrub: has joined #RubyOnRails
[15:14:08] drale2k: has joined #RubyOnRails
[15:14:24] jhfisc: has joined #RubyOnRails
[15:14:57] drale2k: has joined #RubyOnRails
[15:20:59] sagax: has joined #RubyOnRails
[15:21:41] orbyt_: has joined #RubyOnRails
[15:22:25] funkytwig: has joined #RubyOnRails
[15:28:46] cagomez: has joined #RubyOnRails
[15:43:13] jhfisc: has joined #RubyOnRails
[15:46:03] jhfisc: has joined #RubyOnRails
[15:52:10] dviola: has joined #RubyOnRails
[15:57:12] arBmind: has joined #RubyOnRails
[15:59:19] jhfisc: has joined #RubyOnRails
[16:05:53] orbyt_: has joined #RubyOnRails
[16:11:09] jhfisc: has joined #RubyOnRails
[16:11:13] conta2: has joined #RubyOnRails
[16:17:13] jhfisc: has joined #RubyOnRails
[16:18:53] bronson: has joined #RubyOnRails
[16:25:10] jhfisc: has joined #RubyOnRails
[16:28:54] DrYockel: has joined #RubyOnRails
[16:33:11] dblessing: has joined #RubyOnRails
[16:37:09] jhfisc: has joined #RubyOnRails
[16:39:09] funkytwig: has joined #RubyOnRails
[16:43:28] jhfisc: has joined #RubyOnRails
[16:44:20] bruno-_: has joined #RubyOnRails
[16:50:48] jhfisc: has joined #RubyOnRails
[17:10:48] armyriad: has joined #RubyOnRails
[17:11:14] one_zero: has joined #RubyOnRails
[17:21:16] jhfisc: has joined #RubyOnRails
[17:25:44] jhfisc: has joined #RubyOnRails
[17:30:30] kies: has joined #RubyOnRails
[17:31:54] [Butch]: has joined #RubyOnRails
[17:32:19] funnel: has joined #RubyOnRails
[17:33:25] sandstrom: has joined #RubyOnRails
[17:40:59] jmay: has joined #RubyOnRails
[17:41:49] jhfisc: has joined #RubyOnRails
[17:41:56] ahrs: has joined #RubyOnRails
[17:42:02] SteenJobs: has joined #RubyOnRails
[17:53:29] maryo: has joined #RubyOnRails
[17:56:09] NoGodDamnIdea: has joined #RubyOnRails
[18:01:13] orbyt_: has joined #RubyOnRails
[18:08:18] gusrub: has joined #RubyOnRails
[18:11:10] jhfisc: has joined #RubyOnRails
[18:11:56] orbyt_: has joined #RubyOnRails
[18:13:09] orbyt_: I have a module `ContentModule` that has two methods. The first is simply `set_item` and sets an @item instance variable to the record found in the DB.
[18:13:29] orbyt_: If an item in the Db with the passed in ID is not found, I need to show a 404.
[18:14:00] orbyt_: There are 2 controllers that use this module, and use the two methods via a `before_action set_item, xx` call
[18:14:27] orbyt_: Is it best practice to NOT render the 404 in the module? Or should I duplicate my code and call the render methods in each module?
[18:15:38] orbyt_: each controller*
[18:16:22] conta1: has joined #RubyOnRails
[18:16:41] netzfisch: has joined #RubyOnRails
[18:17:05] jhfisc: has joined #RubyOnRails
[18:19:55] bronson: has joined #RubyOnRails
[18:23:01] netzfisch: has joined #RubyOnRails
[18:24:10] simmerz: has joined #RubyOnRails
[18:24:16] jhfisc: has joined #RubyOnRails
[18:32:45] SteenJobs: has joined #RubyOnRails
[18:38:35] maryo: Hello, I use rubyXL to export a data from my application. When i directly click on the icon it shows random texts on the screen but When I open in new window the file downloads successfully. Someone here said me to check the 'Content-disposition' header. But it seems the application is not using that. Here is the code https://gist.githubusercontent.com/anonymous/1b9343bf6ad404750bdef1b134357a89/raw/e7983b93d2d052d79e87e2ce39220d4d9a5f026a/test that
[18:38:36] maryo: i use for export
[18:38:44] maryo: can someone shed some pointers?
[18:40:07] gusrub: has joined #RubyOnRails
[18:41:27] gusrub: has joined #RubyOnRails
[18:41:35] fryguy: maryo: you should be using the content disposition header
[18:42:53] maryo: fryguy, Do you mean I will be having that defined already in the application?
[18:44:42] fryguy: you send the header with the responsible to signal to the browser what to do with the content
[18:47:47] maryo: fryguy, i was wondering how come open in new tab option downloads the file successfully. Where as downloading the file (clicking on the download icon) gives this error https://pasteboard.co/GKYuyrT.png
[18:48:08] fryguy: because you didn't set content-disposition
[18:49:17] maryo: fryguy, ok i will try using it and then see how it goes.
[19:04:32] maryo: fryguy, i was trying to find a sample on how i can do that. But i haven't got a good one. Do you have any samples to set content-disposition ?
[19:05:11] knight33: has joined #RubyOnRails
[19:07:01] fryguy: literally the first google result is helpful: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition
[19:12:25] jhfisc: has joined #RubyOnRails
[19:14:15] ivanskie: has joined #RubyOnRails
[19:17:57] tanuki: has joined #RubyOnRails
[19:19:15] ivanskie: has joined #RubyOnRails
[19:21:15] ivanskie: i have an activejob that pulls data from api, ~1000 records, then processes each and runs Model.new and Model.save on each.
[19:21:25] ivanskie: i think this could be more efficient.
[19:22:01] ivanskie: could someone help me please?
[19:22:57] cagomez: has joined #RubyOnRails
[19:23:06] fryguy: this might be helpful: https://github.com/zdennis/activerecord-import
[19:23:28] hahuang65: has joined #RubyOnRails
[19:23:46] ivanskie: https://gist.github.com/i5okie/f43945a54aed425d1122e5642460a8ae#file-job-rb-L19-L24
[19:25:35] ivanskie: ooh i like this
[19:25:43] ivanskie: i'll try it. thanks fryguy
[19:28:15] maryo: fryguy, sorry to bother you again. I tried setting disposition like this "send_data file.read, :filename => "#{result.subject_name}.xlsx", disposition: 'attachment'" but still experiencing the same issue. Am i missing out something here?
[19:29:01] fryguy: does send_data do anything with the disposition kwarg?
[19:32:47] fryguy: i dunno what else could be wrong
[19:34:52] maryo: fryguy, after setting the disposition to attachment which clicking i see this "{:filename=>"Allsubjects.xlsx", :disposition=>"attachment"}"
[19:35:13] ivanskie: that saved a few seconds thanks fryguy
[19:35:25] ivanskie: still takes 8k+ ms to complete but way better
[19:38:41] ivanskie: i think i need to figure out how to do this https://blog.codeship.com/speeding-up-bulk-imports-in-rails/
[19:40:28] orbyt_: has joined #RubyOnRails
[19:41:42] lxsameer: has joined #RubyOnRails
[19:46:03] jhfisc: has joined #RubyOnRails
[19:50:05] Trynemjoel: has joined #RubyOnRails
[19:51:50] ivanskie: nice went down to about 6 seconds.
[19:52:17] ivanskie: ^ thats still doing using activerecord import as you've suggested. thought there was something else he was doing
[19:53:04] ivanskie: i think i need to speed this up more
[19:53:27] ivanskie: doing 30.times do, run that job which imports 864 records at a time, still takes ~3 minutes
[19:57:13] jhfisc: has joined #RubyOnRails
[19:58:53] npgm: has joined #RubyOnRails
[19:59:45] Trynemjoel: has joined #RubyOnRails
[20:02:47] jhfisc: has joined #RubyOnRails
[20:07:05] jhfisc: has joined #RubyOnRails
[20:13:00] ivanskie: has joined #RubyOnRails
[20:15:54] cagomez: has joined #RubyOnRails
[20:18:18] ivanskie: hmm running the job 300 times might be breaking something
[20:18:38] ivanskie: i removed validation.
[20:19:01] ivanskie: so im thinking its overwriting some dates
[20:20:53] bronson: has joined #RubyOnRails
[20:35:21] jhfisc: has joined #RubyOnRails
[20:40:22] funkytwig: has joined #RubyOnRails
[21:01:12] arBmind: has joined #RubyOnRails
[21:07:13] jhfisc: has joined #RubyOnRails
[21:09:54] jhfisc: has joined #RubyOnRails
[21:10:39] cjohnson: I have Foo which has_many Bar, I want to render an edit form for a single Foo and show all of the child Bar underneath for editing all at once
[21:11:11] cjohnson: What's the right syntax/method for doing this with FormBuilder?
[21:11:16] cagomez: has joined #RubyOnRails
[21:11:27] cagomez: has joined #RubyOnRails
[21:11:51] cjohnson: Specificailly I want to do something like form_for(..) do |form| children.each do |child| form.text_field :child_attr end end
[21:12:32] cagomez: has joined #RubyOnRails
[21:14:09] cagomez_: has joined #RubyOnRails
[21:16:03] jhfisc: has joined #RubyOnRails
[21:18:12] ivanskie: has joined #RubyOnRails
[21:20:10] hahuang65: has joined #RubyOnRails
[21:27:13] jhfisc: has joined #RubyOnRails
[21:33:13] jhfisc: has joined #RubyOnRails
[21:34:11] simmerz: has joined #RubyOnRails
[21:35:01] simmerz: has joined #RubyOnRails
[21:35:51] simmerz: has joined #RubyOnRails
[21:36:31] ur5us: has joined #RubyOnRails
[21:36:36] simmerz: has joined #RubyOnRails
[21:38:58] jhfisc: has joined #RubyOnRails
[21:39:06] DTZUZO: has joined #RubyOnRails
[21:43:22] kitsuneyo: has joined #RubyOnRails
[21:45:16] jhfisc: has joined #RubyOnRails
[21:51:06] orbyt_: has joined #RubyOnRails
[21:56:11] DTZUZO: has joined #RubyOnRails
[21:56:20] mtkd: has joined #RubyOnRails
[21:57:16] jhfisc: has joined #RubyOnRails
[22:01:02] EminenceHC: has joined #RubyOnRails
[22:03:17] jhfisc: has joined #RubyOnRails
[22:09:13] jhfisc: has joined #RubyOnRails
[22:14:24] jhfisc: has joined #RubyOnRails
[22:15:32] ivanskie: has joined #RubyOnRails
[22:24:44] jhfisc: has joined #RubyOnRails
[22:35:12] jhfisc: has joined #RubyOnRails
[22:38:42] hahuang65: has joined #RubyOnRails
[22:39:13] jhfisc: has joined #RubyOnRails
[22:43:11] mikecmpbll: has joined #RubyOnRails
[22:45:11] jhfisc: has joined #RubyOnRails
[22:50:11] jhfisc: has joined #RubyOnRails
[22:51:24] tcopeland: has joined #RubyOnRails
[22:51:58] openstruct: has joined #RubyOnRails
[22:56:06] jhfisc: has joined #RubyOnRails
[23:10:07] ivanskie: has joined #RubyOnRails
[23:29:27] jhfisc: has joined #RubyOnRails
[23:37:39] gusrub: has joined #RubyOnRails
[23:41:05] gusrub: has joined #RubyOnRails
[23:42:08] jhfisc: has joined #RubyOnRails
[23:48:34] jhfisc: has joined #RubyOnRails