« Back to channel list

#RubyOnRails - 23 November 2018

« Back 1 day Forward 1 day »
[00:13:39] agent_white: has joined #RubyOnRails
[00:32:07] dymk: Has anyone got experience with taking an existing (non-web) application that uses ActiveRecord, and embedding a Rails application in there as a subproject?
[00:32:42] dymk: main challenges I can think of are adding a new path for Rails to search for modules under, mainly the existing "models" directory of the application that it'll be embedded
[00:35:02] dymk: Perhaps instead of it being a separate rails application, it should be a rails engine
[00:41:59] dymk: Ah this is particularly useful: https://stackoverflow.com/questions/33726240/run-rails-engine-standalone
[00:45:20] Jervis_: has joined #RubyOnRails
[00:57:02] Arkantos: has joined #RubyOnRails
[01:00:02] sevenseacat: has joined #RubyOnRails
[01:34:24] Arkantos: has joined #RubyOnRails
[02:12:50] sevenseacat: has joined #RubyOnRails
[02:18:57] Saukk: has joined #RubyOnRails
[02:19:10] Arkantos: has joined #RubyOnRails
[03:07:42] apparition: has joined #RubyOnRails
[03:12:18] jaddison: has joined #RubyOnRails
[03:15:43] kapil____: has joined #RubyOnRails
[04:07:17] jaddison: has joined #RubyOnRails
[04:09:04] braincrash: has joined #RubyOnRails
[04:16:28] pd09041999: has joined #RubyOnRails
[04:30:43] Exuma: has joined #RubyOnRails
[04:51:34] jetchisel: has joined #RubyOnRails
[05:03:29] lexileo: has joined #RubyOnRails
[05:16:16] pd09041999: has joined #RubyOnRails
[05:21:33] uksio: has joined #RubyOnRails
[05:43:03] MoritaShinobu: has joined #RubyOnRails
[06:10:30] noodle: has joined #RubyOnRails
[06:11:24] reber: has joined #RubyOnRails
[06:24:28] conta: has joined #RubyOnRails
[06:46:30] apparition: has joined #RubyOnRails
[07:07:06] za1b1tsu: has joined #RubyOnRails
[07:20:57] hnanon: has joined #RubyOnRails
[07:22:28] hnanon: has joined #RubyOnRails
[07:46:30] lomex: has joined #RubyOnRails
[07:50:21] ikbenhet: has joined #RubyOnRails
[07:54:57] srinidhi: has joined #RubyOnRails
[08:03:05] srinidhi: has joined #RubyOnRails
[08:10:38] lomex: has joined #RubyOnRails
[08:11:09] Jervis_: has joined #RubyOnRails
[08:17:45] thunderbirdtr: has joined #RubyOnRails
[08:49:22] srinidhi: has joined #RubyOnRails
[09:01:01] lxsameer: has joined #RubyOnRails
[09:05:31] pd09041999: has joined #RubyOnRails
[09:11:57] JamieD: has joined #RubyOnRails
[09:31:33] lomex: has joined #RubyOnRails
[10:14:51] madsj: has joined #RubyOnRails
[10:28:50] lomex: has joined #RubyOnRails
[11:07:50] lomex: has joined #RubyOnRails
[11:43:17] srinidhi: has joined #RubyOnRails
[12:01:32] jottr: has joined #RubyOnRails
[12:02:34] lankanmon: has joined #RubyOnRails
[12:02:35] lexileo: has joined #RubyOnRails
[12:13:43] MoritaShinobu: has joined #RubyOnRails
[12:15:11] pavelz: hi anyone done nested forms? i have a form and I get only one of the nested records be passing in on a new page
[12:15:16] sheepman: has joined #RubyOnRails
[12:15:37] pavelz: i ause f.simple_fields_for and everything is ok but I last objectg clobbers all previous ones
[12:20:17] sheepman: has joined #RubyOnRails
[12:26:16] pavelz: as i remember there are suppose to be [] at the end that form builder is not addding
[12:27:48] someuser: has joined #RubyOnRails
[12:28:03] jottr: has joined #RubyOnRails
[12:46:17] jottr: has joined #RubyOnRails
[12:50:21] tbuehlmann: pavelz: can you gist your form code?
[12:54:22] pavelz: https://gist.github.com/pavelz/68a473dbcb335361b556ba9098e7be3c
[12:55:12] pavelz: using knockout to load multiple objects from app and the form_fields get duplicated but there is no [] added to the end and I get single nested object
[12:55:21] pavelz: tbuehlmann: ^
[12:55:44] pavelz: code works but if I load 3 objects it passes only one, last one
[12:57:06] pavelz: i feel so dumb because it works but only half way
[12:58:07] tbuehlmann: can you add the params that are submitted to the gist?
[12:59:54] pavelz: if I add hidden_field_tag I get csrf token violationm
[13:00:40] jottr: has joined #RubyOnRails
[13:01:25] tbuehlmann: shouldn't that one key be space_template_nodes_attributes instead of space_template_nodes? have you tried using the regular form_for and fields_for instead of the simple_form ones?
[13:02:57] jottr: has joined #RubyOnRails
[13:04:50] uks: has joined #RubyOnRails
[13:07:42] pavelz: so I replaced form with simple form
[13:07:49] pavelz: er simpe with regular
[13:08:34] pavelz: how would one go about creating a nested new form with multiple items to be loaded into association when object is created, how do you strucuture this form?
[13:09:34] tbuehlmann: either pre-build the associated "empty" records in the controller or use a library such as cocoon that'll add items kind of dynamically
[13:13:19] pavelz: heh i don't need links i need to drop objects in from other place into the form, can I replicate it ?
[13:30:41] Arkantos: has joined #RubyOnRails
[13:30:49] tbuehlmann: well, it's really only the name of the field that's important, so you can do anything you want using js
[13:31:17] pavelz: well csrf will not let me thru
[13:32:20] pavelz: i tried using raw input tags and it didn't work
[13:33:09] tbuehlmann: I don't know why adding fields to a functioning form would lead to CSRF errors
[13:33:31] tbuehlmann: btw, do you have accepts_nested_attributes_for in your SpaceTemplate model?
[13:40:24] pavelz: looks like i have to mangle JS
[13:40:33] pavelz: names of the forms elements
[13:41:12] tbuehlmann: I'm asking because you only get the space_template_nodes_attributes params key if your @space_template object responds to #space_template_nodes_attributes=
[13:41:15] pavelz: actully not as bad
[13:41:43] pavelz: yeah I have to add [0] or [n] to get multiple objects.between node and node_id
[13:41:48] pavelz: array notation
[13:42:52] pavelz: i still don't get an array
[13:43:42] tbuehlmann: you shouldn't get an array in the first place, I think. it should be a hash like {'0' => {…}, '1' => {…}, …}
[13:43:59] pavelz: how can I get an array>
[13:44:27] Ergo: has joined #RubyOnRails
[13:44:44] pavelz: now it works
[13:53:21] pavelz: one more thing
[13:53:45] pavelz: if association belongs_to is polymorphic does it matter?
[13:54:04] pavelz: not getting inserts on them fields :)
[13:54:57] pavelz: accept_nested is there but it just ignores the hash
[14:06:50] pavelz: oh naming _attributes :)
[14:13:07] Jervis_: has joined #RubyOnRails
[14:15:12] pavelz: thx tbuehlmann
[14:23:06] kapil____: has joined #RubyOnRails
[14:32:44] Arkantos: has joined #RubyOnRails
[14:34:07] mostlybadfly: has joined #RubyOnRails
[14:36:44] JamieD: has joined #RubyOnRails
[14:37:57] gregf_: has joined #RubyOnRails
[14:39:16] fryguy: has joined #RubyOnRails
[14:42:50] tbuehlmann: you're welcome!
[14:54:47] jasmith: has joined #RubyOnRails
[15:12:12] GodFather: has joined #RubyOnRails
[15:25:10] Arkantos: has joined #RubyOnRails
[15:33:02] segy: has joined #RubyOnRails
[15:50:05] Croata: has joined #RubyOnRails
[16:01:23] dviola: has joined #RubyOnRails
[16:33:05] jaddison: has joined #RubyOnRails
[16:37:03] emers2n: has joined #RubyOnRails
[16:37:41] emers2n: Happy Thanksgiving! What's the simplest way to fire the built in flash messages with JS/jQuery?
[16:38:24] emers2n: All the StackOverflow questions seemed to involve rolling their own
[16:40:49] adgtl: Folks.. I have belongs_to :user association in Pad model .. but how to I relax it..
[16:41:00] adgtl: basically I mean... I want to allow creating pads without any user_id
[16:41:02] tbuehlmann: emers2n: there's no built-in method to do that using js. so, yeah, you'll need to roll your own
[16:41:21] tbuehlmann: adgtl: you want `belongs_to :user, optional: true`
[16:41:34] adgtl: tbuehlmann thanks
[16:58:57] dviola: has joined #RubyOnRails
[17:00:29] mikecmpbll: has joined #RubyOnRails
[17:04:30] lxsameer: has joined #RubyOnRails
[17:05:32] nickjj_: has joined #RubyOnRails
[17:11:33] Arkantos: has joined #RubyOnRails
[17:11:39] mostlybadfly: has joined #RubyOnRails
[17:13:48] Exuma: has joined #RubyOnRails
[17:36:38] Arkantos: has joined #RubyOnRails
[17:39:28] Seich: has joined #RubyOnRails
[17:40:21] Fire-Dragon-DoL: has joined #RubyOnRails
[17:44:43] noodle: has joined #RubyOnRails
[17:54:06] Exuma: has joined #RubyOnRails
[17:54:17] Dimik: has joined #RubyOnRails
[17:58:20] Exuma: has joined #RubyOnRails
[18:42:37] Arkantos: has joined #RubyOnRails
[18:45:05] Aherin: has joined #RubyOnRails
[18:45:51] Arkantos: has joined #RubyOnRails
[18:49:04] lxsameer: has joined #RubyOnRails
[19:00:59] jottr_: has joined #RubyOnRails
[19:01:51] Arkantos: has joined #RubyOnRails
[19:02:08] openstruct: has joined #RubyOnRails
[19:06:07] openstruct: I'm trying to debug sporadic "MySQL server has gone away errors" occurring with a Rails app with Unicorn. I've already dug into the common causes of that error per the MySQL docs, but I suspect that a mysql thread is getting hung up and unicorn may be checking that thread out, but I'm not sure how to verify this?
[19:06:46] openstruct: Is there a good way to log/output the thread id being used by a worker at any given time?
[19:11:07] mikecmpbll: has joined #RubyOnRails
[19:14:16] openstruct: I suppose I can log out ActiveRecord::Base.connection_pool.stat and if the size ever equals 2 and dead is 0 then I can verify that this is the case. Or I could limit the db pool to 1, but then I'd need to ensure I'm reconnecting whatever causes the connections to die.
[19:14:34] lomex: has joined #RubyOnRails
[19:25:23] DTZUZO: has joined #RubyOnRails
[19:43:26] patientplatypus: has joined #RubyOnRails
[19:43:37] patientplatypus: i have a stupid question
[19:44:07] agent_white: has joined #RubyOnRails
[19:44:26] patientplatypus: im getting this error "SyntaxError: import declarations may only appear at top level of a module" when I try and import axios in a javascript file
[19:44:37] patientplatypus: import axios from ‘axios’;
[19:45:01] patientplatypus: i have webpacker installed with yarn, and I've turned my coffeescript files in a standard ruby app into js files.
[19:45:16] patientplatypus: but standard es6 import statements don't seem to work
[19:45:25] patientplatypus: I'm also having trouble calling javascript functions
[19:45:41] patientplatypus: does anyone have any advice; rails is not my favorite
[19:52:28] supergeek: has joined #RubyOnRails
[19:56:10] Arkantos: has joined #RubyOnRails
[19:58:50] Saukk: has joined #RubyOnRails
[20:05:53] Sylario: has joined #RubyOnRails
[20:17:36] supergeek: has joined #RubyOnRails
[20:35:02] Dimik: has joined #RubyOnRails
[20:38:31] Arkantos: has joined #RubyOnRails
[20:43:05] scrooloose: has joined #RubyOnRails
[20:50:29] reber: has joined #RubyOnRails
[20:51:01] za1b1tsu: has joined #RubyOnRails
[21:15:46] Exuma: has joined #RubyOnRails
[21:17:10] jaddison: has joined #RubyOnRails
[21:27:55] agent_white: has joined #RubyOnRails
[21:28:25] Arkantos: has joined #RubyOnRails
[21:40:17] gambl0re: has joined #RubyOnRails
[22:28:12] ss_much: has joined #RubyOnRails
[23:17:25] tdy: has joined #RubyOnRails
[23:17:48] gambl0r3: has joined #RubyOnRails