« Back to channel list

#RubyOnRails - 21 June 2016

« Back 1 day Forward 1 day »
[00:00:28] kitsuneyo: smathy, since flash is a 'special part of the session', does that mean you can't update it with ajax?
[00:00:57] kitsuneyo: like, by sticking some html in a div with jquery
[00:01:33] smathy: kitsuneyo, ajax is a sort of protocol for making HTTP requests from Javascript, once the request is at the server you can run any code you like in response to it.
[00:01:55] smathy: "can't update [flash] with ajax" doesn't make sense on so many levels.
[00:02:37] smathy: ACTION sends some butterflies after kitsuneyo 
[00:02:39] jhass: you totally can, just put some XML to adobe and get the fresh plugin!
[00:02:44] jhass: sorry I should go to bed
[00:02:52] evansbee: has joined #RubyOnRails
[00:04:28] smathy: Ooh, nearly a birthday.
[00:05:00] kitsuneyo: smathy, i have a 9 month old soon and a successful business unrelated to programming
[00:05:29] Radar: kitsuneyo: Your question is strange.
[00:05:33] Radar: kitsuneyo: What do you want to do exactly?
[00:05:35] smathy: Not sure why you're telling me that (which is not an altogether unfamiliar feeling with you :)
[00:06:02] kitsuneyo: i'm telling you because you seem to be implying i should
[00:06:11] kitsuneyo: have learned more by now
[00:07:10] kitsuneyo: you don't actually have to answer any of my questions, but the snark is pretty lame
[00:07:11] smathy: kitsuneyo, ok, and your point was that you are very busy so haven't spent a lot of time on learning programming?
[00:07:37] kitsuneyo: i've spent a ton of time
[00:08:53] ChanServ: +q *!*@ruby/staff/smathy
[00:09:40] Radar: [10:05:35] <Radar> kitsuneyo: What do you want to do exactly?
[00:10:55] smathy: has left #RubyOnRails: ()
[00:14:04] Honeycomb: has joined #RubyOnRails
[00:16:43] emachnic: has joined #RubyOnRails
[00:18:50] quazimodo: I can't believe i haven't run into this yet, how do I get a time object for today at say, 11:52 pm?
[00:19:00] quazimodo: it seems... incredibly convoluted
[00:19:04] alfiemax: has joined #RubyOnRails
[00:19:15] quazimodo: or i've totally lost the plot
[00:20:03] Rodya_: has joined #RubyOnRails
[00:20:43] quazimodo: I have to make a Time.now object. use it's year month day and build a new time object don't I?
[00:21:16] quazimodo: looks like it 0_o
[00:22:37] jhass: quazimodo: http://api.rubyonrails.org/classes/Time.html#method-i-change
[00:23:21] greghoggard: has joined #RubyOnRails
[00:24:49] Radar: quazimodo: the Chronic gem also can do this
[00:29:11] siaw23: has joined #RubyOnRails
[00:31:57] daed: has joined #RubyOnRails
[00:32:44] daed: where's the best place to start learning rails 5 API coding? (in particular, rspec/testing/etc)
[00:33:31] daed: or should i wait for rspec 3.5 to come out of beta?
[00:37:55] Oliphaunte: has joined #RubyOnRails
[00:42:17] quazimodo: jhass, Radar: thank you
[00:42:33] Spami: has joined #RubyOnRails
[00:42:33] quazimodo: jhass: i didn't know rails added that 'change' method
[00:42:42] hahuang62: has joined #RubyOnRails
[00:43:14] KnownSy0: has joined #RubyOnRails
[00:44:33] evansbee: has joined #RubyOnRails
[00:45:44] Oliphaunte: has joined #RubyOnRails
[00:52:06] quazimodo: wow chronic gem has some functionality doesn't it
[00:53:29] KnownSy0: has joined #RubyOnRails
[00:59:01] Radar: yes most gems do have some functionality.
[00:59:27] zave: has joined #RubyOnRails
[01:00:30] xall_: has joined #RubyOnRails
[01:04:52] eserror: has joined #RubyOnRails
[01:05:56] noodle: has joined #RubyOnRails
[01:08:51] cnk: has left #RubyOnRails: ()
[01:09:36] Hobogrammer: has joined #RubyOnRails
[01:11:34] eljimador: has joined #RubyOnRails
[01:12:53] DoctorMonocular: is s3 the best service to handle picture uploads from carrierwave?
[01:13:00] helpa: "Best" and "better" are subjective. Try to use a different term.
[01:13:07] eljimmy: has joined #RubyOnRails
[01:13:08] Radar: DoctorMonocular: Yes, it's fine.
[01:13:10] DoctorMonocular: don't need much, just storage
[01:13:46] Chirimbolito: has joined #RubyOnRails
[01:14:19] northfurr: has joined #RubyOnRails
[01:15:20] sevenseacat: has joined #RubyOnRails
[01:16:41] dannyh: has joined #RubyOnRails
[01:16:42] dannyh: if you have a controller action, eg. post :methodName
[01:16:53] dannyh: nested inside 3 levels of resources
[01:17:08] dannyh: what will the path be? methodName_level1_level2_level3?
[01:17:16] dannyh: or level1_level2_level3_methodName
[01:17:27] xcesariox: has joined #RubyOnRails
[01:17:41] DoctorMonocular: why not try it and see?
[01:18:03] dannyh: from what i can tell from the application im working on, its the first one, and im trying to understand why that is
[01:18:17] dannyh: trying to find documentation that can explain that specific scenario and why it's like that
[01:18:58] DoctorMonocular: you're talking about the path helper method?
[01:19:11] DoctorMonocular: like dogs_collars_path()?
[01:19:59] DoctorMonocular: you can see what the path names for all your routes are by running `rake routes` in the console in your app directory
[01:20:14] triptec: has joined #RubyOnRails
[01:20:16] DoctorMonocular: that will list what all the paths are including your nested ones, so you can get the pattern
[01:20:43] DoctorMonocular: I'm not sure there is an explanation outside of code that exists for why someone chose to set it up like they did, although I could be wrong
[01:21:10] gfvcastro: has joined #RubyOnRails
[01:21:19] dannyh: from what you know, the first one makes sense?
[01:21:45] Ericx2x: has joined #RubyOnRails
[01:25:11] Ropeney: has joined #RubyOnRails
[01:25:56] gfvcastro: has joined #RubyOnRails
[01:29:27] viiralvx: has joined #RubyOnRails
[01:35:30] Oliphaunte: has joined #RubyOnRails
[01:35:54] triptec: has joined #RubyOnRails
[01:36:20] markfletcher: has joined #RubyOnRails
[01:36:29] Sashimi_: has joined #RubyOnRails
[01:37:51] jtong: has joined #RubyOnRails
[01:38:57] cleopatra: has joined #RubyOnRails
[01:43:26] hahuang62: has joined #RubyOnRails
[01:44:23] greghoggard: has joined #RubyOnRails
[01:44:28] cleopatra: has joined #RubyOnRails
[01:48:38] sumobob: has joined #RubyOnRails
[01:53:41] triptec: has joined #RubyOnRails
[01:57:57] ur5us: has joined #RubyOnRails
[01:59:27] roamingdog: has joined #RubyOnRails
[02:01:34] sumobob: anyone have any tips on dealing with activemodel serializers? I'm struggling on passing an arbitrary value into the json object that is created
[02:03:33] Radar: sumobob: I found AMS too restrictive, so I now use jbuilder.
[02:03:44] Radar: might be something to consider if you're not too far down the AMS path
[02:04:08] sumobob: I am not, i also saw something called, rabl? Do you have any experience on that
[02:04:49] emachnic: has joined #RubyOnRails
[02:06:09] _Tariq: has joined #RubyOnRails
[02:09:16] triptec: has joined #RubyOnRails
[02:13:42] Rodya_: has joined #RubyOnRails
[02:20:10] enitiz: has joined #RubyOnRails
[02:25:17] Oliphaunte: has joined #RubyOnRails
[02:27:28] platoon1: has joined #RubyOnRails
[02:41:07] Leepoff: has joined #RubyOnRails
[02:43:05] chimkan: has joined #RubyOnRails
[02:44:08] hahuang62: has joined #RubyOnRails
[02:49:04] rueben: has joined #RubyOnRails
[02:49:46] draig: has joined #RubyOnRails
[02:56:47] gfvcastro: has joined #RubyOnRails
[02:59:31] emachnic: has joined #RubyOnRails
[03:02:32] changeme_: has joined #RubyOnRails
[03:03:57] northfurr: has joined #RubyOnRails
[03:14:17] rubyonrails298: has joined #RubyOnRails
[03:15:24] triptec: has joined #RubyOnRails
[03:17:07] braincrash: has joined #RubyOnRails
[03:19:44] Technodrome: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[03:20:50] Niham: has joined #RubyOnRails
[03:20:52] k3rn31: has joined #RubyOnRails
[03:22:07] macsteps: has joined #RubyOnRails
[03:22:55] northfurr: has joined #RubyOnRails
[03:23:07] mercerist: has joined #RubyOnRails
[03:23:10] yfeldblum: has joined #RubyOnRails
[03:24:54] Oliphaunte: has joined #RubyOnRails
[03:26:56] DoctorMonocular: has joined #RubyOnRails
[03:29:03] gfvcastro: has joined #RubyOnRails
[03:39:22] jtong: has joined #RubyOnRails
[03:41:58] Leeroy: has joined #RubyOnRails
[03:44:55] hahuang62: has joined #RubyOnRails
[03:48:30] pontiki: has joined #RubyOnRails
[03:49:33] globalall0c: has left #RubyOnRails: ("Leaving")
[03:56:15] joowh85: has joined #RubyOnRails
[04:02:15] yardenbar: has joined #RubyOnRails
[04:02:48] dopie2: has joined #RubyOnRails
[04:03:55] roamingdog: has joined #RubyOnRails
[04:05:45] dopie2: has joined #RubyOnRails
[04:12:44] oystersauce8: has joined #RubyOnRails
[04:16:43] k3rn31: has joined #RubyOnRails
[04:18:53] iajrz: has joined #RubyOnRails
[04:19:11] Oliphaunte: has joined #RubyOnRails
[04:19:44] chintanparikh: has joined #RubyOnRails
[04:19:55] iajrz: if anyone's got a minute - I'm a complete newbie, for some reason my stupidly simple rails app isn't deleting.
[04:20:13] iajrz: I scaffolded a model, there's no js being served for some reason
[04:21:17] oystersauce8: has joined #RubyOnRails
[04:22:06] Radar: iajrz: Could you please upload your code to GitHub so that we can inspect it?
[04:22:39] iajrz`: has joined #RubyOnRails
[04:22:55] iajrz`: hi, sorry, internet messy
[04:23:06] iajrz`: Radar: sevenseacat making the repo public
[04:23:21] iajrz`: following railstutorial.org
[04:23:21] iajrz`: they recommend setting it private
[04:23:21] iajrz`: please bear with me :)
[04:24:11] pontiki: ah, yeah, he does that :/
[04:24:14] tego101: has joined #RubyOnRails
[04:24:40] iajrz_: has joined #RubyOnRails
[04:25:04] iajrz_: ok, now I'm back -- hopefully to stay
[04:25:06] iajrz_: https://github.com/iajrz/toy_app
[04:25:21] iajrz_: that's the code
[04:26:03] sevenseacat: https://github.com/iajrz/toy_app/blob/master/app/views/layouts/application.html.erb#L5 you removed the javascript
[04:26:30] sypheren: has joined #RubyOnRails
[04:26:41] dextertzu: has joined #RubyOnRails
[04:27:06] iajrz: sevenseacat: looking at that...
[04:28:01] crystal77: has joined #RubyOnRails
[04:28:13] Radar: iajrz: there should be a <%= javascript_include_tag "application" %> there
[04:28:47] iajrz: Yeah, I don't remember doing that.
[04:29:23] iajrz: I'm a bit worried now.
[04:30:06] iajrz: well -- thanks, this was really prompt help :D
[04:30:09] iajrz: ... need to re-trace my steps, maybe I did something in rubymine without noticing.
[04:33:04] dopie2: has joined #RubyOnRails
[04:34:24] iajrz: aha, I nailed what happened -- thanks for the help, Radar & sevenseacat . I never removed it - it was never there.
[04:34:39] iajrz: I started the project using the rubymine wizard
[04:34:41] sevenseacat: yes it was, when you generated thr app.
[04:34:51] sevenseacat: rubymine wizard?
[04:34:57] sevenseacat: the fuck is that?
[04:34:58] iajrz: rubymine, new project
[04:35:09] Radar: no app/assets/javascripts dir?
[04:35:09] iajrz: rubymine -- eh, the jetbrains IDE for ruby
[04:35:13] sevenseacat: I dont know what that is, but don't do that.
[04:35:18] sevenseacat: follow the guide.
[04:35:21] iajrz: thing is, they let you choose the javascript framework
[04:35:37] iajrz: I selected none - which meant no javascript instead of "no framework"
[04:35:58] iajrz: vanilla project uses jQuery, I'm guessing now.
[04:36:00] sevenseacat: I shudder to think what thats doing behind the scenes
[04:36:15] sevenseacat: yes, rails depends on jquery.
[04:36:17] pontiki: you can do that with rails new as well
[04:36:28] pawnbox: has joined #RubyOnRails
[04:36:59] iajrz: I think they're running rails new --skip-javascript
[04:37:10] pontiki: they will if you tell them to
[04:37:45] iajrz: aye, aye, I just - it was naivete. Good learning, though. I'd not have run accross the available frameworks if I'd not been poking around :)
[04:38:36] pontiki: stick to what the tutorial is telling you to do
[04:39:34] sevenseacat: on that note though, i thought the prototype rails helper was long since deprecated
[04:39:45] sevenseacat: so really what option is there other than jquery?
[04:40:32] iajrz: actually yes, I think
[04:40:54] iajrz: or it doesn't cry with invalid /javascript=react
[04:40:56] pontiki: RM does have react in the list, but i don't know how that would give Rails what it needs
[04:41:18] iajrz: I just ran it, looking at the files..
[04:41:36] iajrz: //= require react
[04:41:39] iajrz: in application.js
[04:41:43] iajrz: so I guess _something_ is there
[04:42:00] sevenseacat: there is no react rails helper
[04:42:01] iajrz: >>> and that was with rails new, not with the dialog
[04:44:19] kknight: has joined #RubyOnRails
[04:45:17] iajrz: correct - a side effect from that should be that when I create a model no js is injected into the view?
[04:45:37] hahuang62: has joined #RubyOnRails
[04:46:16] iajrz: as there is no react helper for rails
[04:46:22] iajrz: if I do rails new -j react
[04:46:52] sevenseacat: you will not have access to any Rails js-related functionality
[04:47:38] emachnic: has joined #RubyOnRails
[04:49:48] sevenseacat: hmm there does seem to be a react_ujs
[04:50:00] pontiki: just finding this out
[04:51:06] justrohu: has joined #RubyOnRails
[04:51:53] sevenseacat: I guess in theory react would work as a replacement for jquery then
[04:52:21] diegoaguilar: has joined #RubyOnRails
[04:52:59] yardenbar: has joined #RubyOnRails
[04:55:31] PotatoChipz: has joined #RubyOnRails
[04:59:52] pontiki: it does make sense, i suppose, same with the other majors
[05:00:43] pontiki: i've been mentally separating everything for past several projects, using rails as api driver only
[05:01:23] pontiki: but of course integrating react in rails is going to be a thing
[05:03:19] quazimodo: has joined #RubyOnRails
[05:05:01] swap_a_b: has joined #RubyOnRails
[05:06:07] alfiemax: has joined #RubyOnRails
[05:06:30] iajrz: has joined #RubyOnRails
[05:12:12] iajrz: has joined #RubyOnRails
[05:13:29] Oliphaunte: has joined #RubyOnRails
[05:16:49] swap_a_b: has left #RubyOnRails: ()
[05:16:57] triptec: has joined #RubyOnRails
[05:22:00] ych: has joined #RubyOnRails
[05:23:52] djbkd: has joined #RubyOnRails
[05:24:51] joowh85: has joined #RubyOnRails
[05:25:11] duncannz: has joined #RubyOnRails
[05:25:34] emilkarl: has joined #RubyOnRails
[05:29:01] ngw: has joined #RubyOnRails
[05:33:49] atm0sphere: has joined #RubyOnRails
[05:34:10] atm0sphere: any help to http://stackoverflow.com/questions/37935819/rails-page-is-reloading-even-after-setting-remote-true-in-form-tag
[05:37:44] abhilash: has joined #RubyOnRails
[05:38:07] abhilash: Hi Everyone,
[05:38:22] abhilash: I'm new to this group
[05:38:41] atm0sphere: just follow channel rules http://goo.gl/dgSj5
[05:38:45] atm0sphere: happy coding
[05:39:14] Radar: atm0sphere: remote: true is not an option that belongs in the html hash
[05:39:20] Radar: atm0sphere: it belongs outside of that, like url
[05:40:36] atm0sphere: m doing let me check Radar
[05:40:56] jtong: has joined #RubyOnRails
[05:42:56] rickmasta: has joined #RubyOnRails
[05:46:22] hahuang62: has joined #RubyOnRails
[05:46:41] atm0sphere: https://gist.github.com/aj07/ce387f58acd4ec6f1a6ca60d6fc72e15 radar it still shows error
[05:47:07] northfurr: has joined #RubyOnRails
[05:47:08] Radar: !didntwork
[05:47:08] helpa: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[05:49:01] apotry: has joined #RubyOnRails
[05:49:32] kknight: Radar: i have put my error as comment there
[05:49:35] gfvcastro: has joined #RubyOnRails
[05:49:40] Radar: oh it's you hiu
[05:49:59] Radar: <%= simple_form_for ([@store, @store.delivery_preferences.build])
[05:50:03] Radar: What's with the () brackets here?
[05:50:11] Radar: and the space after simple_form_for
[05:51:02] sevenseacat: yeah I remember this line of code from yesterday
[05:51:06] sevenseacat: is it going to the right controller now?
[05:51:31] kknight: without remote true its working properly
[05:54:44] kknight: https://gist.github.com/aj07/ce387f58acd4ec6f1a6ca60d6fc72e15 see last comment sevenseacat this form is working
[05:55:26] sevenseacat: by sheer fluke
[05:55:54] sevenseacat: the parens are obviously just getting ignored and not being used to wrap the args to simple_form_for
[05:58:21] pawnbox: has joined #RubyOnRails
[05:58:48] Radar: kknight: I don't think you need the `url` option there.
[05:59:31] kknight: it has to be there because it is rendered in different view page of some other controller
[06:01:38] Radar: But the first args to simple_form_for will tell it which controller to hi0t.
[06:07:25] Oliphaunte: has joined #RubyOnRails
[06:08:33] Niham: has joined #RubyOnRails
[06:11:17] pawnbox: has joined #RubyOnRails
[06:11:30] siaw23: has joined #RubyOnRails
[06:12:17] PlasmaStar: has joined #RubyOnRails
[06:14:30] emilkarl: has joined #RubyOnRails
[06:17:38] guidocalvano: has joined #RubyOnRails
[06:17:56] raunicolae: has joined #RubyOnRails
[06:18:13] raunicolae: has left #RubyOnRails: ()
[06:25:20] Elinos: has joined #RubyOnRails
[06:36:19] emachnic: has joined #RubyOnRails
[06:36:21] roamingdog: has joined #RubyOnRails
[06:36:23] conta: has joined #RubyOnRails
[06:38:21] der-landgraf: has joined #RubyOnRails
[06:40:41] guidocalvano: has joined #RubyOnRails
[06:44:18] skiz: has joined #RubyOnRails
[06:44:29] skiz: has left #RubyOnRails: ()
[06:48:41] Pazician: has joined #RubyOnRails
[06:48:41] Pazician: has joined #RubyOnRails
[06:49:08] AzaToth: has joined #RubyOnRails
[06:49:42] emiltin: has joined #RubyOnRails
[06:50:01] gingray: has joined #RubyOnRails
[06:51:04] User458764: has joined #RubyOnRails
[06:52:30] joowh85: has joined #RubyOnRails
[06:54:50] joowh85: has joined #RubyOnRails
[06:56:08] ur5us: has joined #RubyOnRails
[06:56:11] joowh85: has joined #RubyOnRails
[06:56:54] roamingdog: has joined #RubyOnRails
[06:56:56] GorillaApe: has joined #RubyOnRails
[07:01:49] Oliphaunte: has joined #RubyOnRails
[07:02:16] Niham_: has joined #RubyOnRails
[07:06:21] comrad: has joined #RubyOnRails
[07:06:47] dionysus69: has joined #RubyOnRails
[07:07:22] dmz: has joined #RubyOnRails
[07:09:45] SolarSailor: has joined #RubyOnRails
[07:11:01] guidocalvano: has joined #RubyOnRails
[07:11:53] siaw23: has joined #RubyOnRails
[07:14:03] Akuma0n3: has joined #RubyOnRails
[07:14:50] Voxxit: has joined #RubyOnRails
[07:15:15] yardenbar: has joined #RubyOnRails
[07:15:51] xall_: has joined #RubyOnRails
[07:17:55] jgt: has joined #RubyOnRails
[07:18:26] darutoko: has joined #RubyOnRails
[07:18:58] joowh85: has joined #RubyOnRails
[07:20:26] agit0: has joined #RubyOnRails
[07:23:01] adac: has joined #RubyOnRails
[07:23:06] antgel: has joined #RubyOnRails
[07:27:19] arBmind: has joined #RubyOnRails
[07:27:48] GorillaApe: is there a way to execute a thor command from ruby script?
[07:28:40] aganov: has joined #RubyOnRails
[07:28:52] alfiemax: has joined #RubyOnRails
[07:28:58] pontiki: i know i can invoke a thor command from inside a thor script...
[07:29:34] mikeyd: has joined #RubyOnRails
[07:30:01] mikeyd: Hello everyone
[07:30:21] pontiki: GorillaApe: assuming you don't mean by using backtick, system, etc ?
[07:31:03] GorillaApe: I just want to run them from a controller
[07:31:15] mikeyd: Does anyone here use devise ?
[07:31:22] sevenseacat: mikeyd: !anyone
[07:31:22] helpa: mikeyd: Nope. No one. Ever. In the history of the world.
[07:31:37] pontiki: GorillaApe: you could, i suppose, just treat them as any other shell command then
[07:32:07] mikeyd: Ok thanks anyways
[07:32:15] sevenseacat: mikeyd: just ask your question.
[07:32:48] pontiki: you may not want to call them directly from inside your controller, tho, in case they take a long time, or have some other things going on; you want your controllers to render back to you clients as soon as possible
[07:33:01] artto: has joined #RubyOnRails
[07:33:39] artto: has joined #RubyOnRails
[07:33:46] njero: has joined #RubyOnRails
[07:33:50] mikeyd: Well it's just a quick one. I was just wondering if it's better to use scoped or global devise views.
[07:34:14] sevenseacat: depends on the number of devise models
[07:34:17] GorillaApe: pontiki: yes but I have no other option
[07:34:21] sevenseacat: if you have more than one, chances are you will need scoped
[07:34:31] GorillaApe: I want to use datashift to export data
[07:34:41] Akuma0n3: has joined #RubyOnRails
[07:34:55] mikeyd: Ok. Thanks.
[07:35:41] pontiki: GorillaApe: just a suggestion, mate :)
[07:36:29] GorillaApe: I have bigger problem though.. Because they want to edit stuff through excel export and import
[07:36:33] GorillaApe: not through admin interface
[07:37:54] ur5us: has joined #RubyOnRails
[07:43:56] sevenseacat: so you build some excel import/export functionality. what does that have to do with thor?
[07:44:26] conta: is there way in minitest to compare objects? I have assert_equal cart_item.discount_service, DiscountCalculationService.new(@customer, cart_item), but it's false
[07:44:52] sevenseacat: compare what exactly?
[07:45:01] conta: i have then: -#<PriceCalculationService:0xXXXXXX @locale="cs", @vat=#<Vat id: 359, system_name: "lower_rate", percent: 15, coefficient: #<BigDecimal:7fd1bdc96b98,'0.1304E0',9(18)>, created_at: "2016-06-21 07:42:28", updated_at: "2016-06-21 07:42:28">>
[07:45:02] conta: +#<PriceCalculationService:0xXXXXXX @locale="cs", @vat=#<Vat id: 359, system_name: "lower_rate", percent: 15, coefficient: #<BigDecimal:7fd1bdbeffa0,'0.1304E0',9(18)>, created_at: "2016-06-21 07:42:28", updated_at: "2016-06-21 07:42:28">>
[07:45:14] pontiki: you may want to just compare attributes, conta, instead of the actual objects
[07:45:42] conta: I see, I was hoping for some easier solution ;]
[07:46:19] pontiki: you can write your own assertion, stick it in your test_helper.rb
[07:47:18] fermonkus: has joined #RubyOnRails
[07:47:23] gingray: has joined #RubyOnRails
[07:50:48] edwinvdgraaf: has joined #RubyOnRails
[07:50:58] ngw: has joined #RubyOnRails
[07:53:51] conta: so I decided to test it via checking that they hae same output on specific methods and inputs
[07:54:05] conta: attributes are not accesible
[07:54:06] GorillaApe: sevenseacat: Datashift gem uses that. But I think it might not be a solution for my problem
[07:55:50] mooru: has joined #RubyOnRails
[07:59:15] artto_: has joined #RubyOnRails
[08:00:32] Akuma0n3: has joined #RubyOnRails
[08:03:04] yfeldblum: has joined #RubyOnRails
[08:03:14] snoobydoo: has joined #RubyOnRails
[08:03:32] artto: has joined #RubyOnRails
[08:03:33] Pazician: has joined #RubyOnRails
[08:04:03] yfeldblum: has joined #RubyOnRails
[08:04:09] k3rn31: has joined #RubyOnRails
[08:04:34] adre: has joined #RubyOnRails
[08:06:51] jsrn: has joined #RubyOnRails
[08:06:58] Coldblackice: has joined #RubyOnRails
[08:07:14] lalalaaa: has joined #RubyOnRails
[08:09:04] kp666: has joined #RubyOnRails
[08:09:26] lalalaaa_: has joined #RubyOnRails
[08:11:26] AdamOnRails: has joined #RubyOnRails
[08:11:48] joowh85: has joined #RubyOnRails
[08:12:00] AdamOnRails: I'm having a slight issue with my model relationships
[08:12:25] AdamOnRails: if User habtm :sites, and Site habtm :users
[08:12:51] Hyuk: has joined #RubyOnRails
[08:12:51] AdamOnRails: I should be able to do: @user.sites.new(site_params).save, right?
[08:13:08] AdamOnRails: And that would then create the user/site record in the join table?
[08:13:44] AdamOnRails: Because it seems to be creating the site without a problem, but the join table remains empty
[08:14:10] sevenseacat: show us whats happening? :)
[08:14:10] edwinvdgraaf: has joined #RubyOnRails
[08:14:52] artto: has joined #RubyOnRails
[08:15:43] mr-spoon: has joined #RubyOnRails
[08:16:30] pawnbox: has joined #RubyOnRails
[08:18:04] Mia: has joined #RubyOnRails
[08:18:04] Mia: has joined #RubyOnRails
[08:18:05] AdamOnRails: http://pastie.org/private/kgvb6r6bq1lcsox03azoq
[08:18:06] guidocalvano: has joined #RubyOnRails
[08:22:02] Macaveli: has joined #RubyOnRails
[08:23:40] sevenseacat: that doesnt show us what happens when you call that action
[08:24:35] Sashimi_: has joined #RubyOnRails
[08:25:05] emachnic: has joined #RubyOnRails
[08:27:13] edwinvdgraaf: has joined #RubyOnRails
[08:29:58] edwinvdgraaf: has joined #RubyOnRails
[08:32:15] AimlessRAven: has joined #RubyOnRails
[08:32:30] AimlessRAven: hi all, i use feedjira gem to rss feed my blog. but i want to feed a signle item post
[08:32:40] AimlessRAven: hot to do that.. this post dont respond xml or json
[08:32:53] pawnbox: has joined #RubyOnRails
[08:32:53] AimlessRAven: i can fetch_and_parse only channel with all news, but i want single new
[08:32:59] tvw: has joined #RubyOnRails
[08:33:29] AdamOnRails: sevenseacat: http://pastie.org/private/7wtaj1ozh1um2tquwueq
[08:33:36] AdamOnRails: Not sure if thats the info you were chasing...
[08:34:41] alfiemax: has joined #RubyOnRails
[08:35:36] sevenseacat: try `build` instead of `new`
[08:37:48] AdamOnRails: Hmm, still nada.
[08:38:27] AdamOnRails: for what its worth, this ismy models..
[08:38:28] AdamOnRails: http://pastie.org/private/30lsk1rcefb6u5hywreya
[08:42:09] roamingdog: has joined #RubyOnRails
[08:42:32] tvw: has joined #RubyOnRails
[08:42:59] blackhuey: has joined #RubyOnRails
[08:45:00] Kedare: has joined #RubyOnRails
[08:47:18] sevenseacat: the guides say it should work. something else is going on.
[08:48:39] siaw23: has joined #RubyOnRails
[08:49:52] Oliphaunte: has joined #RubyOnRails
[08:50:39] sevenseacat: wondering if the weird @site[:valid_license] thing is breaking the link between the two models
[08:50:41] lxsameer: has joined #RubyOnRails
[08:50:45] sevenseacat: why not use a normal accessor?
[08:53:02] AmiMoench: has joined #RubyOnRails
[08:53:29] AdamOnRails: It's a boolean, Im trying to reduce the possibility that some smart arse could inject a "valid_licence = 1" into the mix.
[08:53:47] AdamOnRails: Having said that, I could just set it's default to false/0.
[08:53:56] sevenseacat: okay, so why not use a normal accessor like @site.valid_licence = 0
[08:54:30] AdamOnRails: oh you mean foo.bar as opposed to foo[:bar] ?
[08:54:44] AdamOnRails: not sure wy I do it that way, oldhabit?
[08:54:51] AdamOnRails: i'll try the fo.bar way
[08:55:12] yfeldblum: has joined #RubyOnRails
[08:55:22] AdamOnRails: in fact ill just comment it out for now to test
[08:55:49] AdamOnRails: That line is definitely breaking it some how.
[08:56:01] sevenseacat: ah hah. try changing it to be a normal accessor
[08:56:26] AdamOnRails: has joined #RubyOnRails
[08:56:36] AdamOnRails: hit the refresh button on the wrong page :P
[08:56:57] dionysus69: has joined #RubyOnRails
[08:57:06] AdamOnRails: But just used the normal accessor method and yep it works
[08:57:14] Spami: has joined #RubyOnRails
[08:57:18] AdamOnRails: Thakns for that :)
[08:57:32] AdamOnRails: now just need to go back through my other controller and change it to foo.bar
[09:03:16] raunico3: has joined #RubyOnRails
[09:06:37] snowy: has joined #RubyOnRails
[09:10:31] roamingdog: has joined #RubyOnRails
[09:10:39] Hyuk: has joined #RubyOnRails
[09:10:46] Mia: has joined #RubyOnRails
[09:11:43] quazimodo: I think I've violated demeter so many times it's gonna fall off soon :/
[09:11:48] norc: has joined #RubyOnRails
[09:11:51] quazimodo: this whole app is a string of dots
[09:12:05] quazimodo: i hate rushing
[09:12:18] joowh85: has joined #RubyOnRails
[09:14:47] lalalaaa: Hi! Trying to build a Twitter app based on https://github.com/tweetstream/tweetstream. But at http://www.rubydoc.info/gems/tweetstream/TweetStream/Client -- how would'd I go about ignoring retweets? Have tried http://pastie.org/10884990
[09:15:24] universa1: lalalaaa: and the output is what?!
[09:16:00] universa1: lalalaaa: o0 -- you are still getting retweets?
[09:16:26] lalalaaa: yep. just not sure how to exclude them.
[09:17:15] lalalaaa: wait, i'm gonna try them both again
[09:20:11] universa1: http://www.rubydoc.info/gems/tweetstream/TweetStream/Client#retweet-instance_method
[09:20:38] universa1: not sure your retweet(false) stuff is doing what you think it does. but then never used tweetstream...
[09:21:13] quazimodo: lalalaaa: the twitter gem i use has a flag for that
[09:22:38] lalalaaa: universa1: Just tested it -- doesn't work no
[09:22:46] lalalaaa: A retweet just came in :/
[09:23:05] lalalaaa: quazimodo: Nice. You're not using TweetStream?
[09:23:26] Sashimi_: has joined #RubyOnRails
[09:23:40] AdamOnRails: what the niceway to set a column default value when generating model migrations
[09:23:57] moei: has joined #RubyOnRails
[09:24:15] AdamOnRails: eg. rails generate model user name:string is_awesome:boolean
[09:24:20] njero: AdamOnRails, => deafault:
[09:24:35] yottanami: has joined #RubyOnRails
[09:24:40] njero: mean generator :P
[09:25:10] lalalaaa: universa1: pumpkindice suggested `.reject(&.retweeted) do |status|` but that resulted in `syntax error, unexpected '.'`
[09:25:12] AdamOnRails: can I set the default from the command line, or do I have to modify the miration?
[09:25:30] lalalaaa_: has left #RubyOnRails: ()
[09:26:51] edwinvdg_: has joined #RubyOnRails
[09:26:51] njero: is stackoverflow down?
[09:27:37] AdamOnRails: tiny bit slow but def not down..
[09:27:39] kitsuneyo: has joined #RubyOnRails
[09:27:40] lalalaaa: universa1: can't find none of those words in http://www.rubydoc.info/github/tweetstream/tweetstream/TweetStream though
[09:27:59] pawnbox: has joined #RubyOnRails
[09:30:05] quazimodo: lalalaaa: no i'm using the 'twitter' gem
[09:30:10] emiltin: has joined #RubyOnRails
[09:30:12] noodle: has joined #RubyOnRails
[09:32:13] lalalaaa: quazimodo: oh that one
[09:32:25] lalalaaa: universa1: getting `both block arg and actual block given (SyntaxError)` unfortunately
[09:33:34] quazimodo: i don't like how twitter only gives you 1 week's worth of tweets
[09:33:44] lalalaaa: quazimodo: whaat?
[09:34:00] lalalaaa: one week?!?
[09:35:43] arBmind: has joined #RubyOnRails
[09:41:35] lalalaaa: ACTION tries unless status.retweet
[09:42:02] andywww: has joined #RubyOnRails
[09:43:44] Oliphaunte: has joined #RubyOnRails
[09:44:46] Hyuk: has joined #RubyOnRails
[09:47:02] rbr: lalalaaa: you're missing a function-call after the reject to which you passs the block
[09:47:23] workmad3: has joined #RubyOnRails
[09:47:24] rbr: eg: "...).each do |status|"
[09:49:12] marr: has joined #RubyOnRails
[09:49:28] lalalaaa: rbr: where does reject come from? i can't find it in the docs
[09:50:04] universa1: rbr: reject is a ruby Enumerable method
[09:50:19] bruce_lee: has joined #RubyOnRails
[09:51:35] lalalaaa: rbr: this is more like it yea? TweetStream::Client.new.follow(14252, 53235).reject(&:retweeted).each do |status|
[09:52:00] t_p: has joined #RubyOnRails
[09:52:03] lalalaaa: and retweeted should be retweet
[09:52:18] roamingdog: has joined #RubyOnRails
[09:55:18] marr: has joined #RubyOnRails
[10:01:21] lalalaaa: rbr: i dont think there should be an each there considering it's a single stream of multiple twitter handles
[10:01:31] lalalaaa: i have no idea
[10:02:05] universa1: lalalaaa: you want to iterate over the tweets? that is what each does.
[10:03:39] AimlessRAven: can i use case statement in view
[10:04:01] universa1: AimlessRaven: why should you not be able to use it?
[10:04:05] subsonik: has joined #RubyOnRails
[10:05:31] lightt: has joined #RubyOnRails
[10:06:22] edwinvdgraaf: has joined #RubyOnRails
[10:06:33] mercerist: has joined #RubyOnRails
[10:07:24] lalalaaa: universa1: Yup, no i don't think i want to iterate over them. just somehow filter out the retweets. i've updated http://pastie.org/10885046 but still..
[10:09:55] mooru: has joined #RubyOnRails
[10:10:11] moeabdol: has joined #RubyOnRails
[10:10:18] Ergo: has joined #RubyOnRails
[10:15:50] cleopatra: has joined #RubyOnRails
[10:16:08] emiltin: has joined #RubyOnRails
[10:16:20] skroon: anyone know how I could combined multiples images (image/png data so not files on local drive) into a .pdf file? where each image is a page in the pdf?
[10:17:42] artto: has joined #RubyOnRails
[10:20:21] Niham: has joined #RubyOnRails
[10:21:55] Niham: has joined #RubyOnRails
[10:24:11] Niham: has joined #RubyOnRails
[10:24:27] marahin: What's the good approach to create a simple one-field search form, that searches for User by anything (so if someone types "test@example.com" it'd find a User with email like that, if someone types "John Cena" - it'd find John Cena by name, etc.)?
[10:25:05] marahin: as: is there any _marvelous_ solution for that (a gem perhaps), or should i define .search method myself that would simply iterate over fields & .where them with given attributes?
[10:26:07] Niham: has joined #RubyOnRails
[10:28:48] conta: has joined #RubyOnRails
[10:28:55] Ropeney: has joined #RubyOnRails
[10:29:20] dionysus69: does belongs_to work automatically or I have to create a column for the foreign key on the table which is belonging to another one?
[10:31:37] cleopatra: has joined #RubyOnRails
[10:31:38] wethu: dionysus69, You'll have to create the FK yourself, and then apply the belongs_to :association
[10:32:19] dionysus69: ok thanks wethu, and how does belongs_to know if the the column I created is for the foreign key?
[10:32:26] dionysus69: is there a naming convention I assume?
[10:32:27] wethu: pretty simple, just create another migration to add that column and migrate your db
[10:32:54] edwinvdgraaf: has joined #RubyOnRails
[10:32:56] PotatoChipz: has joined #RubyOnRails
[10:33:16] dionysus69: ok thanks wethu :)
[10:33:28] wethu: just put _id to the name of the model that it belongs to, in a singular form
[10:34:48] wethu: so if post has_many :comments, and comment belongs_to :post, then comment will have a post_id column
[10:35:19] wethu: no worries :)
[10:36:12] emiltin: has joined #RubyOnRails
[10:37:38] GodFather: has joined #RubyOnRails
[10:38:04] Oliphaunte: has joined #RubyOnRails
[10:39:00] DoubleMalt: has joined #RubyOnRails
[10:42:04] artto: has joined #RubyOnRails
[10:43:14] User458764: has joined #RubyOnRails
[10:44:01] d0nn1e: has joined #RubyOnRails
[10:44:12] artto: has joined #RubyOnRails
[10:44:27] dionysus69: one more thing wethu, should _id column contain null values or I have to manually set in values for corresponding rows of other model?
[10:47:40] wethu: dionysus69, that depends, is the association expected to be there always and required?
[10:48:28] wethu: well you can enforce FK constraints if you want, you would also validate the presence of it as well
[10:50:17] dionysus69: ok thanks again wethu :)
[10:50:45] wethu: if you're coming from an existing schema, and you have a model which has a table without this new association, and you're going to try and add the column (FK), then you'll have to do it in stages, should you choose to enforce constraints on the db
[10:51:07] edwinvdgraaf: has joined #RubyOnRails
[10:52:59] wethu: however this is optional, active record belongs_to associations will work without this, and validations on the model might be enough
[10:53:25] Dysp: has joined #RubyOnRails
[10:54:27] Dysp: Hi there. I was wondering of what importance it would be to write exceptions and such (I am new to it..) when dealing with a script to be run in Rails? I mean, if the program breaks, it won't affect the applikation, no?
[10:55:00] snowy: has joined #RubyOnRails
[10:55:17] dionysus69: Dysp: some functions are expected to fail, that's what you need exception for to know when it failed :)
[10:55:32] Dysp: Can you give me an example?
[10:56:30] dionysus69: not really, I never used exceptions :D
[10:57:37] fluxsource: has joined #RubyOnRails
[10:58:32] Dysp: Haha, alright ^^
[10:58:36] sevenseacat: "expected to fail" what?
[10:59:41] sevenseacat: if the program breaks, your users can get error messages, your data can be left in an inconsistent state, you could be left with security holes, all kinds of things
[11:00:06] rickmasta: has joined #RubyOnRails
[11:00:36] dionysus69: I meant sometimes you know function is going to fail :D so instead of breaking the app it would just throw exception which would be also expected from a caller function :P
[11:00:52] dionysus69: thats how I see the role of exceptions
[11:00:58] sevenseacat: why would you ever call something that you know will fail?
[11:01:06] sevenseacat: that doesnt make any sense
[11:01:28] rodfersou: has joined #RubyOnRails
[11:01:38] dionysus69: ye but variables change and something you are passing in might not satisfy function for example
[11:02:00] sevenseacat: whats that got to do with 'you know its going to fail'
[11:02:08] mikecmpbll: has joined #RubyOnRails
[11:02:54] dionysus69: I didn't mean 100% :D I mean't like during full cycle of the app :) it will work for 99 cases and might fail for 1 but you know that 1 might happen depending on chance?
[11:03:05] sevenseacat: exceptions are quite the opposite - they're used for unexpected failures. if you expect something to always succeed, and for some reason it doesnt, then thats when you throw an exception, because its not safe to continue
[11:03:15] sevenseacat: dionysus69: no, i dont know what you're talking about.
[11:03:38] dionysus69: haha ok dunno me neither was just guessing :D
[11:03:42] triptec_: has joined #RubyOnRails
[11:03:53] sevenseacat: dionysus69: i suggest not doing that when you're trying to give people advice.
[11:03:53] dionysus69: I am pretty sure you are right :D
[11:04:19] sevenseacat: dionysus69: i suggest *very strongly* not giving people advice if you don't have a clue what you're talking about.
[11:04:43] dionysus69: ok sorry Dysp
[11:05:47] Dysp: No worries, bro :)
[11:06:23] Dysp: But, sevenseacat, my question was more in the sense of the big picture with a rails app.
[11:06:37] sevenseacat: its the same logic.
[11:06:55] Dysp: If I have a script that takes input from an user, excel sheet, and for some reason this is set with the wrong extension or so; what will happen? Will the whole applikation break?
[11:07:19] sevenseacat: depends what code you've written to handle a wrong extension
[11:07:21] mercerist: has joined #RubyOnRails
[11:07:34] Dysp: I have no code to handle any exceptions.
[11:07:51] Dysp: I also don't have a rails app yet; I am just trying to prepare myself and the script I've written to be implemented in rails.
[11:07:56] sevenseacat: if you write code that expects an excel spreadsheet and assumes it will always be given one, i expect many errors to be generated if you give it something different
[11:08:05] Dysp: I am seeking advice on what to focus on.
[11:08:11] sevenseacat: and if the user ever sees an error, it means you as the developer stuffed up
[11:08:58] sevenseacat: focus on what you know the different scenarios are. exceptions are for truly exceptional circumstances, ie. you tried to write a file and the disk was full or something
[11:09:16] mercerist: has joined #RubyOnRails
[11:09:18] sevenseacat: if different things can happen in your app based on different inputs, thats normal, thats not exceptional
[11:10:52] mikecmpbll: i'm exceptional.
[11:11:06] Dysp: Okay. I should instead focus what could go wrong and myself tell em there is something wrong, not raise an exception
[11:11:11] Dysp: Of course you are, mikecmpbll.
[11:11:44] pawnbox: has joined #RubyOnRails
[11:11:53] sevenseacat: exactly. if the user uploads a pdf instead of a spreadsheet, tell them that and let them try again
[11:12:29] kitsuneyo: has joined #RubyOnRails
[11:12:33] sevenseacat: you won't find many exceptions used in Rails apps - the most common you'll likely see is ActiveRecord::RecordNotFound
[11:12:49] Dysp: Alrighty, alrighty. Coolio.
[11:13:03] sevenseacat: authorisation gems usually provide a main one as well, for when user authorisation fails and you want to back out and not go any further
[11:13:19] umdstu: has joined #RubyOnRails
[11:13:23] umdstu: has left #RubyOnRails: ()
[11:15:59] umdstu: has joined #RubyOnRails
[11:16:35] King_Rex: has joined #RubyOnRails
[11:16:50] umdstu: i’m getting a method undefined method `each’ for nil:NilClass when inspecting an object. can’t seem to make sense of it
[11:16:56] rickmasta: has joined #RubyOnRails
[11:17:06] mikecmpbll: umdstu : NilClass doesn't have an each method.
[11:18:42] Dysp: umdstu: Somewhere in your program your data is lost and you are left with a nil object. And as mikecmpbll says, there are no method for nil-objects with the name of "each".
[11:18:53] umdstu: that’s the problem. i’m not calling it on nil.
[11:18:59] mikecmpbll: umdstu : you are! :)
[11:19:00] Dysp: But you are.
[11:19:16] sevenseacat: you are indeed.
[11:19:17] Dysp: Hence, look into what feeds the object you are trying to call it on.
[11:19:22] sevenseacat: code doesn't lie!
[11:19:39] Dysp: Unless you make it lie.
[11:19:43] mikecmpbll: i lie all the time, but the code never stoops to my level. i respect that.
[11:19:54] wethu: the most awesomely annoying thing about machines, is they're never wrong
[11:19:57] umdstu: alright try to explain again, and if i’m still wrong, i’ll break it
[11:20:15] mikecmpbll: umdstu : code + trace > 1million words
[11:20:28] Dysp: How new are you to coding, umdstu ?
[11:20:28] mikecmpbll: a picture is only better than 1000.
[11:21:29] sevenseacat: umdstu: show us your code? :)
[11:21:39] umdstu: i have an object, `#<Result fields=[{…..>` . puts object.class yields `Result`. puts object.inspect prints object. puts object.fields yields nil error
[11:21:54] sevenseacat: ...show us your code? :)
[11:22:02] wethu: gist is great
[11:22:03] umdstu: sure i’ll try to retype it
[11:22:05] sevenseacat: show us the console log of what you're doing, for example
[11:22:12] wethu: no no, just copy paste
[11:22:17] Dysp: Don't make fun of him, guys ^^
[11:22:22] helpa: Dysp: We're not all guys here - while you probably don't meant to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
[11:22:26] umdstu: go ahead and make fun
[11:22:30] umdstu: code is on different network
[11:22:34] umdstu: literally cannot copy or past
[11:22:46] wethu: ACTION is vim user
[11:22:46] Dysp: Guys is not implicitly boys.
[11:22:57] sevenseacat: Dysp: again, not everyone feels that way.
[11:22:57] Dysp: Guys can also be used for "folks" or such.
[11:23:07] mikecmpbll: Dysp : don't even bother. someone decided one time that that was the rule, it's futile arguing. i've tried
[11:23:21] Dysp: I will concede the discussion then.
[11:23:29] mikecmpbll: a part of me dies everytime i have to concede to it, but that's life.
[11:23:30] sevenseacat: it's really not up for debate whether 'guys' is a masculine term or not, sorry.
[11:23:33] sevenseacat: just letting you know :)
[11:23:34] Dysp: If I call you bitches..
[11:23:42] mikecmpbll: it really is up for debate, but not here.
[11:23:43] Dysp: Wont go there.
[11:23:43] sevenseacat: Dysp: then you will get banned.
[11:24:02] Dysp: I call my friends bitches all the time.
[11:24:04] Dysp: Oh well, back to umdstu
[11:24:08] sevenseacat: good to know. we're not your friends.
[11:24:21] Dysp: You are just a friend I haven't met yet!
[11:24:34] sevenseacat: and if you call me a bitch, you'll know about it.
[11:24:39] sevenseacat: can we move on now?
[11:24:57] Dysp: Okay, calm down. Don't take things too seriously with me.
[11:25:01] mikecmpbll: ACTION moves on
[11:25:04] umdstu: so… even if i dont try to output the object, if i simply call `if fields` in the model class, it throws that nil error
[11:25:15] sevenseacat: umdstu: again, can you show us your code?
[11:25:19] mikecmpbll: it's on another network!
[11:25:27] sevenseacat: we really don't know what you're looking at
[11:25:32] umdstu: sure give me another moment to type something up
[11:25:43] Dysp: Dont type. Paste to gist.
[11:25:59] Dysp: https://gist.github.com/
[11:26:16] wethu: umdstu, It's going to be impossible for anyone here to help, not because we haven't seen how you're calling your code, but because we don't know anything about the context that you have. The best way for us to get this context is to show us a trace/calll stack when the error happens, and the code that caused it :)
[11:27:04] Dysp: I can already now tell you that your problem is not the code that includes the .each, but something before that. The trace wethu talks about.
[11:27:29] umdstu: folks, i realize that
[11:27:44] umdstu: but 100% context cannot be obtained unfrotunately since I can’t type all the code
[11:27:50] umdstu: or rather, paste it
[11:27:52] mikecmpbll: line 27, i reckon.
[11:28:03] Dysp: Okay, why not?
[11:28:14] umdstu: Dysp: it’s on another network
[11:28:14] Macaveli: has joined #RubyOnRails
[11:28:21] umdstu: i said this
[11:28:24] Dysp: Eh, okay. Sorry.
[11:28:33] Dysp: But how would you then fix it?
[11:28:43] umdstu: i’m on that network
[11:28:49] umdstu: that network != this network
[11:28:56] Dysp: I.. I.. eh..
[11:29:13] wethu: so even if we tell you how to fix it, you can't edit the code to fix it?
[11:29:25] Dysp: So, your network is offline and you are sitting on ze web on another computer?
[11:29:28] umdstu: wethu: no, i just said i’m on that network
[11:29:34] mikecmpbll: he's on the other network.
[11:29:36] Dysp: There you go.
[11:29:46] Dysp: USB drives ftw.
[11:29:51] Dysp: Okay, the best I can do:
[11:29:56] umdstu: i’d rather keep my job :)
[11:30:04] guidocalvano: has joined #RubyOnRails
[11:30:06] emiltin: has joined #RubyOnRails
[11:30:14] umdstu: so, i’m not actually to the point in which .each is called… by me
[11:30:29] umdstu: i simply have ‘if fields’ and it calls the .each nil class error
[11:30:42] umdstu: s/calls/throws/
[11:30:51] Dysp: You are calling .each method on nil, because the object you are calling on contains nil and not what you expect it to do. Trace the path down and see where the object is coming from and find out why it is nil.
[11:32:49] sevenseacat: so what is fields and how is it defined?
[11:32:50] umdstu: here’s the object… `#<Result fields=[{…..>` … `if fields` throws undefined method each for nil. fields is clearly there. its an array
[11:33:05] sevenseacat: fields != result.fields
[11:33:07] umdstu: Result is a recursiveopenstruct
[11:33:15] umdstu: sevenseacat: i’m in result.rb
[11:33:34] umdstu: so it does, no?
[11:33:39] sevenseacat: umdstu: you are making this much more difficult than it needs to be
[11:34:08] umdstu: i think my circumstances are making it more difficult. i’m trying my best. i’m open to suggestions though :)
[11:34:21] sevenseacat: if you can't show the code, you need to hire a consultant or something to help you.
[11:34:25] sevenseacat: because we cannot.
[11:34:27] mikecmpbll: when you type the code up, how are you knowing what the code is to type up
[11:34:36] mikecmpbll: did you memorise the code some time ago?
[11:34:36] Hates_: has joined #RubyOnRails
[11:35:01] Dysp: mikecmpbll: He is probably looking at the other screen.
[11:35:08] arup_r: has joined #RubyOnRails
[11:35:29] acalewin: has joined #RubyOnRails
[11:35:31] mikecmpbll: oh okay, like that. not connected to the interwebs?
[11:35:35] ldnunes: has joined #RubyOnRails
[11:35:49] barttenbrinke: has joined #RubyOnRails
[11:36:14] srinidhi: has joined #RubyOnRails
[11:36:15] mdw: has joined #RubyOnRails
[11:36:27] Ropeney: has joined #RubyOnRails
[11:36:39] umdstu: mikecmpbll: ^
[11:36:44] umdstu: here’s a snippet
[11:36:45] umdstu: https://gist.github.com/umdstu/7b9453bf0b8d1242ac74ca26198cfa7b
[11:36:45] mikecmpbll: yes it is, or yes it's not?
[11:36:57] umdstu: yes its not connected to the intertubes
[11:37:20] sevenseacat: okay, so whats a RecursiveOpenStruct?
[11:37:40] umdstu: http://www.rubydoc.info/github/opower/clean_config/RecursiveOpenStruct sevenseacat
[11:37:41] agit0: has joined #RubyOnRails
[11:38:15] sevenseacat: okay. so where are you getting this nil error?
[11:38:47] sevenseacat: show us whats going on.
[11:39:00] wethu: I think he said here: https://gist.github.com/umdstu/7b9453bf0b8d1242ac74ca26198cfa7b#file-result_event_helper-rb-L7
[11:39:09] wethu: which means fields is nil right now
[11:39:10] umdstu: NoMethodError (undefined method `each’ for nil:NilClass): app/models/result_event_helper.rb:5
[11:39:19] mikecmpbll: wethu : see if statement 2 lines above.
[11:39:20] armyriad: has joined #RubyOnRails
[11:39:23] sevenseacat: that doesnt tell us much
[11:39:33] sevenseacat: line 5 doesnt call each
[11:39:43] sevenseacat: so please try again
[11:40:03] mikecmpbll: wat is fields
[11:40:06] umdstu: thats the confusing part… it must be something inside RecursiveOpenStruct
[11:40:12] sevenseacat: either the code isnt what you said it is, or the error isnt what you said it is, or there's something in this RecursiveOpenStructthat isnt what you think it is
[11:40:12] shinnya: has joined #RubyOnRails
[11:40:28] sevenseacat: and we have no way of knowing because you arent giving us any information
[11:41:16] helpa: Sorry, we are unable to read your mind at this time. Please gist (http://gist.github.com) your code and any relevant stacktrace so we can assist you.
[11:41:18] sevenseacat: that class you linked to is a monkey patch on RecursiveOpenStruct, it doesnt say what it actually is
[11:42:09] umdstu: https://rubygems.org/gems/recursive-open-struct/versions/1.0.1 a better link?
[11:42:20] sevenseacat: well, a different link
[11:42:32] sevenseacat: if you think its a problem with the gem, please file an issue with the gem
[11:43:16] umdstu: i just updated the gist to where i put the log statement. that log statement, as i mentioned earlier, is…. `#<Result fields=[{“Value”…}]`
[11:43:31] umdstu: so fields is there
[11:43:37] umdstu: and its an array
[11:43:51] rbr: lalalaaa universa1: there was a second block being passed so I assumed there was some secondary processing to be done after the reject ;)
[11:44:09] mikecmpbll: that's logging self, not fields.
[11:44:27] umdstu: if i log fields, i get the each nil error
[11:44:28] mikecmpbll: so that doesn't help terribly.
[11:44:33] mikecmpbll: ACTION facepalms
[11:44:55] mikecmpbll: umdstu : fields, sir, is a method which calls each on nil.
[11:45:06] sevenseacat: umdstu: please find someone you can show the code to, and get them to help you.
[11:45:10] rbr: lalalaaa: the follow-emthod accepts a block, that;s where the 'do |status|'comes from: https://github.com/tweetstream/tweetstream/blob/27c5f411627dc30ce1268923fc9b408652f98050/lib/tweetstream/client.rb#L109
[11:45:41] rbr: and why reject appears to 'work'
[11:46:08] jtong: has joined #RubyOnRails
[11:47:08] umdstu: mikecmpbll: sevenseacat thanks for trying
[11:47:54] emiltin: has joined #RubyOnRails
[11:48:38] rodferso1: has joined #RubyOnRails
[11:48:56] kknight: has joined #RubyOnRails
[11:49:01] ldnunes_: has joined #RubyOnRails
[11:53:26] jord-n: has joined #RubyOnRails
[11:54:15] srinidhi: has joined #RubyOnRails
[11:55:18] gheegh: has joined #RubyOnRails
[11:57:31] bonswouar: has joined #RubyOnRails
[11:58:28] wethu: umdstu, is it your intent here: https://gist.github.com/umdstu/7b9453bf0b8d1242ac74ca26198cfa7b#file-result-rb-L5 to set map with https://gist.github.com/umdstu/7b9453bf0b8d1242ac74ca26198cfa7b#file-result_event_helper-rb-L3 ?
[11:59:14] chimkan: has joined #RubyOnRails
[11:59:31] wethu: the method names are different
[12:00:04] fmcgeough: has joined #RubyOnRails
[12:01:28] agit0: has joined #RubyOnRails
[12:01:45] raunico3: has left #RubyOnRails: ("Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is")
[12:02:27] haaj: has joined #RubyOnRails
[12:02:32] quazimodo: has joined #RubyOnRails
[12:03:08] pawnbox: has joined #RubyOnRails
[12:03:50] haaj: has joined #RubyOnRails
[12:04:21] k3rn31: has joined #RubyOnRails
[12:07:07] artto_: has joined #RubyOnRails
[12:07:28] skroon: anyone know if a RMagick::ImageList can also read png data directly? else I need to temporarily save it to disk, which I was hoping to omit
[12:12:11] jmignault: has joined #RubyOnRails
[12:12:14] Ropeney: has joined #RubyOnRails
[12:13:52] neha-: has joined #RubyOnRails
[12:14:55] emilkarl: has joined #RubyOnRails
[12:16:36] Detch: has joined #RubyOnRails
[12:18:18] alfiemax: has joined #RubyOnRails
[12:20:16] allcentury: has joined #RubyOnRails
[12:28:00] GodFather: has joined #RubyOnRails
[12:28:06] slothbear: has joined #RubyOnRails
[12:28:43] mikecmpbll: anyone who uses openstack object storage, how do you do point-in-time backups?
[12:29:17] gfvcastro: has joined #RubyOnRails
[12:31:00] umdstu: wethu: yes, as you no doubt know, this why typing gist code is bad. :/
[12:33:33] edwinvdg_: has joined #RubyOnRails
[12:33:59] Sashimi_: I've been told RoR is a good thing to learn
[12:34:15] Sashimi_: I don't know ruby
[12:34:30] mikecmpbll: Sashimi_ : cool
[12:34:36] Sashimi_: what should I do ? (and in what steps)
[12:34:45] helpa: http://guides.rubyonrails.org/ - Ruby on Rails guides. Recommended reading.
[12:36:45] mikecmpbll: get to grips with the ruby language syntax and basic constructs and patterns first though.
[12:37:58] sevenseacat: step 1 - learn Ruby.
[12:38:00] helpa: Learn Ruby by reading this book - http://manning.com/black3 - The Well-Grounded Rubyist by David A. Black
[12:42:10] lalalaaa: quazimodo: isnt the twitter gem deprecated?
[12:42:16] kitsuneyo: has joined #RubyOnRails
[12:42:47] pawnbox: has joined #RubyOnRails
[12:44:43] lalalaaa: rbr: I see, but where should I put the reject then? If not `TweetStream::Client.new.follow(14252, 53235).reject(&:retweet) do |status|` or `unless status.retweet`?
[12:46:37] lalalaaa: rbr: Or should I override that `follow` method?
[12:46:48] lalalaaa: I'm in a maze
[12:47:39] Rodya_: has joined #RubyOnRails
[12:52:58] Sashimi_: mikecmpbll ▸ thx mate
[12:56:03] bbrowning: has joined #RubyOnRails
[12:56:23] Elinos: has joined #RubyOnRails
[12:59:04] fermonkus: has joined #RubyOnRails
[13:04:33] artto: has joined #RubyOnRails
[13:04:50] jgt1: has joined #RubyOnRails
[13:09:01] mshowman: has joined #RubyOnRails
[13:10:46] Macaveli: has joined #RubyOnRails
[13:12:26] gfvcastro: has joined #RubyOnRails
[13:13:16] Oliphaunte: has joined #RubyOnRails
[13:13:34] SirOliver: has joined #RubyOnRails
[13:13:41] dblessing: has joined #RubyOnRails
[13:14:54] edwinvdgraaf: has joined #RubyOnRails
[13:17:13] Signum: I'd like to cache certain URL paths (e.g. /about/statistics) in a deployment of nginx + passenger. However proxy_cache does nothing - probably because I'm not really using nginx as a reverse proxy.
[13:17:30] Signum: Is there a way to use caching in nginx? Or do I have to use something like fragment caching within Rails?
[13:17:49] pawnbox: has joined #RubyOnRails
[13:17:52] Elinos: has joined #RubyOnRails
[13:18:12] edwinvdgraaf: has joined #RubyOnRails
[13:19:47] aegis3121: has joined #RubyOnRails
[13:19:59] gfvcastro: has joined #RubyOnRails
[13:23:22] GodFather_: has joined #RubyOnRails
[13:25:53] pawnbox: has joined #RubyOnRails
[13:29:13] chintanparikh: has joined #RubyOnRails
[13:29:21] nettoweb: has joined #RubyOnRails
[13:32:05] edwinvdgraaf: has joined #RubyOnRails
[13:35:46] rbr: lalalaaa: I'm not sure. Is there even a way to know if a tweet is a retweet?
[13:36:24] rbr: lalalaaa: concerning retweets, as linked before, there is only a method to return all retweets
[13:37:12] VeryBewitching: has joined #RubyOnRails
[13:38:25] qejk: has joined #RubyOnRails
[13:38:56] eljimmy: has joined #RubyOnRails
[13:40:20] dblessing: has joined #RubyOnRails
[13:40:59] pawnbox: has joined #RubyOnRails
[13:41:02] rubyonrails758: has joined #RubyOnRails
[13:41:10] rubyonrails758: Guys, I need help
[13:41:12] rubyonrails758: http://stackoverflow.com/questions/37945850/actioncontrollerinvalidauthenticitytoken-error-in-controller
[13:42:46] pontiki: has joined #RubyOnRails
[13:43:14] macsteps: has joined #RubyOnRails
[13:43:28] skroon: i'm using Tempfile, but it looks like the file doesn't exist anymore, even though i'm not using Tempfile.unlink, anyone know if Tempfile also removes a file in different circumstances?
[13:43:54] yellow5: has joined #RubyOnRails
[13:44:10] mikecmpbll: skroon : if the tempfile is closed, don't rely on it existing
[13:44:27] hinbody: has joined #RubyOnRails
[13:44:47] pontiki: it automatically gets unlinked when the object is garbage collected
[13:45:11] mikecmpbll: ah yeah, makes sense.
[13:47:16] lalalaaa: rbr: Well, it has the word "RT" in it
[13:47:26] artto: has joined #RubyOnRails
[13:47:33] jtong: has joined #RubyOnRails
[13:47:37] lalalaaa: rbr: I can't foresee any cases where RT would be used other than that (ie. Russia Today) :-)
[13:47:47] mercerist: has joined #RubyOnRails
[13:48:37] rbr: lalalaaa: Where? In the status/message itself?
[13:48:37] skroon: mikecmpbll: thanks
[13:48:47] haaj: has joined #RubyOnRails
[13:49:13] rbr: lalalaaa: Can't you use that for filtering them then?
[13:49:20] lalalaaa: rbr: So maybe `if status.text === regex to match RT`?
[13:49:30] lalalaaa: rbr: I guess I could, but it seems kinda dirty
[13:50:31] rbr: lalalaaa: I very much agree, but other options seems to lack :P
[13:50:54] rbr: s/seems/seem/
[13:51:40] lalalaaa: rbr: So just a simple `if status.include? "RT"` then?
[13:52:20] rbr: lalalaaa: Does it always appear at the same location within the string?
[13:52:44] lalalaaa: rbr: Always in the beginning
[13:53:15] insanedreamer: has joined #RubyOnRails
[13:53:24] lalalaaa: rbr: you mean like `if status.include? /^RT/`?
[13:53:28] lalalaaa: not even sure if that's valid but
[13:54:21] dblessing: has joined #RubyOnRails
[13:54:33] rbr: lalalaaa: Lookup .start_with?
[13:54:42] sergio_101: has joined #RubyOnRails
[13:54:47] rbr: Or .starts_with? if you're within Rails
[13:55:51] User458764: has joined #RubyOnRails
[13:56:01] joowh85: has joined #RubyOnRails
[13:56:16] northfurr: has joined #RubyOnRails
[13:56:41] macsteps: has joined #RubyOnRails
[13:56:59] rbr: A regex wouldn't be wrong, but this is probably more clear/optimized.
[13:57:46] Wolfram74: has joined #RubyOnRails
[13:58:31] Wolfram74: Ok, I'm hoping to get a second perspective on this documentation https://github.com/plataformatec/devise/wiki/How-To:-Define-resource-actions-that-require-authentication-using-routes.rb
[13:58:35] Wolfram74: and https://github.com/plataformatec/devise/wiki/How-To:-Test-controllers-with-Rails-3-and-4-(and-RSpec)
[13:59:00] Wolfram74: the first documentation describes how to specify routes as authenticated or not in devise, either in routes.rb, or in foobar_controller.rb
[14:00:18] Wolfram74: the second describes testing said routes, and the take-away I got is that if you specify a route is authenticated in routes.rb you'll be unable to test in rspec that it behaves like you want
[14:00:30] lalalaaa: rbr: indeed, i like your approach, let me try that
[14:03:19] Oliphaunte: has joined #RubyOnRails
[14:04:19] sdwrage: has joined #RubyOnRails
[14:05:22] DoctorMonocular: has joined #RubyOnRails
[14:05:50] rueben: has joined #RubyOnRails
[14:06:31] mwlang: is there a helper for timestamps that can tell if time is 00:00:00 and display just the date part and not date + time?
[14:06:59] pontiki: rbr: fyi, String#start_with? is in core Ruby
[14:09:14] dblessing: has joined #RubyOnRails
[14:10:48] jtong: has joined #RubyOnRails
[14:12:37] Oliphaunte: has joined #RubyOnRails
[14:13:10] Detch: has joined #RubyOnRails
[14:13:46] dblessing: has joined #RubyOnRails
[14:14:42] dblessing: has joined #RubyOnRails
[14:17:09] techsethi: has joined #RubyOnRails
[14:17:44] mdw: has joined #RubyOnRails
[14:17:59] joowh85: has joined #RubyOnRails
[14:18:58] k3rn31: has joined #RubyOnRails
[14:19:02] dblessing: has joined #RubyOnRails
[14:20:16] TvL2386: has joined #RubyOnRails
[14:20:23] fox_mulder_cp: hi. i have a API from powerdns located here https://doc.powerdns.com/md/httpapi/README/
[14:20:44] fox_mulder_cp: and i have a bash command curl -sX PATCH --data "${json}" -H "X-API-Key: ${pdns_api_key}" http://${pdns_host}:${pdns_port}/servers/localhost/zones/${domain}
[14:21:18] fox_mulder_cp: i already have a json, but can't think how to do it with Net::HTTP::Post.new
[14:21:39] fox_mulder_cp: mix api key into headers
[14:22:59] agent_white: has joined #RubyOnRails
[14:23:07] fox_mulder_cp: my docker connector don't need headers...
[14:24:01] dblessing: has joined #RubyOnRails
[14:25:07] sypheren: has joined #RubyOnRails
[14:25:42] sypheren: has joined #RubyOnRails
[14:27:36] M-shine: has joined #RubyOnRails
[14:27:43] maxx88: has joined #RubyOnRails
[14:28:51] techsethi: has joined #RubyOnRails
[14:30:32] chintanparikh: has joined #RubyOnRails
[14:31:10] rbr: pontiki: But starts_with? isn't. Notice the extra s ;)
[14:33:47] macsteps: has joined #RubyOnRails
[14:34:24] arup_r: has joined #RubyOnRails
[14:35:16] arup_r: What is the best way to feed such multiline SQL to the `copy` command any idea? Right now it is broken https://gist.github.com/aruprakshit/3d8316f98603281e727b56adf69d49d0
[14:36:12] bonswouar: has joined #RubyOnRails
[14:36:44] allcentury: has joined #RubyOnRails
[14:37:32] dblessing: has joined #RubyOnRails
[14:37:44] User458764: has joined #RubyOnRails
[14:39:41] rbr: arup_r: If newlines are the issue, it might help to \escape each line-end
[14:40:36] rbr: Not sure how that behaves within a heredoc though
[14:41:48] gfvcastro: has joined #RubyOnRails
[14:42:41] SteenJobs: has joined #RubyOnRails
[14:42:44] arup_r: it is hard that way, I am searching good GUI tool which will allow me to run log SQl like this.
[14:42:52] arup_r: thanks rbr though
[14:44:22] SteenJobs: hey all - our designer has a video on loop set as the background for our home/splash page, but when the page first loads, the video lags behind the rest of the page’s content long enough to be noticeable (page loads, gray background, and then video appears). i presume this is because the video needs to be fetched from the AWS url…how can i fix this, or at least make the lag less noticeable?
[14:44:42] prithaj: has joined #RubyOnRails
[14:45:05] dblessing: has joined #RubyOnRails
[14:45:31] roamingdog: has joined #RubyOnRails
[14:46:00] polishdub: has joined #RubyOnRails
[14:46:21] adavia: has joined #RubyOnRails
[14:47:25] ankhers: If I have a user that has many companies, and a company belongs to a user. I can user company.build_user to create a user on that company. What would the inverse function be? user.build_company doesn't work.
[14:47:46] ankhers: s/I can user/I can use/
[14:47:56] roamingdog: has joined #RubyOnRails
[14:48:45] SteenJobs: Ankhers: user.company.build
[14:49:04] ankhers: SteenJobs:Thanks!
[14:49:15] yardenbar: has joined #RubyOnRails
[14:49:39] fermonkus: has joined #RubyOnRails
[14:49:52] rbr: .companies.build I reckon ;)
[14:50:07] ankhers: Yes, I translated that. Thanks though.
[14:51:23] crystal77: has joined #RubyOnRails
[14:51:29] zave: has joined #RubyOnRails
[14:51:47] SteenJobs: ha yea, sorry ^
[14:52:00] rbr: Ankhers: Cool. These docs might be handy for future reference to see what the posibilites are: http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#method-i-has_many
[14:52:38] ankhers: rbr: Thanks. I'll take a look through.
[14:53:04] SirOliver: has joined #RubyOnRails
[14:53:39] artto: has joined #RubyOnRails
[14:54:01] sergio_101: has joined #RubyOnRails
[14:55:20] Macaveli: has joined #RubyOnRails
[14:56:25] xpl0iter: has joined #RubyOnRails
[14:58:00] xpl0iter: Hi, I am getting the instance variables in the showplas.html.erb file, but when I try to access it from foobar.js.erb I can't. its showing nilClass nil. Can someone please tell me why this happens?
[14:58:05] diegoaguilar: has joined #RubyOnRails
[14:58:06] Oliphaunte: has joined #RubyOnRails
[14:59:28] tego101: has joined #RubyOnRails
[15:02:07] aegis3121: has joined #RubyOnRails
[15:02:55] |2321: has joined #RubyOnRails
[15:04:12] ankhers: xpl0iter: IRC isn't really an on demand chat / help platform. People will answer when they see your message if they know the issue.
[15:04:27] ankhers: With that said, are those files being generated within the same request?
[15:06:22] Ergo: has joined #RubyOnRails
[15:06:31] artto: has joined #RubyOnRails
[15:08:45] Dimik: has joined #RubyOnRails
[15:09:27] SirOliver: has joined #RubyOnRails
[15:11:02] safetypin: has joined #RubyOnRails
[15:12:01] SirOliver: has joined #RubyOnRails
[15:12:29] subsonik: has joined #RubyOnRails
[15:12:29] Akuma: has joined #RubyOnRails
[15:12:55] disgrntld: has joined #RubyOnRails
[15:13:22] SteenJobs: anyone have any preferred e-commerce engines? we need to build a ‘store’ type layer to our platform as fast as possible
[15:18:02] rogue_koder: has joined #RubyOnRails
[15:18:03] yellow5: has joined #RubyOnRails
[15:23:51] rafaelfranca: has joined #RubyOnRails
[15:23:54] rafaelfranca: has joined #RubyOnRails
[15:24:29] roamingdog: has joined #RubyOnRails
[15:29:36] dionysus69: has joined #RubyOnRails
[15:30:48] roamingdog: has joined #RubyOnRails
[15:32:11] greghoggard: has joined #RubyOnRails
[15:33:04] chintanparikh: has joined #RubyOnRails
[15:33:11] greghogg_: has joined #RubyOnRails
[15:33:30] subsonik: has joined #RubyOnRails
[15:34:36] greghoggard: has joined #RubyOnRails
[15:35:33] gfvcastro: has joined #RubyOnRails
[15:35:46] allcentury: has joined #RubyOnRails
[15:37:12] Ergo: has joined #RubyOnRails
[15:39:58] SirOliver: has joined #RubyOnRails
[15:41:25] marr: has joined #RubyOnRails
[15:41:33] subsonik: has joined #RubyOnRails
[15:42:57] alfiemax: has joined #RubyOnRails
[15:48:31] kailido: has joined #RubyOnRails
[15:49:08] kailido: @parent = PerformanceIndicator.roots.order("name ASC")
[15:49:28] kailido: can I order that, but with the first 3 to be some specific ?
[15:49:49] kailido: for example , the 3 first X, Y, Z, and then order by name
[15:50:17] zave: has joined #RubyOnRails
[15:50:49] jhass: what identifies X, Y, Z?
[15:51:39] kailido: name=X,name=Y,name=Z, name ASC
[15:51:46] jhass: are you always going to fetch all and how big is the result set on average?
[15:52:27] kailido: its 8 results
[15:52:41] kailido: but 3 are priority
[15:52:52] jhass: I would go for a .sort_by {|root| ["X", "Y", "Z"].index(root.name) || 3 }
[15:53:08] jhass: not worth to build a complex database specific query in this case
[15:53:45] jhass: mh, or actually it might mess up again this way, || root.name would be better
[15:54:10] Cervajz: has joined #RubyOnRails
[15:54:37] jhass: ah meh that actually doesn't compare, gotta do a custom .sort
[15:54:42] davidw: has joined #RubyOnRails
[15:55:45] dblessing: has joined #RubyOnRails
[15:56:47] jhass: .sort {|a, b| a_i = FRONT.index(a.name); b_i = FRONT.index(b.name) a_i && b_i ? a_i <=> b_i : a_i || b_i ? 1 : a.name <=> b.name }
[15:56:49] jhass: something like that
[15:58:59] kailido: in your first it worked for the first 3
[15:59:17] kailido: the last one just blowed op my brain
[16:00:30] mdw: is there a way to batch this request in groups of 20?
[16:00:33] mdw: for example
[16:00:35] mdw: user_ids = User.all.pluck(:local_uuid)
[16:00:44] mdw: but instead of returning an array
[16:01:01] mdw: it would return an array of arrays, with each array having at most 20 unique IDs
[16:01:14] User458764: has joined #RubyOnRails
[16:01:32] Mia: has joined #RubyOnRails
[16:02:00] mikecmpbll: has joined #RubyOnRails
[16:02:10] mercerist: has joined #RubyOnRails
[16:03:17] whathappens: has joined #RubyOnRails
[16:03:30] macsteps: has joined #RubyOnRails
[16:03:45] mdw: maybe something like find_in_batches
[16:04:12] mdw: yup, this looks good... man Rails is sweet
[16:06:59] adre: has joined #RubyOnRails
[16:07:34] adam12: mdw: how about Enumerable#each_cons
[16:07:57] adam12: mdw: I'm curious your use case tho
[16:08:00] apeiros: kailido: order("case when name = a then 0 when … else 3 end, name ASC")
[16:09:42] mdw: adam12 I run a background task very frequently for each user, but I want to do it in batches of users rather than each user. It'll be slower but less intensive for the server.
[16:10:03] adam12: ActiveRecord::Base#find_each maybe?
[16:10:28] adam12: Actually, I think it's in ActiveRecord::Batches
[16:10:50] mdw: .each_cons looks nice :)
[16:11:09] adam12: Do to the way you pluck, the array is likely already built
[16:11:31] adam12: So I don't think it will save you anything in terms of queries. find_each or maybe find_in_batches is likely what you want
[16:11:33] adam12: bbiaf. lunch.
[16:11:47] mdw: enjoy, thanks
[16:14:35] danostrowski: has joined #RubyOnRails
[16:16:15] mercerist: has joined #RubyOnRails
[16:16:45] SteenJobs: has joined #RubyOnRails
[16:18:09] [Butch]: has joined #RubyOnRails
[16:18:26] kailido: apeiros: thanks, that worked :D
[16:18:57] yardenbar: has joined #RubyOnRails
[16:19:13] dblessing: has joined #RubyOnRails
[16:19:25] sloggerkhan: has joined #RubyOnRails
[16:19:38] apeiros: too sad AR iirc still does not allow bind params in anything except the where clause :-(
[16:20:01] rails45: has joined #RubyOnRails
[16:20:23] rails45: what does null: false mean in the line t.timestamps null: false?
[16:20:44] rafaelfranca: has joined #RubyOnRails
[16:20:45] AdamOnRails: has joined #RubyOnRails
[16:20:46] apeiros: rails45: it's another way to write: t.timestamps({:null => false})
[16:20:49] rails45: i know it creates columns for created_at and updated_at but i'm not sure what null: false means
[16:20:51] haaj: has joined #RubyOnRails
[16:21:01] rails45: what would null: true mean then?
[16:21:17] apeiros: you understand what {:null => false} means?
[16:21:30] rails45: nope that's what i'm confused about
[16:21:40] apeiros: you know what a hash literal is?
[16:21:51] apeiros: you know what a symbol literal is?
[16:22:23] rails45: i don't know what that is
[16:22:41] roamingdog: rails45: it just means null is not an acceptable value in the db for that field
[16:22:47] AdamOnRails: OK, so I think I need AJAX for this. But I need to be able to select "how many categories does this record have?" ... and then say you choose "3".... so then 3 x Text Input & TextArea combo appear below, ready to be filled in.
[16:23:01] rails45: ahh thanks!
[16:23:04] AdamOnRails: I just ave no idea what i need to google to find that.... AJAX of some sort...
[16:23:23] apeiros: oh, my, I thought you didn't understand the syntax
[16:24:10] TheShaun: has joined #RubyOnRails
[16:27:42] Kallis: has joined #RubyOnRails
[16:27:54] oystersauce8: has joined #RubyOnRails
[16:29:40] gfvcastro: has joined #RubyOnRails
[16:30:30] mercerist: has joined #RubyOnRails
[16:32:10] dionysus69: has joined #RubyOnRails
[16:34:00] dblessing: has joined #RubyOnRails
[16:34:52] Guest31: has joined #RubyOnRails
[16:35:12] srinidhi: has joined #RubyOnRails
[16:35:49] bbrowning: has joined #RubyOnRails
[16:36:38] Cache_Money: has joined #RubyOnRails
[16:37:11] arBmind: has joined #RubyOnRails
[16:38:08] cnk: has joined #RubyOnRails
[16:40:15] SteenJobs: has joined #RubyOnRails
[16:40:50] moeabdol: has joined #RubyOnRails
[16:40:56] Coldblackice: has joined #RubyOnRails
[16:46:06] manfrin: has joined #RubyOnRails
[16:47:43] emachnic: has joined #RubyOnRails
[16:48:59] sanakm: has joined #RubyOnRails
[16:49:04] emachnic_: has joined #RubyOnRails
[16:49:14] frem_: has joined #RubyOnRails
[16:49:50] sloggerkhan: has joined #RubyOnRails
[16:56:13] Ergo: has joined #RubyOnRails
[16:56:49] skiz: has joined #RubyOnRails
[16:57:13] SirOliver: has joined #RubyOnRails
[16:57:37] dopie2: has joined #RubyOnRails
[16:59:11] diegoaguilar: has joined #RubyOnRails
[17:03:17] AnoHito: has joined #RubyOnRails
[17:04:23] crdpink2: has joined #RubyOnRails
[17:05:20] yardenbar: has joined #RubyOnRails
[17:05:30] hahuang62: has joined #RubyOnRails
[17:06:20] mdw7: has joined #RubyOnRails
[17:07:16] mdw7: has joined #RubyOnRails
[17:07:35] macsteps: has joined #RubyOnRails
[17:08:48] User458764: has joined #RubyOnRails
[17:11:01] djbkd: has joined #RubyOnRails
[17:13:27] Scriptonaut: has joined #RubyOnRails
[17:15:06] Scriptonaut: has anyone here used elasticsearch? I'm trying (and failing) to search by phone numbers, as long as they include anything besides numbers. If I type: 3605555555, it works, but if I type: (360) 555 - 5555, it doesn't work. I'm using the uax_url_email tokenizer, with the "lowercase" token filter. Does anyone know a filter or tokenizer that would let me search a phone number with nonnumeric character
[17:15:12] Scriptonaut: s in there? Thanks
[17:15:19] Scriptonaut: I'm using the elasticsearch gem by the way
[17:17:04] Sashimi: has joined #RubyOnRails
[17:19:58] jetpackjoe: has joined #RubyOnRails
[17:20:01] joowh85: has joined #RubyOnRails
[17:21:07] Macaveli: has joined #RubyOnRails
[17:22:32] chintanparikh: has joined #RubyOnRails
[17:23:19] jtong: has joined #RubyOnRails
[17:23:52] hinbody: has joined #RubyOnRails
[17:24:21] dopie2: has joined #RubyOnRails
[17:24:25] Oliphaunte: has joined #RubyOnRails
[17:24:50] jhack: has joined #RubyOnRails
[17:25:05] Laxu5: has joined #RubyOnRails
[17:27:26] jottr: has joined #RubyOnRails
[17:28:02] gfvcastro: has joined #RubyOnRails
[17:28:21] GoranPavlovic: has joined #RubyOnRails
[17:30:19] dblessing: has joined #RubyOnRails
[17:31:53] macsteps: has joined #RubyOnRails
[17:34:19] adre: has joined #RubyOnRails
[17:34:23] dblessing: has joined #RubyOnRails
[17:37:18] pilne: has joined #RubyOnRails
[17:37:47] SteenJobs: has joined #RubyOnRails
[17:40:23] k3rn31: has joined #RubyOnRails
[17:42:58] artto: has joined #RubyOnRails
[17:44:11] conta: has joined #RubyOnRails
[17:48:34] Oliphaunte: has joined #RubyOnRails
[17:54:22] weaksauce: has joined #RubyOnRails
[17:57:37] k3rn31: has joined #RubyOnRails
[18:00:36] whathappens: has joined #RubyOnRails
[18:01:34] yellow5: has joined #RubyOnRails
[18:03:49] aegis3121: has joined #RubyOnRails
[18:06:18] SteenJobs: hey all - our designer has a video on loop set as the background for our home/splash page, but when the page first loads, the video lags behind the rest of the page’s content long enough to be noticeable (page loads, gray background, and then video appears). i presume this is because the video is being fetched from aws…how can i fix this, or at least make the lag less noticeable?
[18:06:44] Leepoff: has joined #RubyOnRails
[18:07:45] dionysus69: has joined #RubyOnRails
[18:09:08] Malgorath: has joined #RubyOnRails
[18:09:08] agit0: has joined #RubyOnRails
[18:09:16] mikecmpbll: has joined #RubyOnRails
[18:10:17] terravi: has joined #RubyOnRails
[18:10:41] terravi: So I have a rails form_for at the moment, is there a way that when I hit submit that I can see the form in JSON form?
[18:11:06] roamingdog: has joined #RubyOnRails
[18:12:02] phrozen77_: has joined #RubyOnRails
[18:12:03] whathapp_: has joined #RubyOnRails
[18:13:05] cnk: terravi: the answer to that used to be just putting remote: true in your form_for but you will have to look at to docs to see if that is still the way
[18:13:16] roamingdog: has joined #RubyOnRails
[18:13:45] fox_mulder_cp: terravi: u can see poosted data in rails server console
[18:13:49] cnk: SteenJobs: How about placing an image of the video in the spot - and have it get overlaid with the fideo
[18:14:08] fox_mulder_cp: not a logs, but u can use rails logger
[18:14:23] SteenJobs: cnk: ha!! that’s a pretty clever idea
[18:15:09] SteenJobs: cnk: is it possible though that i’m doing something wrong, or at least not actively doing something to speed up the video loading? or is it expected that it should take a few extra seconds before loading
[18:15:10] cnk: I am not sure but I vaguely think the html5 video tag has an image attribute for that
[18:15:27] SteenJobs: yep they do
[18:15:43] cnk: I see some lag with mine but am not an expert at how to fix
[18:16:02] terravi: fox_mulder_cp: yeah I know I can see it on the logs but I need to get an actual JSON object of the data.
[18:16:20] skroon: in my production env: Rails.cache is returning nil
[18:16:58] skroon: Rails.cache.fetch('foo') is giving back "undefined method `fetch' for nil:NilClass" anyone that might have a clue what i'm doing wrong?
[18:17:59] fox_mulder_cp: skroon: u want do something from nothing?
[18:18:34] skroon: fox_mulder_cp: well i'm using Rails.cache.fetch() in one of my initializers, and i'm thinking Rails hasn't fully booted up yet
[18:19:03] fox_mulder_cp: or nothinh in cache
[18:19:27] skroon: fox_mulder_cp: no, 'fetc' for nil:NilClass
[18:19:43] xall_: has joined #RubyOnRails
[18:20:45] [Butch]_: has joined #RubyOnRails
[18:21:01] adam12: skroon: You might be able to get around this with an after_initialize call & block
[18:21:32] soule: has joined #RubyOnRails
[18:21:58] skroon: adam12: oke, figuring out how to use that in my initializers, thanks!
[18:23:22] desnudopenguino: has joined #RubyOnRails
[18:23:54] fox_mulder_cp: wow. i do it myself. my app now creates container directory infrastructure via ansible playbook, create docker container from image, mount directory infrastructure to instance of container and update public and internal dns :)
[18:25:20] nettoweb: has joined #RubyOnRails
[18:26:10] gingray: has joined #RubyOnRails
[18:27:37] chintanparikh: has joined #RubyOnRails
[18:30:00] arBmind: has joined #RubyOnRails
[18:30:17] moeabdol: has joined #RubyOnRails
[18:33:52] arBmind: has joined #RubyOnRails
[18:36:24] gfvcastro: has joined #RubyOnRails
[18:37:02] Macaveli: has joined #RubyOnRails
[18:38:05] jgt1: has joined #RubyOnRails
[18:39:36] cnk: fox_mulder_cp: Congratulations!
[18:40:06] Malgorath: I need some sage widsom/advice. I need to make a list of items from another table, but I'm thinking i need to do it in a many to many fashion. Like I have a Master List of items. Each item of the master list is actual a link via a one to one in another table that has the original items listed. Ugh does this make sense to anyone else?
[18:40:37] User458764: has joined #RubyOnRails
[18:41:01] fox_mulder_cp: chridal: thanks
[18:42:36] DTZUBDUB: has joined #RubyOnRails
[18:42:56] cnk: Malgorath: seems reasonable
[18:43:50] crystal77: has joined #RubyOnRails
[18:44:31] fox_mulder_cp: cnk: thanks. it's a my first big app after extening official blog guide for some like wordpress :)
[18:45:06] fox_mulder_cp: cnk: i write my own hosting control panel such as heroku for hosting apps, mail, dns and domain registration
[18:45:26] cnk: WOW that's ambitious
[18:45:33] manfrin: has joined #RubyOnRails
[18:47:29] fox_mulder_cp: cnk: i'm a hostmaster in some small ISP anduse all all of big free and cloes hosting apps such as plesk and cpanel
[18:48:44] fox_mulder_cp: hm. my router and moded have a hhigh temp and internet is slllowly now
[18:55:56] context: sounds like you need a new router
[18:56:49] adac: has joined #RubyOnRails
[18:57:12] mercerist: has joined #RubyOnRails
[19:00:49] triptec: has joined #RubyOnRails
[19:01:06] mwlang: Malgorath: what advice are you seeking?
[19:01:57] edwinvdg_: has joined #RubyOnRails
[19:03:10] yfeldblum: has joined #RubyOnRails
[19:04:47] Pumukel: has joined #RubyOnRails
[19:07:01] VeryBewitching: has joined #RubyOnRails
[19:07:07] mikecmpbll: has joined #RubyOnRails
[19:11:56] _underscore_: has joined #RubyOnRails
[19:16:26] Sashimi: has joined #RubyOnRails
[19:18:01] Leepoff: has joined #RubyOnRails
[19:19:14] haaj: has joined #RubyOnRails
[19:19:44] manfrin_: has joined #RubyOnRails
[19:22:30] greengriminal: has joined #RubyOnRails
[19:22:51] replay: has joined #RubyOnRails
[19:23:20] Mia: has joined #RubyOnRails
[19:23:20] Mia: has joined #RubyOnRails
[19:24:05] yardenbar: has joined #RubyOnRails
[19:24:19] chintanparikh: has joined #RubyOnRails
[19:24:23] amcoder: has joined #RubyOnRails
[19:24:33] jmignault: has joined #RubyOnRails
[19:25:39] Akuma: has joined #RubyOnRails
[19:27:45] hahuang61: has joined #RubyOnRails
[19:27:55] Endie: has joined #RubyOnRails
[19:31:26] kdisneur: has joined #RubyOnRails
[19:31:27] hiddenloop: has joined #RubyOnRails
[19:31:32] shaman42: has joined #RubyOnRails
[19:31:33] schlauberg: has joined #RubyOnRails
[19:31:38] p8m: has joined #RubyOnRails
[19:31:40] fluxsource: has joined #RubyOnRails
[19:32:02] Janno: has joined #RubyOnRails
[19:32:08] Depili: has joined #RubyOnRails
[19:32:13] eyck: has joined #RubyOnRails
[19:35:21] Trynemjoel: has joined #RubyOnRails
[19:35:23] okdas: has joined #RubyOnRails
[19:35:23] okdas: has joined #RubyOnRails
[19:35:24] chridal: has joined #RubyOnRails
[19:35:30] bumao: has joined #RubyOnRails
[19:35:51] cnk: has joined #RubyOnRails
[19:36:05] ldnunes: has joined #RubyOnRails
[19:37:13] greengriminal: has joined #RubyOnRails
[19:38:40] jgt1: has joined #RubyOnRails
[19:38:55] danostrowski: has joined #RubyOnRails
[19:40:13] User458764: Hi, how do I fix the error ActionController::InvalidAuthenticityToken https://gist.github.com/gsorbier/697e5e94cc54c2f205e7de694a368651
[19:40:30] Macaveli: has joined #RubyOnRails
[19:41:57] aegis3121: has joined #RubyOnRails
[19:42:03] chintanparikh: User458764: What are you doing
[19:42:05] Leepoff: has joined #RubyOnRails
[19:42:17] kp666: has joined #RubyOnRails
[19:42:46] User458764: I use a client (mailgun.com web service) to test my webhook
[19:43:42] chintanparikh: I need more information. Post all the relevant code
[19:44:08] dmz: has joined #RubyOnRails
[19:45:22] tildes: has joined #RubyOnRails
[19:46:07] whathappens: has joined #RubyOnRails
[19:48:28] Scriptonaut: has left #RubyOnRails: ()
[19:49:42] whathappens: has joined #RubyOnRails
[19:50:45] User458764: chintanparikh The problem is reported here http://stackoverflow.com/questions/3364492/actioncontrollerinvalidauthenticitytoken and the solution seems to be skip_before_action :verify_authenticity_token but it seems to be a a vulnerability too
[19:50:59] Leepoff: has joined #RubyOnRails
[19:51:03] User458764: Is it safe to disable it?
[19:51:34] ruby-lang191: has joined #RubyOnRails
[19:51:48] whathappens: has joined #RubyOnRails
[19:51:50] chintanparikh: It's safe to disable it just in your webhook_controller
[19:52:11] ruby-lang191: how does rails know a to route to the correct controller? ex. localhost:3000/say calls SayController from say_controller.rb
[19:52:15] whathappens: has joined #RubyOnRails
[19:52:39] alfiemax: ruby-lang191, it has to be specified in your rails app routes
[19:53:02] dblessing: has joined #RubyOnRails
[19:53:04] alfiemax: ruby-lang191, http://guides.rubyonrails.org/routing.html
[19:53:08] ruby-lang191: I'm going through some tutorials. is it elswhere than routes.rb?
[19:53:18] alfiemax: nop, no where else
[19:53:27] ruby-lang191: so far it seems like magic, or it's ignoring _controller when searching for controllers.
[19:53:54] alfiemax: when you start off with rails, alot of things seems like magic
[19:54:11] context: ruby-lang191: or 'controller' is appended to all routes when searching for said controller
[19:54:17] emachnic: has joined #RubyOnRails
[19:54:37] context: i could be totally wrong though
[19:55:00] User458764: chintanparikh thanks
[19:55:51] alfiemax: ruby-lang191, but seems like you have encountered an issue
[19:55:58] ruby-lang191: the rails app routes is config/routes.rb ?
[19:56:03] alfiemax: how have you defined your route
[19:56:21] ruby-lang191: Tutorials have it as empty(default values inside the routes.rb files)
[19:56:44] ruby-lang191: it's not empty
[19:57:10] alfiemax: when you create a new rails app, it will just have a `Rails.application.routes.draw` block
[19:57:20] ruby-lang191: just has the basic scaffolding route which has 3 lines
[19:57:55] alfiemax: ruby-lang191, i think it would be better if you could show us your code
[19:58:00] pwnd_nsfw: has joined #RubyOnRails
[19:58:16] ruby-lang191: to be more specific, I don't see the magic of how the uri /say/ routes to SayController
[19:58:39] ruby-lang191: I know everything is created for you when you do generate controller say. But odn't see how it all links
[19:58:55] alfiemax: did you use scaffolding ?
[19:59:55] alfiemax: Rule 1, when i learned rails... try out scaffolding.. be amazed.. and forget about it and never use it again
[20:00:11] ruby-lang191: I haven't added any code. Everything there is only from scaffolding.
[20:00:21] alfiemax: which tutorial are you following?
[20:00:48] ruby-lang191: A it's from a book called programming in world wide web.
[20:01:19] ruby-lang191: I've also tried the rubyguides tutorial. Which routing is still mysterious to me and I'm trying to see how it finds the correct controller to call.
[20:01:27] alfiemax: try this : https://www.railstutorial.org/
[20:01:31] quazimodo: has joined #RubyOnRails
[20:01:55] alfiemax: i jump started my journey on rails in a day following this
[20:03:33] ruby-lang191: I am eventually going to go through that. Was hoping someone would be able to help me understand that magic without going through everypage in a book first. hmm
[20:03:57] ruby-lang191: even rails routing doesn't explain it? http://guides.rubyonrails.org/routing.html
[20:04:09] alfiemax: just go through the first 3-4 chapters. that should give you a pretty good idea
[20:04:21] ruby-lang191: GET /patients/17 will probably call patientsController class in patients_controller.rb
[20:04:31] ruby-lang191: Is that define in routing.rb?
[20:05:03] alfiemax: its route.rb
[20:05:04] centrx: has joined #RubyOnRails
[20:05:14] cnk: in routing.rb, it is defined when you say resource: :patients
[20:05:16] alfiemax: and that's not a syntax of how you define a route
[20:05:19] gambl0re: has joined #RubyOnRails
[20:05:19] gambl0re: has joined #RubyOnRails
[20:05:52] ruby-lang191: so I'm guessing my problem here is scaffolding is hiding too much from me?
[20:06:21] Guest48: has joined #RubyOnRails
[20:06:25] cnk: In the olden days, there used to be a default route that took /token1/token2 and passed that to the show action of the Token1Controller's show action - witht an id parameter = token2
[20:06:27] alfiemax: not exactly, after doing scaffolding, take time and go through each of the files generated or modified
[20:06:35] ruurd: yes and no plus you don't know what pieces go where and what is connected to what
[20:07:00] cnk: has left #RubyOnRails: ()
[20:07:10] cnk: has joined #RubyOnRails
[20:07:28] alfiemax: but personally, i never recommend a beginner to use scaffolding to try learn rails
[20:07:42] desnudopenguino: ruby-lang191: http://guides.rubyonrails.org/routing.html
[20:08:00] ruby-lang191: I see, I'll have to take a look at the book
[20:09:24] context: alfiemax +1
[20:09:42] centrx: What’s the name for a function that checks whether to run and then returns if it shouldn’t run?
[20:10:03] context: all functions return
[20:10:08] chimkan: has left #RubyOnRails: ()
[20:10:26] lightt: has joined #RubyOnRails
[20:10:52] context: you can have memoized methods?
[20:11:04] context: which just caches return values based on previous call params
[20:11:42] context: or.. you have a method that just decides whether to run or not... i dont think there is a "name" for that
[20:12:01] manfrin: has joined #RubyOnRails
[20:13:11] crystal77: has joined #RubyOnRails
[20:13:46] cnk: context: I might call that method a guard of some sort
[20:14:46] dblessing: has joined #RubyOnRails
[20:14:53] centrx: guard, that’s pretty close
[20:15:03] centrx: good enough
[20:15:14] jtong: has joined #RubyOnRails
[20:15:41] neo_: has joined #RubyOnRails
[20:15:50] pawnbox: has joined #RubyOnRails
[20:16:17] desnudopenguino: is there a graceful way to handle a completely empty object_params from a form?
[20:16:45] centrx: cnk: Thanks
[20:16:47] centrx: http://c2.com/cgi/wiki?GuardClause
[20:16:51] draig: has joined #RubyOnRails
[20:16:52] alfiemax: desnudopenguino, what do you mean by empty object_params ?
[20:16:58] Leepoff: has joined #RubyOnRails
[20:17:09] adac: has joined #RubyOnRails
[20:17:15] context: cnk: all that works
[20:17:30] ur5us: has joined #RubyOnRails
[20:17:45] edwinvdgraaf: has joined #RubyOnRails
[20:18:08] desnudopenguino: so I have a Photo and PhotoRating objects. On the Photo show view, I have the form for rating the photo. I'm working on form validation so that the photo rating can't be empty
[20:18:19] lightt: has joined #RubyOnRails
[20:18:42] lightt: has joined #RubyOnRails
[20:18:54] coalwater: has joined #RubyOnRails
[20:19:02] alfiemax: so just have a client side form validation, and also a model level validation
[20:20:38] coalwater: I want some help with writing a gem, just the concept, I want to write a gem that changes the counter cache provider from a database column to a redis key, I don't know if I should monkey patch the rails methods or create a new option like `redis_counter_cache` or something like that, any ideas?
[20:22:54] ruby-lang191: I found this. "For the curious, 'articles#index' actually expands out to ArticlesController.action(:index), which returns a valid Rack application." So to confirm, this means the uri referencing a controller indeed does have the name changed to call the correct controller?
[20:23:04] ruby-lang191: in the http://guides.rubyonrails.org/routing.html
[20:23:57] alfiemax: ruby-lang191, yes
[20:24:14] Jayson_Virissimo: has joined #RubyOnRails
[20:25:22] danostrowski: has joined #RubyOnRails
[20:26:47] Endie: has joined #RubyOnRails
[20:27:23] Leepoff: has joined #RubyOnRails
[20:27:38] aeruder: has joined #RubyOnRails
[20:27:50] macsteps: has joined #RubyOnRails
[20:28:02] macsteps_: has joined #RubyOnRails
[20:29:13] jtong: has joined #RubyOnRails
[20:29:23] ruby-lang191: has left #RubyOnRails: ()
[20:31:03] ldnunes_: has joined #RubyOnRails
[20:31:08] [Butch]: has joined #RubyOnRails
[20:32:29] gusrub: has joined #RubyOnRails
[20:34:48] jhack: has joined #RubyOnRails
[20:39:28] Endie: has left #RubyOnRails: ()
[20:40:13] srinidhi: has joined #RubyOnRails
[20:40:20] desnudopenguino: alfiemax: I have validation, but when I try to test it manually, I am getting "param is missing or the value is empty: photo_rating"
[20:40:24] ejnahc: has joined #RubyOnRails
[20:40:59] meoblast001: has joined #RubyOnRails
[20:41:51] oystersauce8: has joined #RubyOnRails
[20:43:13] cnk: desnudopenguino: that doesn't seem unreasonable. What did you expect?
[20:44:04] desnudopenguino: It makes sense, I'm just trying to figure out how to catch it and redirect back to the page with an error message, or to see if there was a validation for it?
[20:45:14] Leepoff: has joined #RubyOnRails
[20:46:07] cnk: The general rails pattern is to check if something saves, and if not, the errors will have been added to the object, so you can just rerender your form and the errors will appear whever you put your form_errors block
[20:47:17] cnk: desnudopenguino: I know it is popular to say 'real rails devs don't use scaffolds' but I think there is a lot to be gained by starting with the scaffold and then modifying it
[20:47:55] nettoweb: has joined #RubyOnRails
[20:49:13] desnudopenguino: I've been building with scaffolds, and (re)moving parts all over the place. I am mostly dealing with CRUD, so I figured it would be a time saver, instead of writing a majority of the functionality by hand
[20:50:33] fox_mulder_cp: scaffold ok inly for quick easy testing in alpha
[20:51:03] fox_mulder_cp: becouse after scaffolding u must drop and rewrite tons of code
[20:51:50] oystersauce8: fox mulder i highly if youre on the right path.... do you have a gist of a controller as an example
[20:52:08] eljimmy: has joined #RubyOnRails
[20:53:01] fox_mulder_cp: oystersauce8: from what app i can see gist of my code? my rails blog located on github
[20:53:13] whathappens: has joined #RubyOnRails
[20:53:25] fox_mulder_cp: code of my hosting panel now in pre alpha stage )
[20:54:23] oystersauce8: i was curious to see a controller you authored, and how you deviated from the patterns of scaffolds...
[20:55:37] fox_mulder_cp: oystersauce8: my way - one app for quick scaffold a prototype and second app as development version
[20:56:14] fox_mulder_cp: becouse sometimes scaffolding can't help
[20:56:45] oystersauce8: [sometimes] for example ?
[20:58:31] fox_mulder_cp: oystersauce8: now i write prototype of my hosting apps control panel. i'm scaffold some models/controllers/views, but already CRUD for it - bad way, becouse meny of codes must be rewritter and retested
[20:59:49] arup_r: has joined #RubyOnRails
[21:00:10] FooMunki: has joined #RubyOnRails
[21:03:48] manfrin: has joined #RubyOnRails
[21:04:05] diegoviola: has joined #RubyOnRails
[21:04:19] macsteps: has joined #RubyOnRails
[21:04:23] chintanparikh: has joined #RubyOnRails
[21:06:00] Guest48: does anyone have a suggestion for a datetime picker?
[21:07:05] TheShaun: has joined #RubyOnRails
[21:08:17] Leepoff: has joined #RubyOnRails
[21:09:58] caudill: has joined #RubyOnRails
[21:12:18] triptec: has joined #RubyOnRails
[21:13:05] hahuang61: has joined #RubyOnRails
[21:13:24] frozenfoxx: has joined #RubyOnRails
[21:13:44] yfeldblum: has joined #RubyOnRails
[21:15:29] kimegede: has joined #RubyOnRails
[21:15:34] frozenfoxx: I was wondering if I could get a suggestion to point me in the right direction on a problem I'm trying to solve in Rails. I have to call a function that starts a thread in the background. It basically is going to, every fifteen seconds, call another function. THe problem is I *also* need a way to stop it, so I'm not sure I can just use Threads. Any suggestions on how to do this?
[21:15:58] frozenfoxx: It looks like maybe ActiveJob, but those seem to be queued, not something that runs continuously.
[21:16:38] Macaveli: has joined #RubyOnRails
[21:17:56] xall_: has joined #RubyOnRails
[21:18:36] adam12: frozenfoxx: Any background processor, a job that continually loops (or one of it's plugins for time based job processing) with a flag stored somewhere to determine if job should run or not?
[21:18:41] cnk: you need to stop it from the web?
[21:18:58] cnk: and does it need to stay attached to the page the user is looking at?
[21:22:52] andrew-l: has joined #RubyOnRails
[21:23:18] cnk: If so, ActionCable?
[21:23:56] context: has joined #RubyOnRails
[21:24:02] skiz: has joined #RubyOnRails
[21:24:37] Sashimi: has joined #RubyOnRails
[21:24:40] Darmani: has joined #RubyOnRails
[21:25:06] Darmani: Hello everyone ^^
[21:26:02] macsteps: has joined #RubyOnRails
[21:27:10] havenwood: Darmani: hi
[21:27:58] techandy1: has joined #RubyOnRails
[21:30:19] techandy1: Hi all, I have a quick question; Does anybody know of free online ruby on rails bootcamps?
[21:32:00] whathappens: has joined #RubyOnRails
[21:32:01] djbkd: has joined #RubyOnRails
[21:32:35] mello: has joined #RubyOnRails
[21:32:40] havenwood: techandy1: There are free courses but I don't know of any online bootcamp with a mentor that's free.
[21:32:56] SteenJobs: has joined #RubyOnRails
[21:33:13] techandy1: @havenwood, thanks for letting me know.
[21:37:23] GodFather: has joined #RubyOnRails
[21:42:40] chipotle: has joined #RubyOnRails
[21:42:42] pilne: has left #RubyOnRails: ("Leaving!")
[21:42:52] moeabdol: has joined #RubyOnRails
[21:44:51] lightt: has joined #RubyOnRails
[21:45:33] djbkd: has joined #RubyOnRails
[21:46:13] kimegede: has left #RubyOnRails: ("Linkinus - http://linkinus.com")
[21:46:55] SteenJobs: what would you recommend as the best way to break a payment into installments (i’m using stripe)? I guess one could break n installments up into a subscription equal to time between installments, but then you would have to manually cancel the subscription
[21:48:47] snowy: has joined #RubyOnRails
[21:50:41] allcentury: has joined #RubyOnRails
[21:50:43] macsteps: has joined #RubyOnRails
[21:52:13] Radar: SteenJobs: I think a Stripe subscription can have a duration.
[21:53:18] SteenJobs: Radar: from what i’ve seen online so far, it seems you have to basically keep track of the # of payments, and when it equals n, programmatically cancel the subscriptions
[21:53:27] tomeara: has joined #RubyOnRails
[21:53:41] SteenJobs: *subscription
[21:53:53] Radar: SteenJobs: yeah, I was just looking at the docs for it and looks like you can set `cancel_at_period_end` when the last month is happening. Rather than re-billing the subscription it will cancel it.
[21:54:04] SteenJobs: no kidding!!
[21:54:08] SteenJobs: great find dude, thanks
[21:56:30] dblessing: has joined #RubyOnRails
[22:00:28] SteenJobs: has joined #RubyOnRails
[22:00:29] neanderslob: has joined #RubyOnRails
[22:00:32] SteenJobs: Radar: sorry, got disconnected
[22:00:39] Radar: SteenJobs: np :)
[22:00:54] SteenJobs: have you ever played around with Spree?
[22:01:06] Radar: SteenJobs: I also have some free time for mentoring currently, but it's on Tuesday nights at 5:30pm my time and I think you'll be asleep
[22:01:10] Radar: HAH have I ever played around with Spree!
[22:01:22] Radar: https://github.com/spree/spree/graphs/contributors
[22:01:40] Radar: https://spreecommerce.com/blog/ryanbigg-joins-spree
[22:01:49] Radar: https://spreecommerce.com/blog/farewell-ryan-bigg
[22:02:00] SteenJobs: although that makes me quite confident in my telling the founder/my boss that i plan on using Spree
[22:02:09] hahuang61: has joined #RubyOnRails
[22:02:21] Radar: SteenJobs: I would recommend using Solidus because it's more actively maintained
[22:02:25] SteenJobs: i’ll check it out
[22:02:29] Radar: https://github.com/solidusio/solidus
[22:02:34] Radar: It's a fork of Spree
[22:02:49] SteenJobs: basically we’re adding an e-commerce like layer to our platform, and i’m developing alone, so anything to help get it up is a lifesaver
[22:03:20] SteenJobs: my guess though is spree has more online resources available, no?
[22:03:23] Radar: I maintained Spree for about 2 and a half years and when I wasn't writing code I was answering a ton of emaisl.
[22:03:30] Radar: SteenJobs: You'll find good help on the Solidus Slack.
[22:04:13] SteenJobs: ok great - cause it seems these engines were designed with building your site into the e-commerce platform rather than the other way around (it’s only one ‘side’ of our platform)
[22:04:53] Radar: Spree's designed in such a way that you can bolt the ecommerce feature onto your app
[22:05:47] SteenJobs: convenient. the stuff i was reading must’ve been a bit older
[22:05:59] SteenJobs: it seemed people were saying you have to hack around a bit to do that, but good to know
[22:06:32] SteenJobs: btw - seems “cancel_at_period_end” is a bool
[22:08:08] pawnbox: has joined #RubyOnRails
[22:13:17] chintanparikh: has joined #RubyOnRails
[22:14:10] Radar: SteenJobs: yeah, so you'd run some code to see if the subscriptions should end this month and if they do, then you'd set that boolean
[22:14:18] SteenJobs: right exactly
[22:15:18] elcontrastador: has joined #RubyOnRails
[22:15:28] SteenJobs: was my original plan, just felt like verifying there wasn’t a better approach. only worries me about creating the possibility of overcharging if for whatever reason the webhook for subscription payment being captured doesn’t go through and the subscription isn’t canceled
[22:17:08] edwinvdgraaf: has joined #RubyOnRails
[22:18:12] moeabdol: has joined #RubyOnRails
[22:18:16] banister: has joined #RubyOnRails
[22:22:18] moeabdol: has joined #RubyOnRails
[22:23:37] dblessing: has joined #RubyOnRails
[22:29:41] haaj: has joined #RubyOnRails
[22:30:30] whathappens: has joined #RubyOnRails
[22:33:14] Elinos: has joined #RubyOnRails
[22:40:57] ereslibre: has joined #RubyOnRails
[22:40:57] ereslibre: has joined #RubyOnRails
[22:45:57] pawnbox: has joined #RubyOnRails
[22:47:37] Leepoff: has joined #RubyOnRails
[22:49:18] upsell5: has joined #RubyOnRails
[22:52:02] allcentury: has joined #RubyOnRails
[22:52:15] soule: has joined #RubyOnRails
[22:52:37] rickmasta: has joined #RubyOnRails
[22:52:59] YourManCJ: has joined #RubyOnRails
[22:54:27] YourManCJ: how can I put my rails app into production? I have a godaddy cloud server running ubuntu, and I have a domain controlled by godaddy. How can I point the domain to the server hosting the rails ip address on port 3000?
[22:55:17] chintanparikh: has joined #RubyOnRails
[22:55:25] cnk: No You need to run a real web server, not the one that launches from rails server
[22:55:46] YourManCJ: ok, so what kind of web server? apache?
[22:56:56] cnk: apache or nginx + an app server
[22:57:05] cnk: personally I use apache + passenger
[22:57:12] cnk: these days nginx is more popular
[22:57:58] cnk: the Digital Ocean docs are generally good https://www.digitalocean.com/community/tutorials/deploying-a-rails-app-on-ubuntu-14-04-with-capistrano-nginx-and-puma
[22:58:09] YourManCJ: thank you very much
[22:58:15] YourManCJ: I was just going to ask for a link
[22:58:29] mello: yourmancj: u need to do this first https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-14-04
[22:59:30] YourManCJ: any idea how long this usually takes/how difficult this is?
[22:59:38] Radar: An hour or two.
[22:59:46] Radar: yourmancj: You could always deploy it to Heroku, which is much easier.
[23:00:29] mello: yourmancj: its a process but its a good thing, you will learn alot and you get a better understadning of how things work
[23:00:40] YourManCJ: yeah I thought about that. I am working for a small organization and they wanted email hosting as well. godaddy has pretty cheap cloud servers
[23:01:12] YourManCJ: having it all on godaddy makes managing is easier. at least that is what i had thought
[23:01:38] fryguy: you are gonna have a bad time
[23:02:00] rickmasta: has joined #RubyOnRails
[23:02:04] YourManCJ: i see that now
[23:02:09] mello: u got shell access on ur godaddy server?
[23:02:21] YourManCJ: completely open ubuntu 14
[23:02:27] YourManCJ: or whatever other distro
[23:02:34] mello: well then go for it
[23:02:49] Oliphaunte: has joined #RubyOnRails
[23:03:10] havenwood: yourmancj: http://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you//
[23:03:57] oystersauce8: has joined #RubyOnRails
[23:04:07] nettoweb: has joined #RubyOnRails
[23:04:28] YourManCJ: is that last blog just about setting up rails on ubuntu?
[23:05:20] xall: has joined #RubyOnRails
[23:05:53] mello: yourmancj: if u need to setup ruby and rails il recommend this guide https://gorails.com/setup/ubuntu/
[23:06:33] YourManCJ: thanks. I have my application developed I just need to get it out into the world
[23:09:06] Leepoff: has joined #RubyOnRails
[23:09:08] manfrin: has joined #RubyOnRails
[23:09:36] rickmasta: has joined #RubyOnRails
[23:11:08] Markhor1991: has joined #RubyOnRails
[23:11:55] mello: yourmancj: follow those 2 digitalocean tuts and ul have it up and runnig in no time
[23:13:06] wd40s: has joined #RubyOnRails
[23:14:31] YourManCJ: thanks man. I love the rails community. Always so helpful
[23:16:18] rickmasta: has joined #RubyOnRails
[23:16:53] Guest48: has joined #RubyOnRails
[23:19:40] Markhor1991: I could use a bit of concept help/advice, on controllers. one tutorial says they can be thought of as a middle man between views and models. does this mean i should be from models outward to views, for naming them?
[23:20:20] SteenJobs: has joined #RubyOnRails
[23:21:05] rubyonrailed: has joined #RubyOnRails
[23:21:24] whathappens: has joined #RubyOnRails
[23:21:33] superlou: has joined #RubyOnRails
[23:24:06] cnk: Markhor1991: Rails wants to use its naming conventions. So esp as you are learning, I wouldnt' fight that
[23:24:41] cnk: model should be a singular noun. controller should be plural version of that + Controller and the views folder is the plural noun
[23:25:24] Markhor1991: cnk so it is based on models and goes outward to controller, then view? that's the order? and i don't plan to fight it, i just want to figure it out and make it work
[23:25:54] pwnd_nsfw`: has joined #RubyOnRails
[23:25:59] cnk: Are you reading books or using a tutorial?
[23:26:11] dalbusch1t: has joined #RubyOnRails
[23:26:23] cnk: Personally I think using scaffold generator while you are playing around is a great idea
[23:27:18] diegoviola: I want to have things like phone number and address for my users, but not sure where to put this data
[23:27:43] jottr: has joined #RubyOnRails
[23:27:50] diegoviola: User has_one Profile?
[23:28:21] cnk: I would probably make phone number and address models and relate them to User
[23:28:32] cnk: phone number belongs to user
[23:28:39] cnk: user has many phone numbers
[23:29:15] diegoviola: cnk: would that still work if I save 1 phone number
[23:29:47] rscheuer: has joined #RubyOnRails
[23:30:52] jtong: has joined #RubyOnRails
[23:33:19] tds5016: has joined #RubyOnRails
[23:33:32] tds5016: hey. has anyone here using ruby relay?
[23:34:01] Oliphaunte: has joined #RubyOnRails
[23:35:38] fox_mulder_cp: what is relay? i know inly mx relay
[23:36:07] context: has joined #RubyOnRails
[23:37:32] mdw: has joined #RubyOnRails
[23:38:16] tds5016: fox_mulder_cp: facebook relay
[23:38:24] tds5016: the other half of graphQL ;-)
[23:39:23] triptec: has joined #RubyOnRails
[23:40:15] fox_mulder_cp: i dont know what it is (
[23:41:13] diegoviola: what datatype would you guys use for storing numbers?
[23:41:26] diegoviola: I'm using postgresql
[23:41:32] diegoviola: phone numbers
[23:42:05] Cache_Money: has joined #RubyOnRails
[23:42:22] nickjj: has joined #RubyOnRails
[23:43:42] fox_mulder_cp: string? integers? %) custom types////
[23:43:43] tds5016: https://github.com/rmosolgo/graphql-relay-ruby
[23:44:03] tds5016: based on that I can't figure out how to change " global_id_field :id" to use :node_id instead of :id
[23:44:17] diegoviola: strings for numbers doesn't seem right
[23:44:18] tds5016: I am already using ID, and it looks like that interface overwrites it; which is a freaking nightmare.
[23:44:42] diegoviola: won't I have to call #to_i on the string if I want to divide and stuff?
[23:47:25] rickmasta: has joined #RubyOnRails
[23:47:31] Rodya_: has joined #RubyOnRails
[23:48:29] Hobogrammer: has joined #RubyOnRails
[23:49:31] Markhor1991: I see the one who asked left, but yes i was reading over a tutorial on tutorials point. not the first time i read it but it doesn't answer my questions..on how rails is conceptualized, why things are the way the are.
[23:54:40] triptec: has joined #RubyOnRails
[23:55:26] upsell5: has joined #RubyOnRails
[23:55:36] rickmasta: has joined #RubyOnRails
[23:56:09] Cache_Money: I have a background image on a <div> on my homepage. The image is 423KB. Is that too big? Also, is there a way to serve a smaller image to mobile users (seems like they could use a much smaller image)?
[23:57:06] baweaver: does it need to be that big?
[23:57:19] baweaver: avoid using large images were possible. What's the image?
[23:57:37] baweaver: as far as mobile, that's what CSS2/3 take care of with media queries.
[23:57:55] baweaver: diegoviola: why in the world would you do math on a phone number?
[23:58:08] diegoviola: baweaver: I won't
[23:58:16] macsteps: has joined #RubyOnRails
[23:58:26] Cache_Money: baweaver: It probably doesn't need to be that big, I'm just not very good with Photoshop. It's the bg image on https://caddiehack.com/
[23:58:38] baweaver: then what was: "diegoviola: won't I have to call #to_i on the string if I want to divide and stuff?"
[23:59:24] Markhor1991: has joined #RubyOnRails
[23:59:48] baweaver: Cache_Money: You could always turn down the quality on it if you really need to.
[23:59:58] baweaver: but for the most part it shouldn't be a problem