« Back to channel list

#RubyOnRails - 13 August 2018

« Back 1 day Forward 1 day »
[00:21:12] atrius: has joined #RubyOnRails
[00:31:19] GodFather: has joined #RubyOnRails
[00:54:20] GodFather: has joined #RubyOnRails
[01:08:10] chouhoulis: has joined #RubyOnRails
[01:21:21] rootsudo: has joined #RubyOnRails
[01:32:59] Saukk: has joined #RubyOnRails
[01:48:52] apeiros: has joined #RubyOnRails
[01:51:38] Dimik: has joined #RubyOnRails
[02:02:54] fmcgeough: has joined #RubyOnRails
[02:09:23] gheegh: has joined #RubyOnRails
[02:14:52] apeiros: has joined #RubyOnRails
[02:40:55] apeiros: has joined #RubyOnRails
[02:47:37] fp-: has joined #RubyOnRails
[02:54:53] fmcgeough: has joined #RubyOnRails
[02:57:35] rootsudo: has joined #RubyOnRails
[03:04:26] alfiemax: has joined #RubyOnRails
[03:06:56] apeiros: has joined #RubyOnRails
[03:10:18] braincrash: has joined #RubyOnRails
[03:33:56] apeiros: has joined #RubyOnRails
[03:35:05] Dimik: has joined #RubyOnRails
[03:47:21] s2013: has joined #RubyOnRails
[03:48:25] s2013: has joined #RubyOnRails
[04:07:56] apeiros: has joined #RubyOnRails
[04:15:47] DTZUZO: has joined #RubyOnRails
[04:17:43] srinidhi: has joined #RubyOnRails
[04:28:54] kapil___: has joined #RubyOnRails
[04:33:25] mojtaba: has joined #RubyOnRails
[04:37:57] s2013: has joined #RubyOnRails
[04:54:47] ragsagar: has joined #RubyOnRails
[05:07:07] s2013: hello all
[05:08:18] duderonomy: has joined #RubyOnRails
[05:10:50] s2013: http://vicfriedman.github.io/blog/2015/07/18/create-multiple-objects-from-single-form-in-rails/ im a bit stuck.. trying to do something similar.. except instead of hardcoding # of elemnents. want to do it dynamically. whats the best approach?
[05:15:59] srinidhi: has joined #RubyOnRails
[05:16:16] s2013: https://stackoverflow.com/questions/33295653/creating-multiple-objects-of-same-model-with-a-single-form-in-rails something like this..
[05:27:07] apeiros: has joined #RubyOnRails
[05:27:50] agent_white: has joined #RubyOnRails
[05:34:40] fcser__: has joined #RubyOnRails
[05:34:46] nemesit: has joined #RubyOnRails
[05:37:05] apeiros: has joined #RubyOnRails
[05:37:21] versatiletech: has joined #RubyOnRails
[05:40:19] ragsagar: Is it ok to cache query result in model method using @items_count ||= query.count() ?
[05:44:44] dionysus69: has joined #RubyOnRails
[06:13:22] apeiros: has joined #RubyOnRails
[06:31:37] apeiros: has joined #RubyOnRails
[06:34:57] Radar: ragsagar: yes but that will only cache it for the duration of the request
[06:35:51] Hexafox[I]: has joined #RubyOnRails
[06:35:51] ragsagar: Radar, Thank you. That will be enough.
[06:36:56] Radar: s2013: people have done this in the past with cocoon but there's probably a hipster React solution to this problem now
[06:37:42] s2013: i think w/ cocoon its if it was nested .. like create an user with bunch of records associated with user.. its harder to figure out how to do parent .. but for now i kept it simple
[06:38:07] Radar: same principle though isn't it?
[06:38:08] s2013: basically a form field.. when you add to it, it creates a new record, refreshes and allows you to create another one
[06:38:18] Radar: yeah that's a good lo-fi solution
[06:38:20] s2013: kinda.. i had hard time getting it to work so i just said f it
[06:39:07] s2013: and im using best_in_place for editing specific records .. so its a decent enough compromise
[06:41:22] s2013: i also had a really really messy non railsy solution that kinda worked .. it involved js dynamically adding a new form field and then rails controller looping through array to create a new record
[06:48:36] dionysus69: has joined #RubyOnRails
[07:15:48] toastercup: has joined #RubyOnRails
[07:17:39] nemesit: how could I get a file_field to append files?
[07:18:05] nemesit: like you can choose multiple but I want to also let users choose one at a time
[07:32:49] srinidhi: has joined #RubyOnRails
[07:42:32] lexileo_: has joined #RubyOnRails
[07:44:43] Dbugger: has joined #RubyOnRails
[07:52:34] uksio: has joined #RubyOnRails
[07:56:29] mikecmpbll: has joined #RubyOnRails
[08:08:21] mikecmpbll: has joined #RubyOnRails
[08:09:08] hightower4: has joined #RubyOnRails
[08:32:27] lxsameer: has joined #RubyOnRails
[08:43:04] srinidhi: has joined #RubyOnRails
[08:53:15] uks: has joined #RubyOnRails
[08:54:46] conta: has joined #RubyOnRails
[09:10:28] reber: has joined #RubyOnRails
[09:16:11] moei: has joined #RubyOnRails
[09:26:16] dionysus69: how do I avoid memory leak in the browser if I send websocket message per second ? I just need data for past 5 seconds, but if user leaves tab open for hour the tab will probably crash
[09:42:16] tbuehlmann: dionysus69: a very simple approach: save the timestamp when a message got added and remove too old messages whenever you're adding to the array
[09:42:50] dionysus69: I am not adding to the array though, just printing it to console
[09:43:41] dionysus69: but even if I am not even putting it to console, it still takes the data from the browser, I just discovered that the memory is not released even if I refresh the page and websocket connection gets disconnect/reconnected
[09:45:21] tbuehlmann: it's not in your hands then
[09:45:48] dionysus69: here firefox memory usage grew from 600mb to 1gb in less than 15 minutes by sending hash with 5 normal sized keys, with 6 open tabs. in production I would just have 2 keys but still adding up the potential duration would make user browser sluggish
[09:45:50] gregf_: has joined #RubyOnRails
[09:46:57] tbuehlmann: I think you're trying to fix browser memory behaviour which isn't in the scope of rails
[09:47:09] dionysus69: weird though, I would think there should be a way to manually release memory for certain data, websocket development otherwise seems like hell
[09:47:55] dionysus69: ok thanks, I will try google some more :)
[09:48:33] tbuehlmann: ever seen GC.start in javascript?
[09:48:54] dionysus69: nope, but I will look it up right now :)
[09:51:40] dionysus69: yea, that doesn't seem like a mainstream javascript feature for sure
[09:58:58] ragsagar: has joined #RubyOnRails
[10:06:59] Ergo: has joined #RubyOnRails
[10:11:10] alfiemax: has joined #RubyOnRails
[10:24:49] Pip: has joined #RubyOnRails
[10:26:26] cariveri: has joined #RubyOnRails
[10:27:17] cariveri: Hi. does anyone know comfy/ mexican_sofa cms? I get a "Site not found " error.
[10:42:26] hightower4: has joined #RubyOnRails
[10:43:29] hightower4: Hey, I install rails 5.2.0 specifically and run "rails new -d postgresql --skip-turbolinks myapp". But, as part of this, rails invokes bundler and it installs rails 5.2.1 among some other 5.2.1 things. How can I stop this from happening and keep rails 5.2.0?
[10:49:56] mikecmpbll: has joined #RubyOnRails
[10:51:15] ragsagar: has joined #RubyOnRails
[10:51:19] hightower4: Also option -B (skip-bundle-install) runs bundle install anyway
[10:56:08] Radar: hightower4: rails _5.2.0_ new -d postgresql --skip-turbolinks
[11:00:36] mikecmpbll: has joined #RubyOnRails
[11:01:02] hightower4: oh, I didn't know I needed it when there was only one rails installed anyway
[11:01:15] hightower4: will try, thanks
[11:06:31] gheegh: has joined #RubyOnRails
[11:11:14] hightower4: Radar, same thing: I run 'gem list' and see "rails (5.2.0)", so surely only rails 5.2.0 is installed. rails -v also reports 5.2.0. But when I run 'rails _5.2.0_ new -d postgresql --skip-turbolinks myapp', in the gems list resulting from bundle install I see: fetching/installing activesupport 5.2.1, actionpack 5.2.1, and so on
[11:14:20] snickers: has joined #RubyOnRails
[11:16:27] dionysus70: has joined #RubyOnRails
[11:16:35] Radar: hightower4: ok, looks like Gemfile uses ~> 5.2.0. So you won't be able to do `rails new` and get exactly 5.2.0
[11:16:42] Radar: hightower4: why do you want 5.2.0 instead of 5.2.1 anyway?
[11:17:09] hightower4: Because I want to add 'solidus' gem which brings in some dependencies which are broken on 5.2.1 (the polyamorous gem and some other things)
[11:17:32] Radar: and they're not broken in 5.2?
[11:17:42] hightower4: yes, that's what the bug report says, let me find it
[11:17:59] Radar: fun. It's just like the olden days of Rails where point releases would break shit willy nilly
[11:18:16] hightower4: https://github.com/solidusio/solidus/issues/2825
[11:19:12] hightower4: yeah, I really didn't expect this in the age of rails 5
[11:20:09] ragsagar: has joined #RubyOnRails
[11:20:33] hightower4: (from a cursory look at the bug report, polyamorous and ransack fail with 5.2.1. I've taken care of that migrations issue by just commenting the offending part which I didn't need anyway, but then ran into other issues somewhere else)
[11:20:50] Radar: Seems like maybe ransack has a release on its master branch: https://github.com/activerecord-hackery/ransack/pull/938/files
[11:21:12] Radar: fun fact: I am capable of pushing a new Ransack version out
[11:22:16] Radar: Fun fact: someone has tagged Ransack 1.8.9 but _didn't_ do a gem release.
[11:22:40] Tempesta: has joined #RubyOnRails
[11:22:40] Radar: Oh no, I tell a lie. It is released here: https://rubygems.org/gems/ransack/versions/1.8.9
[11:24:16] Radar: hightower4: and you can definitely still reproduce this issue using Rails 5.2.1, latest Solidus and Ransack 1.8.9?
[11:24:47] Radar: That's Solidus 2.6.0?
[11:25:19] Radar: Hm, I just installed Solidus here and it's installed Ransack 1.8.8. Taking a look at why that might be.
[11:25:23] cabotto: has joined #RubyOnRails
[11:25:28] hightower4: via gems, yes. I am not sure if the versions are set correctly in their Gemfiles or not, but the install path of install ruby, install rails, add solidus gem, run bundle, doesn't work
[11:26:03] ragsagar: has joined #RubyOnRails
[11:26:14] Radar: ransack (= 1.8.9) was resolved to 1.8.9, which depends on
[11:26:14] Radar: actionpack (<= 5.1.1, >= 3.0)
[11:26:18] Radar: Well there's my problem.
[11:27:17] Radar: https://github.com/activerecord-hackery/ransack/issues/943#issuecomment-411887638
[11:27:24] Radar: So maybe Solidus should bump their dependency to 2.0?
[11:27:29] Radar: their Ransack dep*
[11:28:06] Radar: Solidus has a PR for that here: https://github.com/solidusio/solidus/pull/2826/files
[11:28:24] Radar: Specs are failing there though.
[11:29:01] hightower4: Right, saw it. Ok, great, thanks for the discussion and help. (In the meantime I got it working by preventing automatic bundle install and setting rails version in Gemfile to 5.2.0 specifically)
[11:29:37] Radar: Seems like Ransack is going to be fixed this weekend: https://github.com/activerecord-hackery/ransack/issues/947#issuecomment-412414447
[11:29:48] srinidhi: has joined #RubyOnRails
[11:40:02] DrYockel: has joined #RubyOnRails
[11:40:51] mondz: has joined #RubyOnRails
[11:44:14] augcesar: has joined #RubyOnRails
[11:46:05] alfiemax_: has joined #RubyOnRails
[11:55:03] DTZUZO: has joined #RubyOnRails
[12:04:47] fmcgeough: has joined #RubyOnRails
[12:50:29] KeyJoo: has joined #RubyOnRails
[12:53:16] dblessing: has joined #RubyOnRails
[12:56:42] KeyJoo: has joined #RubyOnRails
[13:08:35] fmartingr: has joined #RubyOnRails
[13:09:41] fmcgeough: has joined #RubyOnRails
[13:10:15] conta1: has joined #RubyOnRails
[13:14:20] dblessing: has joined #RubyOnRails
[13:20:24] conta1: has joined #RubyOnRails
[13:22:05] srinidhi: has joined #RubyOnRails
[13:24:14] srinidhi: has joined #RubyOnRails
[13:33:18] GodFather: has joined #RubyOnRails
[13:34:48] mojtaba: has joined #RubyOnRails
[13:35:11] fmcgeough: has joined #RubyOnRails
[13:43:26] akaiiro: has joined #RubyOnRails
[13:44:44] gheegh: has joined #RubyOnRails
[13:51:41] akaiiro: has joined #RubyOnRails
[13:55:42] mojtaba: has joined #RubyOnRails
[14:02:24] mikecmpb_: has joined #RubyOnRails
[14:04:55] bijan_: has joined #RubyOnRails
[14:06:02] kapil___: has joined #RubyOnRails
[14:08:18] EXCHGR: has joined #RubyOnRails
[14:11:45] duderonomy: has joined #RubyOnRails
[14:33:11] Dimik: has joined #RubyOnRails
[14:41:08] s2013: has joined #RubyOnRails
[14:53:25] Dimik: has joined #RubyOnRails
[14:54:11] mojtaba: has joined #RubyOnRails
[15:02:02] apeiros_: has joined #RubyOnRails
[15:06:23] Technodrome: has joined #RubyOnRails
[15:07:16] Sigfrid: has joined #RubyOnRails
[15:08:04] urkle: has joined #RubyOnRails
[15:08:52] mojtaba: has joined #RubyOnRails
[15:18:50] Saukk: has joined #RubyOnRails
[15:28:14] apeiros_: has joined #RubyOnRails
[15:33:51] dviola: has joined #RubyOnRails
[15:36:01] alfiemax: has joined #RubyOnRails
[15:37:23] chouhoulis: has joined #RubyOnRails
[15:37:43] hotpancakes: has joined #RubyOnRails
[15:45:12] gheegh: has joined #RubyOnRails
[15:53:30] s2013: has joined #RubyOnRails
[16:05:03] mojtaba: has joined #RubyOnRails
[16:15:20] dionysus69: has joined #RubyOnRails
[16:16:07] dionysus69: has joined #RubyOnRails
[16:19:27] chridal: Any gotchas with deploying with Webpacker? Everything compiles on precompile:assets, and I get no errors; but the page is blank.
[16:41:19] Technodrome: has joined #RubyOnRails
[16:42:01] srinidhi: has joined #RubyOnRails
[16:49:18] nzst: has joined #RubyOnRails
[16:51:53] s2013: has joined #RubyOnRails
[16:52:20] prettybT_: has joined #RubyOnRails
[16:54:06] prettybT_: has joined #RubyOnRails
[17:03:23] gheegh: has joined #RubyOnRails
[17:03:39] lxsameer: has joined #RubyOnRails
[17:11:41] sameerynho: has joined #RubyOnRails
[17:27:55] hotpancakes: has joined #RubyOnRails
[17:29:23] hotpancakes: has joined #RubyOnRails
[17:32:56] nzst: I posted this in #web, but maybe someone here has some insight, Have you seen having to double tap a lot of links and elements in ios to navigate through a site, e.g. https://css-tricks.com/annoying-mobile-double-tap-link-issue/ ? How are you getting around this so ios behaves more like android where hover is ignored and you can click without issue?
[17:38:00] s2013: has joined #RubyOnRails
[17:38:58] prettybT_: has joined #RubyOnRails
[17:40:43] KevinSjoberg: has joined #RubyOnRails
[17:45:07] Axsuul: has joined #RubyOnRails
[17:48:12] cagomez: has joined #RubyOnRails
[17:54:29] Aherin: has joined #RubyOnRails
[17:56:03] gheegh: has joined #RubyOnRails
[17:56:44] s2013: has joined #RubyOnRails
[17:58:22] dblessing: has joined #RubyOnRails
[17:58:30] alfiemax: has joined #RubyOnRails
[18:04:39] Caerus: chridal, might sound silly, but are you including your compiled asset using <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %> on your application layout?
[18:05:18] bijan_: has joined #RubyOnRails
[18:06:18] bijan_: What is wrong with this view-code, that I get "ActionView::Template::Error: variant delegated to attachment, but attachment is nil"-Error: <%= image_tag shop.logo.variant(resize: "100x100") %>
[18:14:02] bijan_: ah solved: <% if shop.logo.attached? %> needs to be checked before as guard
[18:15:00] nzst: bijan_: http://mitrev.net/ruby/2015/11/13/the-operator-in-ruby/
[18:15:48] bijan_: nzst that's the first thing I tried upfront but that didn't work because of the way attachments are modeled in Rails 5.2
[18:15:58] bijan_: (separate model)
[18:17:50] prettybT_: has joined #RubyOnRails
[18:18:44] jenrzzz: has joined #RubyOnRails
[18:33:29] cagomez: my controller's Index action delivers a SPA. The SPA does routing on the front end ('home', 'settings'). My Rails route looks like so: `get '/*glob', to: redirect('/home/index')` . is there a way to list 'home' and 'settings' in my Rails route using an array?
[18:33:47] cagomez: I'd like to avoid enumerating the front end routes like so: https://github.com/mdominiak/angular-rails-spa-demo/blob/master/config/routes.rb#L12-L14
[18:36:11] orbyt_: has joined #RubyOnRails
[18:45:47] agent_white: has joined #RubyOnRails
[18:51:11] Technodrome: has joined #RubyOnRails
[18:51:40] reber__: has joined #RubyOnRails
[18:54:06] akaiiro: has joined #RubyOnRails
[18:56:44] nottwo: has joined #RubyOnRails
[19:11:06] Aherin: has joined #RubyOnRails
[19:12:50] amperry: has joined #RubyOnRails
[19:15:04] amperry: hi folks, I have a problem that is more server-level than code-level: https://gist.github.com/amp108/b1068d117f036b6526ef796ba2d5e542 -- basically, HT run `rails s` in a crontab entry to ensure availability in the case of an error making the server process fail. (The question of *why* it's failing is another thing altogether.)
[19:16:18] prettybT_: has joined #RubyOnRails
[19:19:46] tycoon177: has joined #RubyOnRails
[19:19:48] LenPayne_: has joined #RubyOnRails
[19:19:52] tjbp_: has joined #RubyOnRails
[19:24:01] xMopx-: has joined #RubyOnRails
[19:24:12] hotpancakes: has joined #RubyOnRails
[19:26:00] FooBarWidget: has joined #RubyOnRails
[19:29:59] bphogan: has joined #RubyOnRails
[19:30:58] tycoon177: can i specify a controller for a `member` block in routes.rb? i have a collection of non-restful routes that go together but shouldn't be methods on the parent controller
[19:31:05] lexileo: has joined #RubyOnRails
[19:40:10] lunarfyre7: has joined #RubyOnRails
[19:43:07] prettybT_: has joined #RubyOnRails
[19:54:19] orbyt_: has joined #RubyOnRails
[19:57:28] fmcgeough: has joined #RubyOnRails
[20:02:16] machuga: has joined #RubyOnRails
[20:03:04] sonOfRa: Alright, what could be the cause for this particular behavior I'm seeing? https://gist.github.com/sonOfRa/0ea3af35ff2cfaf301f860f717569497
[20:03:51] sonOfRa: As soon as I try to use *user* in any kind of block inside the function it becomes nil
[20:04:06] sonOfRa: But if I just try to inspect it, or it's members, they are accessible
[20:04:41] Puffball: has joined #RubyOnRails
[20:19:50] sonOfRa: crossposted this to #ruby and solved it, I had some leftover code lying around that triggered owns_aliases being called twice
[20:20:05] dviola: has joined #RubyOnRails
[20:20:11] apeiros: kudos for properly reporting the cross-post. sadly so rare.
[20:21:07] sonOfRa: dealt with too many failed crossposts to not remember these days
[20:22:13] rootsudo: has joined #RubyOnRails
[20:23:38] Puffball: has joined #RubyOnRails
[20:29:34] molloy: has joined #RubyOnRails
[20:32:49] molloy: Hi, I have `validates :field, uniqueness: { scope: [:related_field1, :related_field2, related_field3], case_sensitive: false}` which does what I want (the first field must be unique in the scope of the other fields.) However, what I *really* want is for every related field to also be unique and case insensitive. Is there a better way of doing this than just defining a validation for each separate field,
[20:32:52] molloy: with the fields shuffled around properly each time?
[20:50:02] hotpancakes: has joined #RubyOnRails
[20:52:19] Technodrome: has joined #RubyOnRails
[21:09:32] mojtaba: has joined #RubyOnRails
[21:11:02] gheegh: has joined #RubyOnRails
[21:12:45] GodFather: has joined #RubyOnRails
[21:33:27] beowuff: has joined #RubyOnRails
[21:43:32] dviola: has joined #RubyOnRails
[21:45:03] dblessing: has joined #RubyOnRails
[21:51:38] exchgr`: has joined #RubyOnRails
[21:53:26] hotpancakes: has joined #RubyOnRails
[22:03:21] orbyt_: has joined #RubyOnRails
[22:07:40] Inside: has joined #RubyOnRails
[22:11:47] alfiemax: has joined #RubyOnRails
[22:12:37] beowuff: has joined #RubyOnRails
[22:51:41] wethu: has joined #RubyOnRails
[23:06:18] apeiros: has joined #RubyOnRails
[23:15:02] orbyt_: has joined #RubyOnRails
[23:25:10] uks: has joined #RubyOnRails
[23:30:34] rfoust: has joined #RubyOnRails
[23:31:22] apeiros: has joined #RubyOnRails
[23:32:48] uks: has joined #RubyOnRails