« Back to channel list

#RubyOnRails - 15 January 2018

« Back 1 day Forward 1 day »
[00:37:00] bronson: has joined #RubyOnRails
[00:42:17] ResidentBiscuit: has joined #RubyOnRails
[00:45:56] LateralOctober: has joined #RubyOnRails
[00:51:21] alfiemax: has joined #RubyOnRails
[00:55:46] Jameser: has joined #RubyOnRails
[00:57:38] hammer065: has joined #RubyOnRails
[01:02:00] Cork: has joined #RubyOnRails
[01:10:55] fmcgeough: has joined #RubyOnRails
[01:39:36] LiamW: has left #RubyOnRails: ("WeeChat 1.8")
[01:42:22] desnudopenguino: amperry: could you show some code? (i have no idea, but it might help someone who does)
[01:54:33] alfiemax: has joined #RubyOnRails
[02:06:16] sevenseacat: has joined #RubyOnRails
[02:14:28] alfiemax: has joined #RubyOnRails
[02:30:55] armyriad: has joined #RubyOnRails
[02:34:21] amperry: desnudopenguino: still here? I can gist what I have.
[02:34:23] armyriad: has joined #RubyOnRails
[02:35:54] amperry: actually, I'm having other troubles with it now.
[02:37:54] bronson: has joined #RubyOnRails
[02:39:08] orbyt_: has joined #RubyOnRails
[02:40:27] desnudopenguino: amperry: i'm here!
[02:43:43] Jameser: has joined #RubyOnRails
[02:52:40] ahrs: has joined #RubyOnRails
[03:01:36] amperry: desnudopenguino: one moment, I'll gist it
[03:01:54] amperry: (Been in and out of the room, as perhaps you might have guessed.)
[03:05:01] amperry: https://gist.github.com/amp108/93885307ff34d18d4998dbd462302152
[03:11:50] alfiemax: has joined #RubyOnRails
[03:12:42] desnudopenguino: amperry: we all have real lives going on haha.
[03:16:09] desnudopenguino: i'm not sure. it looks like it only works for new/create and edit/update views/actions?
[03:21:05] Tempesta: has joined #RubyOnRails
[03:36:04] Jameser: has joined #RubyOnRails
[03:39:33] bronson: has joined #RubyOnRails
[04:00:41] srinidhi: has joined #RubyOnRails
[04:14:55] orbyt_: has joined #RubyOnRails
[04:26:13] Kugz: has joined #RubyOnRails
[04:40:23] bronson: has joined #RubyOnRails
[04:47:11] iamarun: has joined #RubyOnRails
[04:53:45] Dimik: has joined #RubyOnRails
[05:12:35] ur5us: has joined #RubyOnRails
[05:20:09] epochwolf: has joined #RubyOnRails
[05:21:09] darkhanb: has joined #RubyOnRails
[05:41:16] bronson: has joined #RubyOnRails
[05:54:00] Kugz: has joined #RubyOnRails
[05:55:30] juggler: has joined #RubyOnRails
[05:55:42] Kugz: Hi guys! I'm struggling to understand something (I've crawled tonnes of StackOverflow answers and articles) and I just can't figure it out. Whether I'm not searching the right terms or I'm just not understanding it correctly, I was wondering if you knew a good place to seek out help for the problem I'm facing? Preferably one-on-one where I can show someone my code? Thanks :-)
[05:58:47] KeyJoo: has joined #RubyOnRails
[05:59:29] havenwood: Kugz: Have a gist that shows off the problem?
[05:59:59] havenwood: Kugz: Or could you say more about what you're looking into?
[06:01:37] ali_g: has joined #RubyOnRails
[06:02:08] Kugz: I am trying to collect static data from the Riot Games API (formatted in JSON) and store the data in my model. I have to pick apart the data for the parts I need and all the data is nested (such as data: } character_name: { spells: { spell1:, spell2: spell3: etc }}} and I am having trouble accessing the sub-levels of the data so I can save them
[06:03:56] Kugz: Perhaps I don't understand JSON data properly, it would just be great to have someone guide me through it all - I remember stuff well once I've seen and done it once :P
[06:04:36] ali_g: what kind of trouble? what i've done before is create a model for each "sub-data" and just populate them one after the other
[06:05:19] ali_g: take a look at this, it's just a ruby file doing exactly that: https://github.com/ponentesincausa/melp-app/blob/master/read.rb
[06:07:58] havenwood: Kugz: Are you familiar with what serialization and deserialization is in general?
[06:08:51] havenwood: Kugz: (Trying to gauge where to start.)
[06:09:04] Kugz: I don't think so, I've seen it pop up when I've been reading - is that important to understand first?
[06:10:04] havenwood: Kugz: Across languages there's a general need to be able to reduce values in code to a simple text format.
[06:10:38] havenwood: That process of turning a code value into text is called serialization. And the inverse, turning the text back into code, is called deserialization.
[06:11:22] havenwood: Some serialization formats, like JSON and MsgPack, only allow a few datatypes to be serialized. These are safe, because you can't serialize arbitrary, dangerous things.
[06:12:01] Kugz: So does that mean stripping the data of quotes and the like?
[06:12:02] havenwood: Other formats like YAML and Marshal are less safe, because you can serialize more. But that's why you use them, to serialize things that MsgPack and JSON couldn't.
[06:12:36] havenwood: Kugz: Sec, I'll show you a gist of examples.
[06:12:56] Kugz: Thanks! I appreciate you spending the time to help me :)
[06:14:09] ali_g: hello all! I'm having some trouble passing instance variables from controller to view. I created a scope and it works, but not if I define it as a variable within the controller. Here's the gist: https://gist.github.com/ponentesincausa/a6d8c1dd9956ae52664411f9bb0be8e6
[06:14:27] ali_g: what could it be?
[06:15:34] havenwood: Kugz: https://gist.github.com/havenwood/fad9589a7fe976ede8c11e5de179d9ad
[06:16:26] havenwood: ali_g: I think you'll have more luck in #rubyonrails with that one.
[06:16:28] havenwood: ?rails ali_g
[06:16:46] havenwood: I'm on too much cold medicine.
[06:17:09] havenwood: Kugz: We should talk in #ruby probably, since it's a Ruby question.
[06:17:23] havenwood: ali_g: Sorry for my confusion.
[06:17:44] Kugz: I've only just started learning Ruby on Rails, sorry I'm in the wrong place
[06:17:58] havenwood: ali_g: Which variable is not making it through?
[06:18:00] havenwood: Kugz: No worries! You're much less confused than me!!
[06:18:24] havenwood: Kugz: We generally talk Ruby in #ruby and Rails here but it doesn't much matter.
[06:18:25] ali_g: havenwood @completed
[06:19:02] havenwood: ali_g: And it's the index view you're using it from?
[06:19:15] ali_g: :D i didn't know a #ruby channel existed. Thanks
[06:19:48] ali_g: yes its the index action. I read you could declare other instance variables from a certain action, so I did it that way.
[06:32:25] srinidhi: has joined #RubyOnRails
[06:35:28] kapil___: has joined #RubyOnRails
[06:38:16] Aherin: has joined #RubyOnRails
[06:42:04] bronson: has joined #RubyOnRails
[06:44:22] LateralOctober: has joined #RubyOnRails
[06:52:07] roshanavand: has joined #RubyOnRails
[06:53:55] roshanavand: has joined #RubyOnRails
[06:55:35] ali_g1: has joined #RubyOnRails
[07:01:12] Saukk: has joined #RubyOnRails
[07:09:41] Dykam: has joined #RubyOnRails
[07:12:09] dionysus69: has joined #RubyOnRails
[07:26:23] Kugz: has joined #RubyOnRails
[07:27:13] conta: has joined #RubyOnRails
[07:32:23] russt: has joined #RubyOnRails
[07:37:05] Kugz: has joined #RubyOnRails
[07:38:45] Keanny: has joined #RubyOnRails
[07:39:59] Keanny: hi, how to proceed, to be able to make a search engine to index my markdown files ?
[07:40:17] Keanny: i have about one hundred of markdown files
[07:40:37] Keanny: im newbie in rails, can you advice me ? thanks
[07:43:16] bronson: has joined #RubyOnRails
[07:45:46] baweaver: What have you tried?
[07:51:04] baweaver: short version: if the answer is nothing, search Google for some ideas of where to start.
[07:52:31] Keanny: i found, redcarpet + algolia
[07:52:41] Keanny: it is the easiest way ?
[07:55:57] Jameser: has joined #RubyOnRails
[08:04:11] dionysus69: has joined #RubyOnRails
[08:06:31] dionysus69: hey all, I got an email from some dude saying he found some vulnerability in my website. How serious should I take him? He asked if I had a bug bounty reward. I am thinking maybe he's just trying to get a free bounty.
[08:14:50] Ergo: has joined #RubyOnRails
[08:16:18] srinidhi: has joined #RubyOnRails
[08:17:14] defsdoor: has joined #RubyOnRails
[08:26:25] darkhanb: has joined #RubyOnRails
[08:36:19] darkhanb: has joined #RubyOnRails
[08:41:06] hammer065: has joined #RubyOnRails
[08:44:13] bronson: has joined #RubyOnRails
[08:44:18] Kugz: has joined #RubyOnRails
[08:52:48] LateralOctober: has joined #RubyOnRails
[08:52:55] Kugz: has joined #RubyOnRails
[08:59:43] one_zero: has joined #RubyOnRails
[09:01:22] srinidhi: has joined #RubyOnRails
[09:23:50] roshanavand: has joined #RubyOnRails
[09:45:04] bronson: has joined #RubyOnRails
[09:49:27] marr: has joined #RubyOnRails
[09:51:24] thejamespinto: has joined #RubyOnRails
[09:53:34] dionysus70: has joined #RubyOnRails
[10:03:06] Cavallari: has joined #RubyOnRails
[10:20:51] _aeris_: has joined #RubyOnRails
[10:21:54] srinidhi: has joined #RubyOnRails
[10:45:42] bronson: has joined #RubyOnRails
[10:55:07] LateralO1: has joined #RubyOnRails
[11:00:19] Cavallari: has joined #RubyOnRails
[11:25:00] Cavallari: has joined #RubyOnRails
[11:32:45] TinkerTyper: has joined #RubyOnRails
[11:36:08] mostlybadfly: has joined #RubyOnRails
[11:43:49] KevinSjoberg: has joined #RubyOnRails
[11:46:38] bronson: has joined #RubyOnRails
[11:50:14] DrYockel: has joined #RubyOnRails
[12:14:50] KeyJoo: has joined #RubyOnRails
[12:22:26] fschuindt: has joined #RubyOnRails
[12:24:46] halogenandtoast: has joined #RubyOnRails
[12:36:43] za1b1tsu: has joined #RubyOnRails
[12:39:53] za1b1tsu: Regarding active record, how do I use find_each.with_index to change attributes on the active record?
[12:40:15] za1b1tsu: I can't undestand how do I use use the index on the relation
[12:41:44] za1b1tsu: relation.find_each.with_index { |record, index| record(index) # ? ; relation(index)?}
[12:47:23] bronson: has joined #RubyOnRails
[12:57:21] dminuoso: za1b1tsu: "use the index" ?
[13:00:02] dminuoso: za1b1tsu: There's nothing special, it's no different than arr.each.with_index { |o, i| ... }
[13:00:08] Cavallari: has joined #RubyOnRails
[13:00:23] KeyJoo: has joined #RubyOnRails
[13:01:02] dminuoso: za1b1tsu: find_each gives you an Enumerator object, just like #each or #map. with_index is just a method of Enumerator, which "enhances" the Enumerator object by injecting an index as second argument.
[13:01:13] KevinSjoberg: has joined #RubyOnRails
[13:03:40] dminuoso: (if the yielder calls the block with more than 1 argument, then the arguments are put into an array, such that the index is always the second argument)
[13:04:26] dminuoso: [10,20].each |*args| p args }
[13:04:29] dminuoso: [10,20].each { |*args| p args }
[13:04:33] dminuoso: [10,20].each.with_index { |*args| p args }
[13:04:37] dminuoso: [10,20].each.with_index.with_index { |*args| p args }
[13:06:20] tcopeland: has joined #RubyOnRails
[13:09:41] fmcgeough: has joined #RubyOnRails
[13:17:27] za1b1tsu: dminuoso thank you
[13:19:55] LateralO1: has joined #RubyOnRails
[13:24:54] rgr: has joined #RubyOnRails
[13:26:33] noob_on_rails: has joined #RubyOnRails
[13:27:19] noob_on_rails: hey all, if im using ActiveRecord::Base.connection.execute(sql).to_a to make some custom sql queries
[13:27:28] noob_on_rails: should i somehow handle the connection afterwards?
[13:27:45] noob_on_rails: im getting an accumulative lag when spamming
[13:28:08] noob_on_rails: first time rails shoots it like nothing , but afterwards starts lagging each time the code runs
[13:28:46] dminuoso: noob_on_rails: Not only should you, you must.
[13:28:59] dminuoso: noob_on_rails: #execute is a low level primitive. You most likely should use #exec_query instead.
[13:29:06] noob_on_rails: dminuoso: oh it figures , also : https://github.com/rails/rails/issues/22331
[13:29:17] dminuoso: noob_on_rails: It's documented: http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/DatabaseStatements.html#method-i-execute
[13:29:31] dminuoso: noob_on_rails: Lesson: Always check API documentation before using said API. =)
[13:29:52] noob_on_rails: ah code was already there , i should've defied it though
[13:29:58] noob_on_rails: :D thank you dminuoso :D
[13:31:42] dminuoso: noob_on_rails: Also strongly consider using select_rows or select_one instead.
[13:32:07] dminuoso: noob_on_rails: (Or the other ones). The difference is that they do the adapter specific value mappings
[13:32:14] dminuoso: While exec_sql is a really raw interface
[13:32:26] dminuoso: *exec_query
[13:33:00] noob_on_rails: cool , ill start by resolving the performance issue with exec_query and then refactor to select_rows/_one
[13:33:07] noob_on_rails: cool stuff! :D
[13:33:32] dminuoso: noob_on_rails: Might as well pick select_rows/others directly then.
[13:35:04] dminuoso: noob_on_rails: Ah! select_all is the one I meant. :)
[13:35:17] noob_on_rails: yea i was eyeing it as we speak
[13:37:17] hfp_work: has joined #RubyOnRails
[13:40:04] apparition: has joined #RubyOnRails
[13:40:27] kapil___: can some one invite me to join #rails chanel?
[13:42:51] noob_on_rails: and of course docker comes into play : Mysql2::Error: Unknown MySQL server host 'mariadb' (-2)
[13:43:32] noob_on_rails: while using ActiveRecord::Base.connection methods we talked about! :D
[13:48:39] bronson: has joined #RubyOnRails
[13:56:29] pavelz: is there somewhere where one can disable sql logging
[13:58:15] fschuindt: pavelz: yes, ActiveRecord::Base.logger = nil should do it, but hey, don't do anything wrong, right? >.> haha just kidding
[13:58:50] pavelz: well sql logs are gone but logger is not being disable anywhere
[13:59:19] fschuindt: you asked for disabling SQL logs, don't you?
[13:59:56] pavelz: no, to enable it, I don't see anywhere it was disabled
[14:01:24] dminuoso: pavelz: !xy
[14:01:24] helpa: pavelz: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[14:01:32] dminuoso: pavelz: What exactly is the problem you have.
[14:08:24] mr-spoon: has joined #RubyOnRails
[14:11:01] pavelz: there a logger tied to ActiveRecord::Base.logger i guess i can investigte it
[14:11:29] DrYockel: has joined #RubyOnRails
[14:12:12] ali_g1: has joined #RubyOnRails
[14:16:23] fmcgeough: has joined #RubyOnRails
[14:19:55] mr-spoon: has joined #RubyOnRails
[14:25:56] mr-spoon: has joined #RubyOnRails
[14:39:52] LightStalker: has joined #RubyOnRails
[14:42:31] LightStalker: has joined #RubyOnRails
[14:47:58] mr-spoon: has joined #RubyOnRails
[14:49:21] bronson: has joined #RubyOnRails
[14:52:40] thejamespinto: has joined #RubyOnRails
[14:56:29] mr-spoon: has joined #RubyOnRails
[15:04:00] mr-spoon: has joined #RubyOnRails
[15:07:35] zigzig: has joined #RubyOnRails
[15:11:43] orbyt_: has joined #RubyOnRails
[15:11:53] KevinSjoberg: has joined #RubyOnRails
[15:13:33] mr-spoon: has joined #RubyOnRails
[15:15:12] mtkd: has joined #RubyOnRails
[15:19:47] LateralOctober: has joined #RubyOnRails
[15:22:09] moei: has joined #RubyOnRails
[15:23:09] cschneid_: has joined #RubyOnRails
[15:29:21] Cavallari: has joined #RubyOnRails
[15:36:03] troys: has joined #RubyOnRails
[15:39:42] crankharder: has joined #RubyOnRails
[15:50:05] bronson: has joined #RubyOnRails
[16:08:43] ur5us: has joined #RubyOnRails
[16:09:13] sejje: has joined #RubyOnRails
[16:11:26] dviola: has joined #RubyOnRails
[16:12:07] AzaToth: has joined #RubyOnRails
[16:15:36] KeyJoo: has joined #RubyOnRails
[16:15:50] ali_g1: has joined #RubyOnRails
[16:30:07] kossae: has joined #RubyOnRails
[16:42:17] one_zero: has joined #RubyOnRails
[16:49:34] one_zero: has joined #RubyOnRails
[16:50:59] bronson: has joined #RubyOnRails
[16:51:59] srinidhi: has joined #RubyOnRails
[17:02:18] dionysus69: has joined #RubyOnRails
[17:03:33] JusticeFries: has joined #RubyOnRails
[17:09:15] roshanavand: has joined #RubyOnRails
[17:15:46] alfiemax_: has joined #RubyOnRails
[17:19:27] chouhoulis: has joined #RubyOnRails
[17:20:13] mtkd: has joined #RubyOnRails
[17:23:40] darkhanb: has joined #RubyOnRails
[17:23:59] uks: has joined #RubyOnRails
[17:25:02] Saukk: has joined #RubyOnRails
[17:51:48] bronson: has joined #RubyOnRails
[18:09:45] ur5us: has joined #RubyOnRails
[18:10:26] akryll: has joined #RubyOnRails
[18:11:01] akryll: is rails viable to get into in 2017 and why so or why not?
[18:11:26] orbyt_: has joined #RubyOnRails
[18:19:15] _aeris_: has joined #RubyOnRails
[18:19:29] amperry: akryll: how can you get into something in 2017?
[18:21:16] fryguy: akryll: it's fine
[18:25:50] amperry: I'm using simple_form_for to create an object, but the params are not getting set and I don't understand why not. Gist here: https://gist.github.com/amp108/93885307ff34d18d4998dbd462302152
[18:26:58] havenwood: has joined #RubyOnRails
[18:29:02] alfiemax: has joined #RubyOnRails
[18:29:23] akryll: ive always enjoyed ruby, it was my first language. ive thought about learning rails in the past but gained employment using other technologies. what i want to know is if rails is still worth looking into in the present time
[18:29:39] fryguy: akryll: it is
[18:30:28] alfiemax: has joined #RubyOnRails
[18:31:56] akryll: is jruby the only solution to speeding up requests or has the ruby ecosystem grown to quench this problem
[18:32:37] workmad3: has joined #RubyOnRails
[18:33:26] akryll: im curious about rails ability to scale
[18:33:33] fryguy: what type of performance problems are you observing?
[18:34:44] akryll: im not looking to move a project to rails - this is just spare time consideration but possibly used in production in future
[18:35:31] fryguy: ok, what what types of performance problems would you be trying to avoid by moving to a different runtime?
[18:38:21] akryll: what i asked is if jruby is the only solution to speeding up requests
[18:38:43] fryguy: speeding up what types of requests?
[18:38:52] sameerynho: has joined #RubyOnRails
[18:39:06] fryguy: your question is way too generic to make a claim like "jruby is faster"
[18:39:25] akryll: i didnt say this haha
[18:39:51] fryguy: what is the goal response time, what is the measured response time, where is the majority of the time spent in the request?
[18:40:37] akryll: i just want to know if there are solutions to increasing performance other than switching to jruby ecosystem
[18:40:52] akryll: what im getting from you is that there are alternatives but generally jruby is the best option
[18:41:00] akryll: even if you do seem to beat around it
[18:41:10] Dimik: has joined #RubyOnRails
[18:41:21] fryguy: not saying that at all
[18:41:32] fryguy: i'm saying measure to identify an actual problem before looking for solutions
[18:42:04] akryll: well you dont just start building an application in hopes you can handle the problems with the ecosystem when they occur
[18:42:15] fryguy: most of the time you do
[18:43:04] akryll: in small businesses where the app needs to be produced fast, maybe
[18:43:34] fryguy: an in a larger business there's going to be established development teams with established infrastructure and established tooling, and you are going to use that
[18:43:48] fryguy: technology choice matters very little in the grand scheme of things
[18:44:48] akryll: take twitch for example - the site began on rails and as popularity grew become very sluggish in terms of request response and so they switched to nodejs
[18:45:03] akryll: ive read that rails now better accomodates this problem but im in this irc now to confirm this
[18:45:55] akryll: as far as im concerned a good developer plans ahead
[18:45:56] fryguy: are you potentially confusing capacity with performance?
[18:46:04] fryguy: which of the golden 4 metrics are you concerned with?
[18:46:48] akryll: are you telling me capacity to handle x number of requests per second doesnt correlate with performance?
[18:47:10] fryguy: there's a relationship, but it isn't a strict correlation
[18:47:43] fryguy: if you limit yourself to single-node systems, then it's pretty close to a strict correlation
[18:48:22] fryguy: but in non-trivial apps, the distributed systems aspect is going to make the math for that a bit more complicated
[18:50:14] akryll: companies look to reduce costs where necessary - so you're telling me in rails this is still necessary in large projects
[18:50:36] fryguy: define "large projects"
[18:50:46] akryll: nation-wide
[18:51:23] fryguy: what does that mean?
[18:51:24] akryll: an api used by various small to large companies across a whole country
[18:51:49] fryguy: what does the size of the country have to do with this? Is request latency from fiber lines going from one end of the country to another a concern?
[18:52:36] akryll: you're misinterpreting what i wrote
[18:52:37] bronson: has joined #RubyOnRails
[18:52:49] fryguy: you are refusing to provide any metrics about what you are trying to improve
[18:52:57] fryguy: measure something, and then determine if it needs improvement!
[18:53:11] amperry: (meanwhile, in the land of non-hypothetical questions...)
[18:53:50] akryll: amperry are you another one who doesnt look ahead of what your chosen technology is capable of before jumping head first into a large scale project
[18:54:25] amperry: akryll: yup, that's me. Caught me red-handed, you did.
[18:55:14] fryguy: akryll: you are quite misinformed about how to make technology choices
[18:55:25] fryguy: and are missing substantial parts of the picture
[18:56:11] akryll: what you said is you dont even make a technology choice - you just use what you know
[18:56:46] fryguy: akryll: that's a bit of an exageration, but yes in general
[18:56:47] akryll: you have no regard for planning ahead for the constraints your chosen ecosystem may push onto you
[18:57:04] amperry: does /ignore still work in irc?
[18:57:22] fryguy: akryll: and you have defined any constraints!
[18:57:22] akryll: yes you're on it
[18:57:25] amperry: yes, yes it does
[18:58:30] akryll: how many years have you been developing systems?
[18:59:11] Aherin: has joined #RubyOnRails
[18:59:14] fryguy: akryll: i've been in software engineering for about 12 years
[19:08:02] akryll: has left #RubyOnRails: ()
[19:08:25] felideon: has joined #RubyOnRails
[19:10:54] fschuindt: do we have moderators here?
[19:12:31] amperry: fschuindt: just type "/ignore akry^H^H^H^Hwhomever" and you have your own mini-moderation function
[19:12:51] havenwood: I've enjoyed CRuby's performance improvements lately. I look forward to MJIT, maybe as early as next Christmas! Enabling a JIT with a -j flag when you have the memory ftw.
[19:13:20] havenwood: Turn your CRuby into JRuby with the -j flag ;-P jk/jk
[19:13:23] fschuindt: amperry: thank you, really useful
[19:14:35] havenwood: While JRuby is the battle-tested, production-ready JVM Ruby - I very much look forward to TruffleRuby with SubstrateVM and Rails.
[19:14:57] havenwood: It seems like it's coming really close to running a vanilla Rails app! Really neat stuff.
[19:15:12] amperry: anyone know of a reason why simple_form_for wouldn't send params when it submits?
[19:18:08] zigzig: has joined #RubyOnRails
[19:37:45] _aeris_: has joined #RubyOnRails
[19:41:22] desperek: has joined #RubyOnRails
[19:44:10] amperry: on a different tack, how do you manually ensure that a submit button will send certain params?
[19:50:56] mattwc: amperry: a form should submit every input which has a name attribute
[19:52:49] blackcross: has joined #RubyOnRails
[19:53:47] bronson: has joined #RubyOnRails
[19:54:07] amperry: mattwc: that could be the problem. What I have is a form that basically presents what's going to be created, then asks for an "okay".
[19:55:01] amperry: So it looks like I just have to re-create the same variables in 'def create' action that I did in 'def new', which seems... whatever.
[19:55:16] kies: has joined #RubyOnRails
[19:56:19] amperry: so perhaps using a form was the wrong choice
[20:03:16] gambl0re: has joined #RubyOnRails
[20:03:57] zave: has joined #RubyOnRails
[20:04:54] zave: hi all, i have an array that i'm iterating through in a rails view, and at the end, it dumps all the object information into the view. any suggestions on what I'm doing wrong?
[20:06:42] KevinSjoberg: has joined #RubyOnRails
[20:07:37] havenwood: zave: Remove the = in your ERB for the #each line.
[20:08:19] havenwood: zave: "<%" instead of "<%="
[20:08:38] desperek: <%= prints the return fyi
[20:09:15] desperek: havenwood, since you are here, do you perhaps know if there is a rails activerecord/model thing that allows iterate over it when i have self joint (relation or w/e its called)
[20:10:33] zave: @havenwood Yes! Thank you.
[20:10:43] havenwood: desperek: If I understand what you're asking, you can #find_each to iterate with batches, default size of 1_000.
[20:11:01] havenwood: desperek: You can chain #map, #reject, etc off of #find_each.
[20:11:03] zave: @desperek Thank you too!
[20:11:05] desperek: havenwood, well, i have a model refferencing the same type model but other instance
[20:11:14] desperek: like, X has Xs
[20:11:34] desperek: do you know if i can iterate over it to get all Xs that X owns in the end?
[20:12:10] havenwood: desperek: X's Xs? Ha. I don't quite follow.
[20:12:22] havenwood: desperek: foo has many bars?
[20:12:26] havenwood: desperek: or?
[20:12:34] desperek: havenwood, foo has many foos http://guides.rubyonrails.org/association_basics.html#self-joins
[20:12:35] havenwood: desperek: I may just need more coffee.
[20:12:55] desperek: i have working association and all, but how to make it work eh
[20:13:46] desperek: so it looks like, foo has many foos and most of them has many foos and most of them has many foos etc...
[20:13:50] desperek: afaik its nested set?
[20:13:51] havenwood: Rails 5 supports left outer joins now. I've got to run in a sec, but if nobody beats me to it I'd be happy to help later.
[20:14:11] havenwood: #left_joins
[20:14:30] desperek: havenwood, this is 1 (one) table though
[20:14:58] havenwood: desperek: My brain is too molasses at the moment, and I've got to run! Poke me later if you don't sort it out!
[20:15:18] desperek: have fun running
[20:17:21] kossae: has joined #RubyOnRails
[20:20:51] mtkd: has joined #RubyOnRails
[20:25:31] Dimik: has joined #RubyOnRails
[20:26:21] arBmind: has joined #RubyOnRails
[20:30:56] tcopeland: desperek: you might be interested in https://github.com/stefankroes/ancestry#ancestry
[20:31:19] tcopeland: ACTION scrolls up to see if anyone already suggested that
[20:36:38] drewintx: has joined #RubyOnRails
[20:48:30] rikkipitt: has joined #RubyOnRails
[20:54:18] dviola: has joined #RubyOnRails
[20:54:36] bronson: has joined #RubyOnRails
[21:09:05] NoGodDamnIdea: has joined #RubyOnRails
[21:11:10] mtkd: has joined #RubyOnRails
[21:24:19] rikkipitt: has joined #RubyOnRails
[21:28:26] desperek: thanks tcopeland
[21:29:26] tcopeland: gambl0re: hi there
[21:33:50] rikkipitt: has joined #RubyOnRails
[21:45:38] timdotrb: has joined #RubyOnRails
[21:45:44] timdotrb: Afternoon, all
[21:46:24] tcopeland: hi timdotrb
[21:55:23] bronson: has joined #RubyOnRails
[21:55:46] mtkd: has joined #RubyOnRails
[22:11:08] gambl0re: tcopeland, what do i need to learn to become a backend dev?
[22:12:29] tcopeland: hm, if you’re asking generally, this seems like a pretty good starting point https://hashnode.com/post/7-steps-to-become-a-back-end-web-developer-in-2017-from-scratch-cj51zh8wc001xl0wtzn11nohb
[22:23:52] alfiemax: has joined #RubyOnRails
[22:37:54] tycoon177: when should i use #length vs #count vs #size?
[22:38:01] tycoon177: on an activerecord relation
[22:39:29] tycoon177: or is size just a catchall that will use whichever will be more efficient based on current circumstance? if so, why don't length and count do this too?
[22:39:35] kapil___: has joined #RubyOnRails
[22:56:13] bronson: has joined #RubyOnRails
[22:58:14] zwliew: has joined #RubyOnRails
[23:04:09] sameerynho: has joined #RubyOnRails
[23:08:23] mattwc: tycoon177: https://mensfeld.pl/2014/09/activerecord-count-vs-length-vs-size-and-what-will-happen-if-you-use-it-the-way-you-shouldnt/
[23:09:10] mattwc: size will do length if the collection is loaded otherwise it would do count
[23:39:06] aperkins81: has joined #RubyOnRails
[23:43:31] Kugz: has joined #RubyOnRails
[23:54:17] alfiemax: has joined #RubyOnRails
[23:57:03] bronson: has joined #RubyOnRails