« Back to channel list

#RubyOnRails - 18 November 2017

« Back 1 day Forward 1 day »
[00:03:44] truenito: has joined #RubyOnRails
[00:12:59] brycesenz: has joined #RubyOnRails
[00:15:19] workmad3: has joined #RubyOnRails
[00:27:03] cagomez: has joined #RubyOnRails
[00:32:31] orbyt_: has joined #RubyOnRails
[00:32:57] apeiros: has joined #RubyOnRails
[00:42:08] nickenchuggets: wondering if anyone might know how to get rails/mysql to accept Japanese characters
[00:42:41] cagomez: has joined #RubyOnRails
[00:42:49] nickenchuggets: ActiveRecord::StatementInvalid: Mysql2::Error: Incorrect string value: '\xE5\xBD\xB1\xE9\x9F\xBF' for column 'kanji' at row 1: INSERT INTO `terms` (`kanji`, `hiragana`, `english`, `created_at`, `updated_at`) VALUES ('影響', 'えいきょう', 'influence; effect​', '2017-11-18 00:41:23', '2017-11-18 00:41:23')
[00:44:23] nickenchuggets: tried utf8mb4 encoding for mysql
[00:45:16] lupine: bet it works in mysql :troll:
[00:45:21] lupine: erm, postgres
[00:46:15] nickenchuggets: the main reason I use mysql is because it has a nice GUI
[00:46:42] apeiros: has joined #RubyOnRails
[00:52:00] nickenchuggets: lol, it did work in postgres
[00:52:45] nickenchuggets: postgres it is, thanks
[01:10:24] jottr_: has joined #RubyOnRails
[01:12:46] apeiros: has joined #RubyOnRails
[01:22:14] irishfromua: has joined #RubyOnRails
[01:49:07] brycesenz: has joined #RubyOnRails
[01:49:56] Technodrome: has joined #RubyOnRails
[01:59:55] ornerymoose: has joined #RubyOnRails
[02:09:45] quazimodo: has joined #RubyOnRails
[02:11:45] lupine: has joined #RubyOnRails
[02:15:36] workmad3: has joined #RubyOnRails
[02:15:52] apeiros: has joined #RubyOnRails
[02:17:06] Jameser: has joined #RubyOnRails
[02:22:48] fl4sh_: has joined #RubyOnRails
[02:29:48] apeiros: has joined #RubyOnRails
[02:37:05] apeiros: has joined #RubyOnRails
[02:44:36] apeiros: has joined #RubyOnRails
[02:46:43] xlegoman: has joined #RubyOnRails
[02:55:28] emerson: has joined #RubyOnRails
[02:59:25] Jameser: has joined #RubyOnRails
[02:59:27] apeiros: has joined #RubyOnRails
[03:01:20] apparition: has joined #RubyOnRails
[03:07:00] jottr_: has joined #RubyOnRails
[03:07:34] someish: has joined #RubyOnRails
[03:13:37] apeiros: has joined #RubyOnRails
[03:14:14] jottr_: has joined #RubyOnRails
[03:20:56] drowze: has joined #RubyOnRails
[03:21:13] apeiros: has joined #RubyOnRails
[03:42:51] apeiros: has joined #RubyOnRails
[03:48:31] MrCrackPotBuilde: has something changed in bootstrap 4 and rails with the sticy navigation
[03:48:51] MrCrackPotBuilde: i can get the navbar to stick to the body but i cant get it to stick to the header
[03:48:57] MrCrackPotBuilde: or get the header to scroll
[03:49:23] MrCrackPotBuilde: https://codepen.io/scope2229/pen/RjxPZY
[03:49:31] MrCrackPotBuilde: thats the code im using
[03:55:36] apeiros: has joined #RubyOnRails
[03:55:40] fryguy: has joined #RubyOnRails
[04:01:51] dviola: has joined #RubyOnRails
[04:10:12] apeiros: has joined #RubyOnRails
[04:15:55] workmad3: has joined #RubyOnRails
[04:26:26] apeiros: has joined #RubyOnRails
[04:31:51] adgtl: has joined #RubyOnRails
[04:35:53] fragamus: has joined #RubyOnRails
[04:39:02] apeiros: has joined #RubyOnRails
[05:02:09] quazimod1: has joined #RubyOnRails
[05:02:47] apeiros: has joined #RubyOnRails
[05:14:16] apeiros: has joined #RubyOnRails
[05:15:25] jottr_: has joined #RubyOnRails
[05:27:02] apeiros: has joined #RubyOnRails
[05:30:14] MrCrackPotBuilde: https://www.youtube.com/watch?v=9CWjFtCbrrM
[05:30:35] MrCrackPotBuilde: so i dont need to add any gems to the gem file ??
[05:41:04] apeiros: has joined #RubyOnRails
[05:43:08] matthewd: MrCrackPotBuilde: I'm unclear what you're asking, sorry
[05:44:24] srinidhi: has joined #RubyOnRails
[05:49:54] fryguy: are you sure that's the right timestamp? it's talking about jquery and ujs, not gemfiles
[06:03:51] apeiros: has joined #RubyOnRails
[06:09:49] yeshurun: has joined #RubyOnRails
[06:16:11] workmad3: has joined #RubyOnRails
[06:20:47] apeiros: has joined #RubyOnRails
[06:28:53] apeiros: has joined #RubyOnRails
[06:31:10] dminuoso: Im looking for ways to plug in a custom navbar system. Is there some clean wait of letting a route provide some additional information to the controller?
[06:38:08] armyriad: has joined #RubyOnRails
[06:38:26] jottr_: has joined #RubyOnRails
[06:45:58] Saukk: has joined #RubyOnRails
[06:47:30] jottr_: has joined #RubyOnRails
[06:52:48] apeiros: has joined #RubyOnRails
[06:57:49] snickers: has joined #RubyOnRails
[06:59:46] srinidhi: has joined #RubyOnRails
[07:01:59] srinidhi: has joined #RubyOnRails
[07:02:27] apeiros: has joined #RubyOnRails
[07:09:21] apeiros: has joined #RubyOnRails
[07:19:57] hailey27: has joined #RubyOnRails
[07:20:05] hailey27: Hey everyone!
[07:20:23] hailey27: Does anyone here know a lot about Nokogiri? I'm stuck with how to use the HUGE option with a DocumentFragment.
[07:21:23] Dimik: has joined #RubyOnRails
[07:22:32] dminuoso: hailey27: !rule3
[07:22:32] helpa: hailey27: 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.
[07:22:43] dminuoso: Well, > #ruby
[07:22:51] dminuoso: But we dont have that awesome factoid there.
[07:23:17] hailey27: dminuoso: if i do, will you help me or just give me another sassy factoid?
[07:23:49] jottr_: has joined #RubyOnRails
[07:23:58] dminuoso: hailey27: Do not take them as sassy. It's just a friendly request for "more information"
[07:24:18] dminuoso: Experience shows that we have to ask for code and stack traces repeatedly.
[07:30:27] Kutakizukari: has joined #RubyOnRails
[07:30:28] hailey27: dminuoso: this test succeeds, hopefully that illustrates the problem: https://gist.github.com/anonymous/ab22fdb251d10855ef08a35a17dbac31
[07:31:02] apeiros: has joined #RubyOnRails
[07:31:23] hailey27: Effectively, nokogiri limits bytesize of documents to 10MB by default
[07:31:39] hailey27: but there's an option on regular documents to stop that - `HUGE`
[07:31:43] matthewd: hailey27: Does https://github.com/sparklemotion/nokogiri/issues/740#issuecomment-300370426 help?
[07:32:13] cschneid_: has joined #RubyOnRails
[07:32:55] hailey27: using the "huge" option works with an HTML::Document, but not an HTML::DocumentFragment since it doesn't take an "options" parameter, matthewd
[07:32:58] hailey27: thanks for the ref tho :)
[07:33:09] mtkd: has joined #RubyOnRails
[07:33:37] hailey27: [6] pry(main)> Nokogiri::HTML(string) { |c| c.huge }.to_s.bytesize
[07:33:39] hailey27: => 16777357
[07:33:52] hailey27: the only problem is, i need the behaviour of a document fragment :(
[07:37:13] apeiros: has joined #RubyOnRails
[07:52:45] apeiros: has joined #RubyOnRails
[07:59:30] jottr_: has joined #RubyOnRails
[08:01:50] ornerymoose: has joined #RubyOnRails
[08:13:41] apeiros: has joined #RubyOnRails
[08:23:22] dionysus69: has joined #RubyOnRails
[08:32:52] apeiros: has joined #RubyOnRails
[08:33:48] apeiros: has joined #RubyOnRails
[08:35:42] snickers: has joined #RubyOnRails
[08:47:36] dminuoso: hailey27: By the way. Notice how you did not communicate the resolution of your problem?
[08:49:51] ArTiSTiX: has joined #RubyOnRails
[08:55:22] easzero: has joined #RubyOnRails
[09:00:35] easzero: has joined #RubyOnRails
[09:07:22] jottr_: has joined #RubyOnRails
[09:17:46] jottr_: has joined #RubyOnRails
[09:30:24] Andr3as: morning everyone.. i am trying to use paperclip with cocoon to add multiple attachments to a model.. on updating the form it runs through and at the end it just rools back with no errors given.. anyone ever had that?
[09:30:33] Andr3as: here's a gist of the server console: https://gist.github.com/awunder/c73c4620aaf6f62b6cf727329ed6ce50
[09:34:37] matthewd: Andr3as: Use save! (and friends) if you're not checking the result of calling save (etc)
[09:36:11] Andr3as: matthewd: man, that helped!! thank you mathew.. had a(nother) validation which was triggered
[09:36:22] Andr3as: i was going crazy.. made my day :)
[09:37:19] Andr3as: matthewd: is it cleaner to remove the bang for production?
[09:38:03] matthewd: No. Use the bang unless you're checking the return value.
[09:38:17] Andr3as: i see.. thx again
[09:45:19] ahrs: has joined #RubyOnRails
[09:50:52] marr: has joined #RubyOnRails
[09:51:27] mikecmpbll: has joined #RubyOnRails
[09:54:52] Saukk: has joined #RubyOnRails
[10:09:35] quazimodo: has joined #RubyOnRails
[10:15:16] toydestroyer: has joined #RubyOnRails
[10:16:42] phedkvist: has joined #RubyOnRails
[10:16:51] workmad3: has joined #RubyOnRails
[10:18:13] phedkvist: I completely messed up my PR, adding commits from other people from master, https://github.com/rails/rails/pull/31170 How can I fix this?
[10:19:58] matthewd: phedkvist: `git fetch origin; git rebase -i origin/master`, then delete all the lines that aren't yours
[10:35:01] phedkvist: has joined #RubyOnRails
[10:35:35] phedkvist: Thx matthewd :)
[10:35:58] matthewd: phedkvist: No worries! Do you happen to know how you got into that situation, btw?
[10:36:41] matthewd: I'm wondering if we have something to fix in our docs, because you're not the first person I've seen with that problem
[10:38:54] iamarun: has joined #RubyOnRails
[10:45:05] dviola: has joined #RubyOnRails
[10:51:45] megan1993: has joined #RubyOnRails
[10:52:02] easzero: has joined #RubyOnRails
[10:52:12] phedkvist: What I did was to add another commit on my local branch, then I ran git reset --soft HEAD~2, and made another commit and tried to push to my pr, but it was rejected. Then I ran git fetch upstream, git rebase -i upstream/master, , git push origin stem_testing_guides
[10:52:19] megan1993: Goodmorning everyone! When I use an url_field in my form, does that only do the html5 client side validation? Or does it also fix server side?
[10:53:13] easzero: has joined #RubyOnRails
[10:53:59] matthewd: phedkvist: Weird.. I don't immediately see where that could've gone wrong. (Though I assume it was the rebase, somehow)
[10:54:55] matthewd: megan1993: Forms are generated in views, which don't have any influence over the subsequent incoming request
[10:55:49] megan1993: @matthewd, so it doesn't validate the url server side?
[10:56:15] phedkvist: Continuing my last message: But my push was rejeceted again, so I pulled from my fork, thinking it would "reset" so I could push again. Then I was able to push again, this is where all the other commits came from
[10:57:10] matthewd: megan1993: Correct. You'll probably want a separate validation on the model.
[10:58:12] matthewd: phedkvist: Ah, I thought the push was the end :) I guess the pull maybe, then
[11:13:43] jottr_: has joined #RubyOnRails
[11:21:11] easzero: has joined #RubyOnRails
[11:29:16] arBmind: has joined #RubyOnRails
[11:33:23] easzero: has joined #RubyOnRails
[11:39:10] hammer065: has joined #RubyOnRails
[11:45:31] easzero: has joined #RubyOnRails
[11:52:09] dionysus69: has joined #RubyOnRails
[12:02:15] jrabe: has joined #RubyOnRails
[12:03:49] sevenseacat: has joined #RubyOnRails
[12:17:11] workmad3: has joined #RubyOnRails
[12:48:10] ferr: has joined #RubyOnRails
[12:50:10] irishfromua: has joined #RubyOnRails
[12:50:14] Welcius: has joined #RubyOnRails
[12:51:39] Welcius: Hello! I'm trying to set parameters for a custom form field but I don't know how to write them :c specifically I'm trying to do this https://github.com/code-and-effect/effective_form_inputs#options
[12:52:03] Welcius: But I don't have simpleform installed and f.input gives me an error
[12:52:38] Welcius: so I'm trying to set the parameters using the normal form helper with f.effective_ckeditor_text_area
[13:06:41] easzero_: has joined #RubyOnRails
[13:07:35] Welcius: any idea? :c
[13:12:46] phedkvist: has joined #RubyOnRails
[13:13:14] defsdoor: has joined #RubyOnRails
[13:13:55] ferr: has left #RubyOnRails: ("WeeChat 1.9.1")
[13:17:23] NoGodDamnIdea: has joined #RubyOnRails
[13:18:48] easzero: has joined #RubyOnRails
[13:29:37] Kutakizukari: has joined #RubyOnRails
[13:31:57] DrYockel: has joined #RubyOnRails
[13:39:02] apparition: has joined #RubyOnRails
[14:17:24] workmad3: has joined #RubyOnRails
[14:45:30] xlegoman: has joined #RubyOnRails
[14:55:00] xlegoman: has joined #RubyOnRails
[15:04:15] Puffball: has joined #RubyOnRails
[15:07:50] iamarun: has joined #RubyOnRails
[15:09:23] kapil___: has joined #RubyOnRails
[15:17:41] AzaToth: has joined #RubyOnRails
[15:19:52] AnotherOne: has joined #RubyOnRails
[15:48:11] borodin: has joined #RubyOnRails
[15:49:39] borodin: I designed an api with one controller (deployments) nested within another controller (templates) such that to create a deployment you need to know the template id first, i.e. POST /templates/#template_id/deployments
[15:50:48] borodin: but now this developer who seems unfamiliar with REST and has a lot of power over me insists that I create a separate controller that can generate or reuse a template for every deployment i.e. POST /new_deployment
[15:51:39] borodin: it would include in the parameters all params required for both template and deployment (even though the template is very static). I tried everything to talk him out of it but he was arguing like it was life or death
[15:52:22] borodin: anyway so I'm building the new_deployments controller, and wondering, do I need a NewDeployment model? I certainly don't want to keep two copies of the params
[15:52:56] borodin: and I want validation to propagate properly and not have to repeat myself as I develop NewDeployment
[16:10:35] snickers: has joined #RubyOnRails
[16:17:42] workmad3: has joined #RubyOnRails
[16:29:33] MrCrackPotBuilde: has joined #RubyOnRails
[16:46:21] bronson: has joined #RubyOnRails
[17:01:00] VinnyPotter: has joined #RubyOnRails
[17:04:56] VinnyPotter: Hello, I'm new to the community! I'm starting to use factory_bot_rails but the factories folder is not being loaded. I've already did the FactoryBot.find_definitions line
[17:05:07] VinnyPotter: What could it be?
[17:17:34] MrCrackPotBuilde: has joined #RubyOnRails
[17:22:58] Welcius: Hello people! I have this data structure in Ruby on Rails https://ghostbin.com/paste/yt7tq
[17:23:02] Welcius: How can I get the string filename?
[17:23:07] Welcius: let me clarify, this values: attachments: ["1480132284988.jpg", "1493525543211.jpg"]
[17:33:13] badeball: has joined #RubyOnRails
[17:41:58] kapil___: has joined #RubyOnRails
[17:43:27] kapil___: I fetched model and has_many relations data. on frontend some relation row are deleted and some are newly created. how to track it?
[17:47:19] havenwood: Welcius: File.basename Issue.last.attachments.first.file
[17:48:25] havenwood: Welcius: Issue.last.attachments.pluck(:file).map { |path| File.basename path }
[17:50:11] Welcius: https://ghostbin.com/paste/dz22s
[17:52:13] havenwood: Welcius: Ah, it looks like #file returns another instance (a sanitized file not a filename).
[17:52:24] havenwood: **not a filename String
[17:52:51] havenwood: Welcius: What is?: Issue.last.attachments.first.file.file
[17:53:04] havenwood: just keep putting .file on the end 'till it's a String, apparently ;-P
[17:53:17] Welcius: that would be a full path
[17:53:27] Welcius: but i dont see the filenames, its kinda strange :s
[17:53:28] havenwood: Welcius: File.basename(fullpath)
[17:53:54] Welcius: that did the trick, thanks! but im kinda shocked i cant access the array by itself
[17:55:45] havenwood: Welcius: Say more about that? What do you mean by accessing hte array by itself?
[17:56:11] snickers: has joined #RubyOnRails
[17:56:19] Welcius: when i printed the full object there was some property like: attachments: ["1480132284988.jpg", "1493525543211.jpg"]
[17:56:58] Welcius: so im a bit shocked that i cant navigate to that strings from the object
[17:57:04] havenwood: Welcius: I'd suggest taking a look at the methods on an #<AttachmentUploader:...> instance in Pry.
[17:57:10] havenwood: Or check the docs for what it responds to.
[18:00:35] Welcius: i've tried but all the docs are a bit confusing
[18:00:38] Welcius: thanks for the help!
[18:01:00] orbyt_: has joined #RubyOnRails
[18:01:04] havenwood: Welcius: no prob! happy coding!
[18:03:56] Dimik: has joined #RubyOnRails
[18:04:03] dviola: has joined #RubyOnRails
[18:05:52] ornerymoose: has joined #RubyOnRails
[18:08:08] MrCrackPotBuilde: has joined #RubyOnRails
[18:08:59] lxsameer: has joined #RubyOnRails
[18:16:52] VinnyPotter: has joined #RubyOnRails
[18:18:02] workmad3: has joined #RubyOnRails
[18:33:40] hailey27: dminuoso: because i fell asleep, it was 4am.
[18:33:55] hailey27: there also wasn't a resolution ;(
[18:55:03] phedkvist: has joined #RubyOnRails
[19:00:23] Technodrome: has joined #RubyOnRails
[19:07:24] Saukk: has joined #RubyOnRails
[19:18:57] Iarfen: has joined #RubyOnRails
[19:19:18] jottr: has joined #RubyOnRails
[19:19:26] Iarfen: is this framework totally open source? It's not related to an organization like Symfony or Zend?
[19:23:05] gr33nw00d: has joined #RubyOnRails
[19:23:44] millz: has joined #RubyOnRails
[19:27:00] easzero: has joined #RubyOnRails
[19:27:05] gr33nw00d: Hey guys. I was wondering if anyone has suggested recent articles for best practices relating to functionality that deals with multiple models. I've been looking into observers, the cons of callbacks, and service classes, but most of the material is a bit old. For example I have a Flight, Passenger, and Order class and when an order is complete I want to create a flight and assign passengers to it. Is it best practice to put this logi
[19:27:05] gr33nw00d: c in the controller, service, another model, or within one of the models themselves? Thank you for your feedback
[19:28:36] VinnyPotter: I'm going to ask the question again. Can't find the answer the internet
[19:28:37] VinnyPotter: I'm starting to use factory_bot_rails but the factories folder is not being loaded. I've already did the FactoryBot.find_definitions line
[19:30:24] joshsmith: has joined #RubyOnRails
[19:32:12] jottr: has joined #RubyOnRails
[19:49:10] mtkd: has joined #RubyOnRails
[19:50:10] dviola: has joined #RubyOnRails
[20:18:04] jottr: has joined #RubyOnRails
[20:18:20] workmad3: has joined #RubyOnRails
[20:27:17] snickers: has joined #RubyOnRails
[20:37:11] VinnyPotter: has joined #RubyOnRails
[20:40:57] orbyt_: has joined #RubyOnRails
[20:56:21] quazimodo: has joined #RubyOnRails
[20:58:21] jottr: has joined #RubyOnRails
[20:58:38] Technodrome: has joined #RubyOnRails
[21:03:33] dionysus69: has joined #RubyOnRails
[21:22:23] LateralOctober: has joined #RubyOnRails
[21:33:57] jottr: has joined #RubyOnRails
[21:46:42] cagomez: has joined #RubyOnRails
[22:15:11] quazimodo: has joined #RubyOnRails
[22:17:54] jottr: has joined #RubyOnRails
[22:18:35] workmad3: has joined #RubyOnRails
[22:19:11] hailey27: has joined #RubyOnRails
[22:22:39] SteenJobs: has joined #RubyOnRails
[22:23:57] quazimodo: has joined #RubyOnRails
[22:43:24] DTZUZO: has joined #RubyOnRails
[22:48:35] mtkd: has joined #RubyOnRails
[22:49:21] orbyt_: has joined #RubyOnRails
[23:02:35] ornerymoose: has joined #RubyOnRails
[23:13:20] ^mtkd: has joined #RubyOnRails
[23:20:33] codetrane: has joined #RubyOnRails
[23:22:47] codetrane: has joined #RubyOnRails
[23:23:17] SteenJobs: has joined #RubyOnRails
[23:29:29] uks: has joined #RubyOnRails
[23:31:18] one_zero: has joined #RubyOnRails
[23:35:31] cagomez: has joined #RubyOnRails
[23:42:02] jottr: has joined #RubyOnRails
[23:44:30] workmad3: has joined #RubyOnRails