« Back to channel list

#RubyOnRails - 02 March 2016

« Back 1 day Forward 1 day »
[00:04:52] Ropeney: has joined #RubyOnRails
[00:05:25] diegoviola: has joined #RubyOnRails
[00:07:27] Trynemjoel: has joined #RubyOnRails
[00:07:43] makerops: has joined #RubyOnRails
[00:09:51] pvertenten: has joined #RubyOnRails
[00:10:05] user083: has joined #RubyOnRails
[00:10:26] user083: How can i have a optional model relation?
[00:10:29] josephkokenge: has joined #RubyOnRails
[00:10:38] Radar: user083: !explain
[00:10:38] helpa: user083: Please explain your problem better as we are having trouble understanding what you mean. A Gist (http://gist.github.com) is always helpful!
[00:11:17] user083: I am creating a moderation system, when a user is logged in i want to relate to the user
[00:11:42] user083: but i also want to have anonymous reports
[00:11:45] Radar: user083: wouldn't that just be a belongs_ot?
[00:11:52] Radar: user083: belongs_to associations don't need to be set.
[00:11:55] Radar: They can be nil.
[00:12:12] user083: i did not know that they could be nil, thanks
[00:13:12] baweaver: just make sure the column for the id allows NULL
[00:13:18] baweaver: or you're going to have a bad time of it.
[00:13:57] user083: i added this to my migration for reports
[00:13:58] user083: t.references :user, index: true, foreign_key: true
[00:14:21] user083: will that allow null if it uses foreign keys?
[00:18:31] srinidhi: has joined #RubyOnRails
[00:18:38] srinidhi: has joined #RubyOnRails
[00:19:57] Radar: user083: yes, I believe so.
[00:25:21] baweaver: has joined #RubyOnRails
[00:28:01] flashpoint9: has joined #RubyOnRails
[00:28:04] manfrin: has joined #RubyOnRails
[00:28:44] maesitos: has joined #RubyOnRails
[00:33:22] blackmesa: has joined #RubyOnRails
[00:33:41] benlieb: has joined #RubyOnRails
[00:34:54] wmoxam: has joined #RubyOnRails
[00:35:33] rafaelfranca: has joined #RubyOnRails
[00:38:45] foli_: how can i make a field in the user table only edited my the admin
[00:39:02] foli_: am using active admin
[00:40:36] foli_: i have a user field <ide number>. users and edit all other fields except this one
[00:42:15] vmarcetic: has joined #RubyOnRails
[00:42:52] trosborn: has joined #RubyOnRails
[00:43:06] lemur: has joined #RubyOnRails
[00:46:54] baweaver: has joined #RubyOnRails
[00:49:29] jgpawletko: has joined #RubyOnRails
[00:50:43] pwnd_nsfw: foli_, that limitation would be via the controller
[00:50:59] pwnd_nsfw: I don't like AA, so that's all I can really say
[00:51:01] Radar: I don't know how you do that kind of thing in active admin.
[00:51:15] Radar: File an issue on activeadmin and ask them ;)
[00:51:27] foli_: pwnd_nsfw: which control
[00:51:32] dalbusch1t: has joined #RubyOnRails
[00:51:34] pwnd_nsfw: the good one
[00:51:41] Radar: the admin controller
[00:51:45] Radar: if activeadmin even gives you one
[00:51:51] pwnd_nsfw: I don't think so
[00:51:59] mikeiniowa: has joined #RubyOnRails
[00:52:09] pwnd_nsfw: They give you some dongs DSL for managing resources
[00:52:19] pwnd_nsfw: fit everything into one file
[00:52:28] pwnd_nsfw: idk, I forget, it's been a while. I'd rather just write from scratch
[00:52:55] pwnd_nsfw: Write the functionality directly instead of trying to bend some existing product
[00:54:00] fmcgeough: has joined #RubyOnRails
[00:55:25] DLSteve: has joined #RubyOnRails
[00:59:18] djbkd: has joined #RubyOnRails
[00:59:30] j3r0: has joined #RubyOnRails
[01:00:35] maesitos: has joined #RubyOnRails
[01:00:40] djbkd: has joined #RubyOnRails
[01:02:29] maesitos_: has joined #RubyOnRails
[01:03:05] Kilo`byte: has joined #RubyOnRails
[01:03:48] wldcordeiro: has joined #RubyOnRails
[01:03:58] Devalo: has joined #RubyOnRails
[01:04:16] tenderlove: has joined #RubyOnRails
[01:04:16] ensyde_: has joined #RubyOnRails
[01:04:25] maesitos: has joined #RubyOnRails
[01:05:17] wmoxam: has left #RubyOnRails: ()
[01:05:36] lele: has joined #RubyOnRails
[01:06:20] maesitos: has joined #RubyOnRails
[01:08:14] maesitos: has joined #RubyOnRails
[01:10:08] maesitos: has joined #RubyOnRails
[01:11:28] Cohedrin: has joined #RubyOnRails
[01:12:04] maesitos: has joined #RubyOnRails
[01:12:30] mr-spoon: has joined #RubyOnRails
[01:13:58] maesitos: has joined #RubyOnRails
[01:15:54] maesitos_: has joined #RubyOnRails
[01:16:24] baweaver: has joined #RubyOnRails
[01:16:56] Guest_: has joined #RubyOnRails
[01:17:21] DmitryBochkarev: has joined #RubyOnRails
[01:17:48] maesitos: has joined #RubyOnRails
[01:19:43] maesitos_: has joined #RubyOnRails
[01:20:16] podman: has joined #RubyOnRails
[01:21:33] maesitos: has joined #RubyOnRails
[01:22:47] sudoubuntu: has joined #RubyOnRails
[01:22:48] bujuzu: has joined #RubyOnRails
[01:23:28] maesitos: has joined #RubyOnRails
[01:23:43] Graphettion: has joined #RubyOnRails
[01:23:52] korzybski: has joined #RubyOnRails
[01:25:27] maesitos_: has joined #RubyOnRails
[01:27:19] maesitos: has joined #RubyOnRails
[01:29:21] bujuzu: Hello, is anyone interested in helping out with some questions regarding a server / production environment for a rails deployment?
[01:29:24] maesitos: has joined #RubyOnRails
[01:31:06] maesitos: has joined #RubyOnRails
[01:31:33] uberjar: has joined #RubyOnRails
[01:33:01] maesitos: has joined #RubyOnRails
[01:33:06] deuxclique: has joined #RubyOnRails
[01:34:20] bujuzu: has joined #RubyOnRails
[01:34:52] jesterfraud: has joined #RubyOnRails
[01:34:59] maesitos: has joined #RubyOnRails
[01:35:13] bronson: bujuzu: might make sense to just ask.
[01:35:34] delgiudices: has joined #RubyOnRails
[01:36:53] maesitos_: has joined #RubyOnRails
[01:37:20] rakm: has joined #RubyOnRails
[01:38:13] rafaelfranca: has joined #RubyOnRails
[01:38:46] maesitos: has joined #RubyOnRails
[01:39:19] htmldrum: has joined #RubyOnRails
[01:40:39] maesitos: has joined #RubyOnRails
[01:40:40] mercwithamouth: has joined #RubyOnRails
[01:42:35] mercwithamouth: has joined #RubyOnRails
[01:42:36] maesitos: has joined #RubyOnRails
[01:43:47] mercwithamouth: can someone help me get out of limbo? i'm trying to extend Devises registration controller...after going through several conversations and tutorials i've lost track. https://gist.github.com/anonymous/a78d7b2457e3be1ebbc1
[01:44:32] maesitos: has joined #RubyOnRails
[01:44:46] chouhoulis: has joined #RubyOnRails
[01:45:04] bujuzu: A non-rails sysadmin looking for best practices. Using rvm / passenger / nginx. Is it better to install rvm as root, which to my understanding makes whatever ruby you select a global setting, or is it best to tether it all to a user account (in which case I'm having a heck of a time getting the system services to find where everything lives)
[01:46:17] uberjar: bujuzu: depends on what kind of a shop you are
[01:46:24] maesitos_: has joined #RubyOnRails
[01:46:31] uberjar: why not root ?
[01:46:37] uberjar: if you're a norjmal startup I'd say root
[01:47:15] B4daBing73: has joined #RubyOnRails
[01:47:59] bujuzu: this app will live on a server which is dedicated it it and nothing else. from searching around, doing everything as root is not the preferred method. But if theres no harm in it, im indifferent
[01:48:37] maesitos: has joined #RubyOnRails
[01:48:46] user083: has joined #RubyOnRails
[01:49:59] uberjar: that's what I'd do... just make sure the actual ruby interpreter runtime that handles requests is not running as root and you should be good
[01:50:03] arBmind: has joined #RubyOnRails
[01:50:14] maesitos_: has joined #RubyOnRails
[01:52:12] maesitos_: has joined #RubyOnRails
[01:54:03] maesitos: has joined #RubyOnRails
[01:54:53] robbyoconnor: has joined #RubyOnRails
[01:55:56] maesitos: has joined #RubyOnRails
[01:57:53] maesitos: has joined #RubyOnRails
[01:58:03] rafaelfranca: has joined #RubyOnRails
[01:58:20] mercwithamouth: has left #RubyOnRails: ()
[01:59:16] sleungcy: has joined #RubyOnRails
[01:59:38] sleungcy: has joined #RubyOnRails
[01:59:48] maesitos: has joined #RubyOnRails
[02:01:43] maesitos: has joined #RubyOnRails
[02:03:42] maesitos: has joined #RubyOnRails
[02:05:31] delgiudices: I'm new to Ruby/Rails why does sometimes you pass params to functions with a hash ( :something => else ) and some other times you do it like this ( something: else )
[02:05:38] jenrzzz: has joined #RubyOnRails
[02:05:43] maesitos: has joined #RubyOnRails
[02:07:24] maesitos_: has joined #RubyOnRails
[02:08:45] johnflux: has joined #RubyOnRails
[02:08:45] johnflux: has joined #RubyOnRails
[02:09:15] Maletor: has joined #RubyOnRails
[02:09:19] maesitos: has joined #RubyOnRails
[02:10:19] alistairtweed: has joined #RubyOnRails
[02:11:07] Maletor: has joined #RubyOnRails
[02:11:19] maesitos: has joined #RubyOnRails
[02:13:04] maesitos: has joined #RubyOnRails
[02:14:44] unreal_: has joined #RubyOnRails
[02:14:59] maesitos: has joined #RubyOnRails
[02:16:54] maesitos: has joined #RubyOnRails
[02:17:18] sleungcy: has joined #RubyOnRails
[02:17:43] ppinkerton: has joined #RubyOnRails
[02:18:46] maesitos_: has joined #RubyOnRails
[02:20:41] maesitos: has joined #RubyOnRails
[02:22:34] maesitos_: has joined #RubyOnRails
[02:22:36] Megamos: has joined #RubyOnRails
[02:22:42] delgiudices: has joined #RubyOnRails
[02:24:29] maesitos: has joined #RubyOnRails
[02:24:55] akshat: has joined #RubyOnRails
[02:26:24] maesitos: has joined #RubyOnRails
[02:28:19] maesitos: has joined #RubyOnRails
[02:28:24] dirtibirdi: has joined #RubyOnRails
[02:30:13] maesitos_: has joined #RubyOnRails
[02:30:34] chagel: has joined #RubyOnRails
[02:31:32] rubyonrailed: has joined #RubyOnRails
[02:31:53] blackmesa: has joined #RubyOnRails
[02:32:08] maesitos: has joined #RubyOnRails
[02:32:13] ppinkerton: has joined #RubyOnRails
[02:33:59] maesitos: has joined #RubyOnRails
[02:35:23] sleungcy: has joined #RubyOnRails
[02:35:44] jottr: has joined #RubyOnRails
[02:35:51] maesitos: has joined #RubyOnRails
[02:37:22] uglybandersnatch: has joined #RubyOnRails
[02:37:48] maesitos: has joined #RubyOnRails
[02:38:12] goodcodeguy: has joined #RubyOnRails
[02:39:53] maesitos: has joined #RubyOnRails
[02:40:06] lessless: has joined #RubyOnRails
[02:40:31] lessless: Hello folks! What is the best way to wrap each pair of `collection_checkbox` elements into a div?
[02:41:02] DLSteve: has joined #RubyOnRails
[02:41:34] maesitos: has joined #RubyOnRails
[02:42:04] neilfse: has joined #RubyOnRails
[02:43:29] maesitos: has joined #RubyOnRails
[02:44:55] jottr_: has joined #RubyOnRails
[02:45:01] sypheren: has joined #RubyOnRails
[02:45:23] maesitos: has joined #RubyOnRails
[02:46:29] statelesscode: has joined #RubyOnRails
[02:47:18] maesitos: has joined #RubyOnRails
[02:49:00] jscheel: has joined #RubyOnRails
[02:49:09] maesitos: has joined #RubyOnRails
[02:49:25] tenderlove: has joined #RubyOnRails
[02:50:14] zave: has joined #RubyOnRails
[02:51:04] maesitos: has joined #RubyOnRails
[02:51:34] zave: has joined #RubyOnRails
[02:52:07] prgmmr: has joined #RubyOnRails
[02:52:42] joshkovach: has joined #RubyOnRails
[02:52:59] maesitos_: has joined #RubyOnRails
[02:53:59] nozpheratu: has joined #RubyOnRails
[02:54:51] maesitos: has joined #RubyOnRails
[02:56:46] maesitos: has joined #RubyOnRails
[02:58:26] deuxclique: has joined #RubyOnRails
[02:58:28] ppinkerton: has joined #RubyOnRails
[02:58:43] maesitos: has joined #RubyOnRails
[02:59:04] deuxclique: has joined #RubyOnRails
[03:00:20] codesoda: has joined #RubyOnRails
[03:00:34] maesitos: has joined #RubyOnRails
[03:02:31] maesitos: has joined #RubyOnRails
[03:04:21] maesitos: has joined #RubyOnRails
[03:05:33] Devalo: has joined #RubyOnRails
[03:05:46] Rodya_: has joined #RubyOnRails
[03:05:59] codesoda_: has joined #RubyOnRails
[03:06:19] maesitos: has joined #RubyOnRails
[03:08:14] maesitos: has joined #RubyOnRails
[03:09:35] SteenJobs: has joined #RubyOnRails
[03:10:06] maesitos: has joined #RubyOnRails
[03:10:41] shanemcd: has joined #RubyOnRails
[03:12:01] maesitos: has joined #RubyOnRails
[03:13:23] chouhoulis: has joined #RubyOnRails
[03:13:51] maesitos: has joined #RubyOnRails
[03:15:48] maesitos: has joined #RubyOnRails
[03:16:02] michae: has joined #RubyOnRails
[03:16:12] enitiz: has joined #RubyOnRails
[03:17:06] kies^: has joined #RubyOnRails
[03:17:39] maesitos: has joined #RubyOnRails
[03:17:42] chouhoulis: has joined #RubyOnRails
[03:18:17] underplank: has joined #RubyOnRails
[03:19:12] sudoubuntu: has joined #RubyOnRails
[03:19:38] maesitos: has joined #RubyOnRails
[03:20:12] mostlybadfly: has joined #RubyOnRails
[03:20:19] bronson: has joined #RubyOnRails
[03:20:34] robbyoconnor: has joined #RubyOnRails
[03:21:04] DmitryBochkarev: has joined #RubyOnRails
[03:21:32] maesitos: has joined #RubyOnRails
[03:21:43] astrofog: has joined #RubyOnRails
[03:23:26] maesitos_: has joined #RubyOnRails
[03:23:35] duncannz: has joined #RubyOnRails
[03:24:23] sleungcy: has joined #RubyOnRails
[03:25:16] maesitos: has joined #RubyOnRails
[03:27:11] maesitos_: has joined #RubyOnRails
[03:29:13] maesitos: has joined #RubyOnRails
[03:29:50] AntiSpamMeta: has joined #RubyOnRails
[03:30:31] duncannz: has joined #RubyOnRails
[03:30:32] krz: has joined #RubyOnRails
[03:30:59] maesitos: has joined #RubyOnRails
[03:31:05] jhack: has joined #RubyOnRails
[03:33:16] blackmesa: has joined #RubyOnRails
[03:34:56] sp1rs: has joined #RubyOnRails
[03:36:41] stardiviner: has joined #RubyOnRails
[03:42:51] pawnbox: has joined #RubyOnRails
[03:44:14] deuxcliq_: has joined #RubyOnRails
[03:44:40] rdavila: has joined #RubyOnRails
[03:45:41] dirtibirdi: has joined #RubyOnRails
[03:46:21] chagel: has joined #RubyOnRails
[03:52:54] DmitryBochkarev: has joined #RubyOnRails
[03:53:05] skiz: has joined #RubyOnRails
[03:53:14] groatyoats: has joined #RubyOnRails
[03:54:01] michae: Hey :D I've got a problem, I'd like to create a new Cart upon creation of a new User, with a relation from the cart to the user
[03:54:14] michae: But I can't figure out which callback to use so that the cart is available upon creation
[03:55:24] DmitryBochkarev: has joined #RubyOnRails
[03:58:11] rdavila: has joined #RubyOnRails
[03:58:45] sneakerhax: has joined #RubyOnRails
[03:59:19] leksster: has joined #RubyOnRails
[04:00:12] krz: has joined #RubyOnRails
[04:00:35] baweaver: has joined #RubyOnRails
[04:02:20] chagel: has joined #RubyOnRails
[04:02:52] Radar: michae: !rule0
[04:02:52] helpa: michae: Show rather than tell. Explaining your problem with code, stacktraces or errors is always preferred to explaining it with just text. Show us what's happening, rather than telling us. Put the code on https://gist.github.com and then give us the HTTP link to the Gist.
[04:04:36] SteenJobs: has joined #RubyOnRails
[04:06:10] jhack: anyone know how i can use rails api and respond_with AND respond_to?
[04:06:15] jhack: responder gem isn’t working
[04:08:28] makenoise: has joined #RubyOnRails
[04:12:38] pawnbox: has joined #RubyOnRails
[04:13:30] jottr: has joined #RubyOnRails
[04:13:50] jetpack_joe: has joined #RubyOnRails
[04:13:52] flappynerd: has joined #RubyOnRails
[04:16:46] braincrash: has joined #RubyOnRails
[04:17:16] chagel: has joined #RubyOnRails
[04:17:46] tweeeaks: has joined #RubyOnRails
[04:17:52] flappynerd: so I'm trying to do this: http://guides.rubyonrails.org/form_helpers.html#binding-a-form-to-an-object but I get the following error: "First argument in form cannot contain nil or be empty"
[04:17:55] flappynerd: what's up with that
[04:18:14] flappynerd: there's practically zero difference between that code and my code
[04:18:17] flappynerd: only the model name
[04:18:18] ppinkerton: has joined #RubyOnRails
[04:18:29] flappynerd: @employee = Employee.new
[04:18:33] flappynerd: form_for @employee
[04:18:52] flappynerd: when I dump the @employee in the controller it is what I would expect, it's an Employee model instance
[04:22:11] makenoise: See if `form_for Employee.new` works instead of `@employee`
[04:22:14] bronson: has joined #RubyOnRails
[04:22:16] chagel: has joined #RubyOnRails
[04:22:18] Nuck: Do you guys know if there's any word on future direction of the asset pipeline/sprockets?
[04:22:29] makenoise: Don't keep it that way, but if it works it means your controller isn't passing @employee along to that view properly.
[04:22:52] Nuck: I'm curious since there's been so much change in JS-land if we'll start to see some of that trickle down to us soon
[04:22:54] havenwood: flappynerd: Gist the whole controller new method and the form_for line verbatim?
[04:23:16] sp1rs: has joined #RubyOnRails
[04:23:39] Nuck: Webpack/browserify, source maps, newer pipeline systems (Broccoli, Gulp), NPM/Bower, etc.
[04:24:07] jetpack_joe: has joined #RubyOnRails
[04:24:16] Nuck: But it seems like very little of this has made its way to Rails, partially because all the tech for it is written in JS
[04:25:33] jetpack_joe: has joined #RubyOnRails
[04:26:09] Nuck: In fact, I heard (dunno where) like a year ago that source maps are coming to Sprockets but I've heard nothing since
[04:27:05] johnflux: has joined #RubyOnRails
[04:27:15] flappynerd: havenwood, http://hastebin.com/wogezeqaga.rb
[04:27:28] havenwood: flappynerd: Application Error
[04:27:41] trxtr: has joined #RubyOnRails
[04:29:32] flappynerd: havenwood, oops, here ya go http://hastebin.com/pefisiwahu.rb
[04:29:54] havenwood: flappynerd: Application Error
[04:30:00] flappynerd: "First argument in form cannot contain nil or be empty"
[04:30:19] havenwood: flappynerd: Try gisting the code, the actual code pasted preferably.
[04:30:27] havenwood: flappynerd: gist.github.com
[04:30:35] flappynerd: that is the actual code
[04:30:44] havenwood: flappynerd: Application Error
[04:30:55] flappynerd: I'm not sure what you mean by that
[04:31:06] havenwood: flappynerd: When I click on your link, that's what I get.
[04:31:12] havenwood: flappynerd: gist.github.com
[04:31:17] flappynerd: oh, I see, ok
[04:32:28] queequeg1: has joined #RubyOnRails
[04:33:07] havenwood: nuck: Doesn't seem behind to me, just parallel. Afaik source maps work and working out edge rails kinks can hardly be blamed before its released.
[04:33:30] DmitryBochkarev: has joined #RubyOnRails
[04:33:39] Nuck: Ah, good. It's not been showing up in a lot of "what's new in Rails 5" articles
[04:33:58] havenwood: nuck: Yeah, broken on edge but I think that's planned to get fixed. Dunno!
[04:34:13] Nuck: Still would like to see a bundling based on es6 import/export
[04:34:43] blackmesa: has joined #RubyOnRails
[04:34:47] Nuck: Don't they already do something similar for SCSS @import?
[04:34:55] sevenseacat: has joined #RubyOnRails
[04:34:59] flappynerd: havenwood, https://gist.github.com/anonymous/d317315bf05b935bbb66
[04:35:14] Nuck: I wonder if a similar hook could be done for Babel?
[04:35:23] havenwood: nuck: Employee.create
[04:36:06] havenwood: flappynerd: is it: "or be empty"
[04:36:13] Nuck: havenwood: are you hiring me, bro? Shouldn't you take me out on a date first? ;)
[04:36:28] havenwood: nuck: misstell!
[04:36:40] havenwood: nuck: touche
[04:36:51] chouhoul_: has joined #RubyOnRails
[04:36:51] flappynerd: havenwood, not sure what you mean, sorry
[04:37:16] flappynerd: havenwood, yes it seems evident that @employee is mostly what you would, effectively call "empty", e.g. the fields inside of it are nil
[04:37:19] havenwood: flappynerd: I dunno what i mean either... long day!
[04:37:22] flappynerd: but it is a new employee instance
[04:37:28] flappynerd: and that's the code that the guides are using
[04:39:04] DmitryBochkarev: has joined #RubyOnRails
[04:39:07] havenwood: flappynerd: I'm too distracted and need to relocate. If someone doesn't beat me to it I'll try to look closer when I land.
[04:40:23] rizenine: has joined #RubyOnRails
[04:42:06] flappynerd: k, no worries, thanks
[04:43:33] michae: has left #RubyOnRails: ("WeeChat 1.1.1")
[04:44:55] makenoise: flappynerd: did you try replacing it with Employee.new?
[04:45:05] draig: has joined #RubyOnRails
[04:45:13] flappynerd: makenoise, hmm, odd that does work
[04:45:22] flappynerd: I guess I must have messed something up somewhere else
[04:45:25] makenoise: So it just means that the controller isn't passing it on right
[04:45:27] nachoman: has joined #RubyOnRails
[04:47:34] makenoise: Where is the actual call to render that view happening?
[04:48:38] kdough: has joined #RubyOnRails
[04:49:03] flappynerd: meh, ok it was actually just a typo
[04:49:10] flappynerd: all good now, pebkac :)
[04:49:58] makenoise: It happens, what was the typo? I didn't see it in the gist
[04:52:33] underplank: has joined #RubyOnRails
[04:53:35] Flex: has joined #RubyOnRails
[04:56:00] Rodya_: has joined #RubyOnRails
[04:56:12] dopamean_: has joined #RubyOnRails
[04:59:20] godzillaenlacasa: has joined #RubyOnRails
[05:02:10] tweeeaks: has joined #RubyOnRails
[05:03:04] nachoman: has joined #RubyOnRails
[05:03:06] pawnbox: has joined #RubyOnRails
[05:04:55] djbkd: has joined #RubyOnRails
[05:07:13] Devalo: has joined #RubyOnRails
[05:08:38] djbkd: has joined #RubyOnRails
[05:10:18] pawnbox: has joined #RubyOnRails
[05:12:03] makenoise: has joined #RubyOnRails
[05:14:20] pawnbox: has joined #RubyOnRails
[05:14:43] sevenseacat: has joined #RubyOnRails
[05:15:01] tenderlove: has joined #RubyOnRails
[05:15:20] josephkokenge: has joined #RubyOnRails
[05:19:49] SteenJobs: has joined #RubyOnRails
[05:23:51] Megamos: has joined #RubyOnRails
[05:24:26] pawnbox: has joined #RubyOnRails
[05:25:40] Eswar: has joined #RubyOnRails
[05:25:43] makenoise: has joined #RubyOnRails
[05:27:24] njero: has joined #RubyOnRails
[05:31:13] chagel: has joined #RubyOnRails
[05:31:48] htmldrum: has joined #RubyOnRails
[05:32:03] maesitos: has joined #RubyOnRails
[05:34:32] ur5us: has joined #RubyOnRails
[05:35:09] Rodya_: has joined #RubyOnRails
[05:35:31] sp1rs: has joined #RubyOnRails
[05:35:48] dextertzu: has joined #RubyOnRails
[05:36:05] blackmesa: has joined #RubyOnRails
[05:38:34] SteenJobs: has joined #RubyOnRails
[05:39:11] sp1rs: has joined #RubyOnRails
[05:40:08] Devalo: has joined #RubyOnRails
[05:42:17] Chagel_: has joined #RubyOnRails
[05:43:30] rvanlieshout: has joined #RubyOnRails
[05:45:08] Eswar: has joined #RubyOnRails
[05:45:16] robbyoconnor: has joined #RubyOnRails
[05:47:25] Cervajz: has joined #RubyOnRails
[05:49:37] swarm_lurker: has joined #RubyOnRails
[05:50:08] swarm_lurker: has left #RubyOnRails: ()
[05:51:05] LowTemplar: has joined #RubyOnRails
[05:51:19] LowTemplar: Hello fellow Rail smiths!
[05:52:54] LowTemplar: I'm seeking wisdom tonight. I have a rails app thats deployed through openshift, and my routes root isn't being followed. Instead I land on public/index.html. Anyone have any idea whats broke? It works locally, just not when on the cloud
[05:53:27] rvanlieshout: remove your public/index.html
[05:53:41] rvanlieshout: a webserver first servers a static asset if exists, then passes it on to the rails serve
[05:55:15] LowTemplar: I tried removing that, but when I do, the site errors out with a 500
[05:55:46] rvanlieshout: with what in the log?
[05:56:17] mary5030: has joined #RubyOnRails
[05:56:38] deuxclique: has joined #RubyOnRails
[05:57:44] LowTemplar: I'll try to check, forgot that ruby keeps those for me
[05:59:56] LowTemplar: I took up rails for a project at work, my boss has absolutely no idea what he is doing and I'm only scratching the surface of this ugly beautiful thing called rails
[06:00:35] LowTemplar: Absolutely nothing in log, darn thats dissapointing
[06:00:41] rvanlieshout: that's solvable
[06:00:58] rvanlieshout: start a rails server instance in the foreground
[06:01:05] rvanlieshout: RAILS_ENV=production bundle exec rails server
[06:01:15] rvanlieshout: then in a separate window: curl localhost:3000
[06:01:34] rvanlieshout: the 500 is most likely caused by the webserver getting a non valid response from the rails server in the backend
[06:03:02] techsethi: has joined #RubyOnRails
[06:03:04] guest56: has joined #RubyOnRails
[06:03:56] rvanlieshout: away for a few min
[06:04:11] Rodya_: has joined #RubyOnRails
[06:05:11] techsethi_: has joined #RubyOnRails
[06:07:22] LowTemplar: Oh wow, I think you just found my error. Missing `secret_token` and `secret_key_base` for 'production' environment, set these values in `config/secrets.yml`
[06:08:24] rvanlieshout: which really is the #1 cause for me, but this helps you debugging :)
[06:09:42] LowTemplar: Why can't all these 500 tutorial pages i've looked at be as helpful as you were in 5 minutes?
[06:10:16] Rodya_: has joined #RubyOnRails
[06:10:16] nk121: has joined #RubyOnRails
[06:10:45] trosborn: has joined #RubyOnRails
[06:11:51] LowTemplar: Ah hell, the tutorial I followed to get this thing working on the cloud had me erase several of the files that came with it. Can't follow the instructions for fixing because of it -_-
[06:12:09] SteenJobs: has joined #RubyOnRails
[06:12:09] Radar: you should follow a better tutorial ;)
[06:12:36] LowTemplar: It is the 3rd that I tried. Flew further than most of them did I guess haha.
[06:12:47] Radar: !r4ia is the one I wrote
[06:12:47] helpa: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Rebecca Skinner, Steve Klabnik, Ryan Bigg, Yehuda Katz
[06:12:51] Radar: well, one of them
[06:12:55] Radar: This one is about 600 pages though
[06:13:07] Radar: takes you from go to woah
[06:13:23] Radar: and it's now time for me to go. Leave me a message if you have any questions.
[06:13:27] LowTemplar: Will it tell me how to work with openshift? I have done 0 programming today
[06:13:38] LowTemplar: Messages will find you lol
[06:14:02] czerasz: has joined #RubyOnRails
[06:14:26] sp1rs: has joined #RubyOnRails
[06:16:11] brianpWins: has joined #RubyOnRails
[06:17:54] bronson: has joined #RubyOnRails
[06:19:08] Uber|Dragon: has joined #RubyOnRails
[06:22:54] Rodya_: has joined #RubyOnRails
[06:25:34] pawnbox: has joined #RubyOnRails
[06:33:17] SteenJobs: has joined #RubyOnRails
[06:36:01] ur5us: has joined #RubyOnRails
[06:36:42] chagel: has joined #RubyOnRails
[06:37:18] aganov: has joined #RubyOnRails
[06:38:10] dionysus69: has joined #RubyOnRails
[06:38:54] blackmesa: has joined #RubyOnRails
[06:39:34] sp1rs: has joined #RubyOnRails
[06:40:21] dopie: has joined #RubyOnRails
[06:44:39] njero: has joined #RubyOnRails
[06:50:15] tvw: has joined #RubyOnRails
[06:52:50] intrigueD: has joined #RubyOnRails
[06:54:58] djbkd: has joined #RubyOnRails
[06:55:03] Eswar: has joined #RubyOnRails
[06:56:01] baweaver: has joined #RubyOnRails
[06:56:47] SteenJobs: has joined #RubyOnRails
[07:00:48] Eswar: has joined #RubyOnRails
[07:01:49] Pazician: has joined #RubyOnRails
[07:03:17] jenrzzz: has joined #RubyOnRails
[07:03:41] dopie: has joined #RubyOnRails
[07:04:38] solars: has joined #RubyOnRails
[07:07:37] neilfse: has joined #RubyOnRails
[07:09:05] zave: has joined #RubyOnRails
[07:12:09] techsethi: has joined #RubyOnRails
[07:12:27] alistairtweed: has left #RubyOnRails: ()
[07:12:31] waseem__: has left #RubyOnRails: ()
[07:13:07] waseem_: has joined #RubyOnRails
[07:13:32] sneep: Hi. When you select from a related table, e.g., if you have a users and a profiles table, using User.profile, the raw SQL will start with "SELECT profiles.* ...", right?
[07:14:27] waseem_: sneep: !try
[07:14:27] helpa: sneep: Why don't you try it and find out for yourself?
[07:14:29] sneep: Is there an easy way to also select from users in one go?
[07:14:33] scepticulous: has joined #RubyOnRails
[07:15:26] sneep: Sorry, s/User.profile/User.first.profile/
[07:16:19] waseem_: sneep: I don't understand your question. Can you elaborate more? What do you mean by slect from users in one go?
[07:16:31] waseem_: sneep: You might be looking for User.find.
[07:16:34] sneep: Okay. The raw SQL I'd like to get is "SELECT users.something, profiles.something"
[07:16:40] arup_r: has joined #RubyOnRails
[07:17:07] waseem_: sneep: http://guides.rubyonrails.org/active_record_querying.html#selecting-specific-fields
[07:17:10] lxsameer: has joined #RubyOnRails
[07:18:28] underplank: has joined #RubyOnRails
[07:20:26] htmldrum: has joined #RubyOnRails
[07:20:40] sneep: Hmm, let's see...
[07:21:22] sneep: I'm getting a AssociationNotFoundError with that, though the raw SQL looks good
[07:22:21] sneep: I'll try adding an association
[07:26:30] hnanon: has joined #RubyOnRails
[07:27:01] hnanon: I'm trying to do the following in a collection_select: { prompt: "Job location", action_view == "edit" ? {} : { selected: @user.company.city.name } }
[07:27:33] hnanon: It's obviously not working and giving me the error: syntax error, unexpected '}', expecting => ...ed: @user.compan...
[07:27:57] arup_r: hnanon: show the full code as a gist
[07:28:01] baweaver: has joined #RubyOnRails
[07:28:16] hnanon: I want the selected option to not be on the form if the action is "edit"
[07:28:31] arup_r: and collection_select is a method.. so collection_select: .. is a wrong syntax
[07:28:56] hnanon: arup_r: Yes, that's just part of the sentence grammar, not the code.
[07:29:00] mices: my blueimp-image-gallery will display titles, but not descriptions
[07:29:10] hnanon: I'm trying to do that with the collection_select method.
[07:29:33] hnanon: <%= f.collection_select :city_id, City.order(:name), :id, :name, { prompt: "Job location", action_view == "edit" ? {} : { selected: @user.company.city.name } }, { class: "form-field" } %>
[07:29:42] arup_r: cool, now let me see
[07:30:36] hnanon: For new forms, I want to show the city name of the user company.
[07:30:51] hnanon: For edit forms, I want the existing value to be selected.
[07:31:04] chagel: has joined #RubyOnRails
[07:31:33] arup_r: then this should work fine, you don't need those extra controls <%= f.collection_select :city_id, City.order(:name), :id, :name, prompt: "Job location", class: "form-field" %>
[07:32:35] hnanon: arup_r: That won't show the user company city on new forms.
[07:32:50] hnanon: It will show "Job location."
[07:32:53] maesitos: has joined #RubyOnRails
[07:32:56] vmarcetic: has joined #RubyOnRails
[07:33:00] jas02: has joined #RubyOnRails
[07:33:20] arup_r: yeah, show the controller code, I will add code there..
[07:33:30] arup_r: you don't need anything here..
[07:34:21] hnanon: I'm not following.
[07:34:21] arup_r: Just assign the new object which `f` wrapped, the company in the controller new action.. and it will be shown in your dropdown
[07:34:58] sneep: waseem_: Sorry. Not sure why I got an AssociationNotFoundError earlier. Maybe I forgot to restart my server or something! It's working, so thanks a lot!!
[07:35:01] techsethi: has joined #RubyOnRails
[07:35:11] waseem_: sneep: Sure, no problem.
[07:35:36] arup_r: well. def new; @user = User.new(company_id: Company.first) ;end something like this you have to put inside the controller.. hnanon
[07:36:16] arup_r: That's an example, correct the attribute names as per your usecase. This is the idea.
[07:37:08] arup_r: ** @user = User.new(company: Company.first)
[07:38:23] hahuang65: has joined #RubyOnRails
[07:38:41] robbyoconnor: has joined #RubyOnRails
[07:39:05] njero: Hey.. I'm trying to add realtime analytics in my rails app for clients. Most data can be generated from server events. However I would like to know the convention( Rails ;) ). Will it be good to track events with help of sidekiq workers so that they write data to db at specific time intervals. Is it recommended to use another db just for analytics?
[07:40:17] blackmesa: has joined #RubyOnRails
[07:40:25] hnanon: arup_r: That's very cool. I forgot you could do that. I'm trying with @job = Job.new(city_id: @user.company.city.name)
[07:40:44] hnanon: But it's only picking the first city and the @user.company.city.
[07:40:51] Pazician: has joined #RubyOnRails
[07:41:57] hnanon: nevermind.
[07:42:12] hnanon: I changed it to @job = Job.new(city_id: @user.company.city.id) and it's working now.
[07:42:17] hnanon: Thank you!
[07:42:24] mices: maybe this is a clue, after displaying and closing an image, scrollbars disappear and the mouse scrollwheel no longer works on the page but I can still pg-up and pg-dn
[07:42:35] vmarcetic: has joined #RubyOnRails
[07:42:59] defsdoor: has joined #RubyOnRails
[07:43:06] sp1rs: has joined #RubyOnRails
[07:45:21] MuffinPimp: has joined #RubyOnRails
[07:45:34] uglybandersnatch: has joined #RubyOnRails
[07:45:56] gaf_: has joined #RubyOnRails
[07:46:51] robbyoconnor: has joined #RubyOnRails
[07:48:11] robbyoconnor: has joined #RubyOnRails
[07:49:04] darutoko: has joined #RubyOnRails
[07:49:32] ziyadb: has joined #RubyOnRails
[07:49:58] moeabdol: has joined #RubyOnRails
[07:50:14] alistairtweed: has joined #RubyOnRails
[08:03:52] astrofog: has joined #RubyOnRails
[08:07:16] mary5030_: has joined #RubyOnRails
[08:08:15] solars: hey, is anyone using nokogiri with sax? I noticed it seems to be smaller than the dom/reader parsers
[08:08:55] sp1rs: has joined #RubyOnRails
[08:08:59] robbyoconnor: has joined #RubyOnRails
[08:13:26] ayoros: has joined #RubyOnRails
[08:13:54] llakey: has joined #RubyOnRails
[08:16:59] comrad: has joined #RubyOnRails
[08:17:31] srinidhi: has joined #RubyOnRails
[08:19:02] madebymarkca: has joined #RubyOnRails
[08:21:36] scope: has joined #RubyOnRails
[08:23:24] scope: anyone here good with ruby on rails specifically design
[08:23:28] tjbiddle: has joined #RubyOnRails
[08:23:46] scope: im trying to add a funky background to a website but have no idea where to put it
[08:23:59] bronson: has joined #RubyOnRails
[08:24:00] scope: i have 3 files one html one css and one js
[08:24:34] scope: i added the files into the places i thought were correct but i get this error
[08:24:36] scope: Asset was not declared to be precompiled in production. Add `Rails.application.config.assets.precompile += %w( matrix.css )` to `config/initializers/assets.rb` and restart your server
[08:24:46] Ergo^: has joined #RubyOnRails
[08:30:10] antgel: has joined #RubyOnRails
[08:30:22] mrbubbles: has joined #RubyOnRails
[08:34:54] blackhuey: has joined #RubyOnRails
[08:37:30] mark1: has joined #RubyOnRails
[08:38:30] mark1: has joined #RubyOnRails
[08:40:00] arup_r: has joined #RubyOnRails
[08:40:04] jenrzzz: has joined #RubyOnRails
[08:41:05] blackmesa: has joined #RubyOnRails
[08:42:23] hahuang61: has joined #RubyOnRails
[08:43:40] czerasz: has joined #RubyOnRails
[08:44:03] artto: has joined #RubyOnRails
[08:45:51] nettoweb: has joined #RubyOnRails
[08:46:18] tambet: has joined #RubyOnRails
[08:54:09] baweaver: has joined #RubyOnRails
[08:55:07] scope: has joined #RubyOnRails
[08:56:12] Dbugger: has joined #RubyOnRails
[08:56:15] scope: if i want to add a raining code style background to a ROR app where would i place the files i have 3 html css and js
[08:56:16] Dbugger: Good morning
[08:56:30] scope: when i run the app i get this error
[08:56:32] scope: Asset was not declared to be precompiled in production. Add `Rails.application.config.assets.precompile += %w( matrix.css )` to `config/initializers/assets.rb` and restart your server
[08:56:35] scope: good afternoon
[08:56:38] tranvuong: has joined #RubyOnRails
[08:57:10] matthewd: scope: Have you done the thing it's telling you to do?
[08:57:24] scope: i have no idea how to hahah
[08:57:33] scope: sorry im still learnin its the first time i have this error
[08:57:45] matthewd: You don't know how to "Add `Rails.application.config.assets.precompile += %w( matrix.css )` to `config/initializers/assets.rb`"?
[08:57:51] scope: thats correct
[08:57:57] matthewd: It's giving you a line of code, and a filename
[08:57:58] scope: as i dont have a config/assets
[08:58:12] matthewd: Is this a new application?
[08:58:20] scope: ah ok so this Rails.application.config.assets.precompile += %w( matrix.css )
[08:58:35] scope: needs to be placed here config/initializers/assets.rb
[08:58:43] scope: does it matter where
[08:59:10] matthewd: So you do have the file?
[08:59:35] scope: yer i found it being a little stressed and confused im not looking at things properly
[09:00:51] scope: it didnt work now my background is just black
[09:00:54] scope: with no running code
[09:07:44] snowy: has joined #RubyOnRails
[09:08:07] tjbiddle: has joined #RubyOnRails
[09:08:21] jsrn_: has joined #RubyOnRails
[09:09:30] marr: has joined #RubyOnRails
[09:09:53] msyvich: has joined #RubyOnRails
[09:11:58] scope: hhhmm what if i was to start form scratch create the running code background first then add everything else after would that solve the problem
[09:12:10] yxejamir: has joined #RubyOnRails
[09:12:39] adre: has joined #RubyOnRails
[09:14:54] Zadrel: has joined #RubyOnRails
[09:15:01] sp1rs: has joined #RubyOnRails
[09:17:08] ferr: has joined #RubyOnRails
[09:18:01] trxtr: has joined #RubyOnRails
[09:18:35] scope: this is what im adding http://thecodeplayer.com/walkthrough/matrix-rain-animation-html5-canvas-javascript
[09:20:00] trosborn: has joined #RubyOnRails
[09:22:00] mrbubbles: has joined #RubyOnRails
[09:22:01] htmldrum: has joined #RubyOnRails
[09:22:09] artto: has joined #RubyOnRails
[09:23:30] msyvich: has joined #RubyOnRails
[09:27:33] trosborn: has joined #RubyOnRails
[09:28:49] Chagel_: has joined #RubyOnRails
[09:31:36] scope: if not can anyone point me in the direction of a tutorial that could help
[09:31:40] adre: has joined #RubyOnRails
[09:31:56] techsethi: has joined #RubyOnRails
[09:32:04] astrofog: has left #RubyOnRails: ("Leave")
[09:33:41] maesitos: has joined #RubyOnRails
[09:33:48] chagel: has joined #RubyOnRails
[09:38:56] n008f4g_: has joined #RubyOnRails
[09:39:51] blackmesa: has joined #RubyOnRails
[09:41:33] srinidhi: has joined #RubyOnRails
[09:41:52] Palsson: has joined #RubyOnRails
[09:42:06] htmldrum: has joined #RubyOnRails
[09:44:21] sp1rs: has joined #RubyOnRails
[09:46:29] arup_r: has joined #RubyOnRails
[09:47:11] nettoweb: has joined #RubyOnRails
[09:47:54] BtcBen: has joined #RubyOnRails
[09:49:01] sp1rs: has joined #RubyOnRails
[09:49:25] uglybandersnatch: has joined #RubyOnRails
[09:51:06] pawnbox: has joined #RubyOnRails
[09:51:48] GreekFreak: has joined #RubyOnRails
[09:53:38] guest56: has joined #RubyOnRails
[09:54:06] ur5us: has joined #RubyOnRails
[09:54:41] DoubleMalt: has joined #RubyOnRails
[09:54:41] jeanlinux: has joined #RubyOnRails
[09:55:42] GreekFreak: I have successfully deployed my code to my production server using Capistrano 3. I am now trying to deploy a staging server but it keeps bombing out. It kept complaining that config.eager_load was not set (but they were). I subsequently figured out that it wanted an environment "staging.rb" and the relevant "staging" database adapter. However this led to the server wanting a "production" database adapter. So I changed the adapter on the server
[09:55:42] GreekFreak: back to "production" and now the deploy complains that 'staging' database is not configured. What am I doing wrong in the setup of stages in Capistrano 3?
[09:56:10] antgel: has joined #RubyOnRails
[09:57:45] chagel: has joined #RubyOnRails
[10:00:48] scepticulous: I am working on a rails app and I am defining a constant within the model like class User; MAGIC_CONSTANT=42; end ... in development booting rails always causes a warning like "already initialized constant MAGIC_CONSTNAT".. Any hint, how to avoid this ?
[10:02:30] tbuehlmann: MAGIC_CONSTNAT, typo?
[10:02:48] scepticulous: yepp tipo. i just made up the class and name
[10:03:10] defsdoor: has joined #RubyOnRails
[10:03:12] sp1rs: has joined #RubyOnRails
[10:03:31] tbuehlmann: that's why you shouldn't use fake examples
[10:04:21] scepticulous: yeah, I just wanted to have the shortest possible example, but good point
[10:06:51] ur5us: has joined #RubyOnRails
[10:12:06] Irikos: has joined #RubyOnRails
[10:16:27] dirtibirdi: has joined #RubyOnRails
[10:16:55] hayden_: has joined #RubyOnRails
[10:18:33] chouhoulis: has joined #RubyOnRails
[10:19:16] mfaeh: has joined #RubyOnRails
[10:19:38] thecyclone: has joined #RubyOnRails
[10:20:27] djbkd: has joined #RubyOnRails
[10:21:11] GreekFreak: I managed to solve my problem by putting both an 'production' adapter and a 'staging' adapter in my database.yml file. Keeps both the server and Capistrano happy :P
[10:21:32] vasilakisFiL: has joined #RubyOnRails
[10:21:35] vasilakisFiL: I have this class: http://pastie.org/private/qyocshcojj5r3ofyftszda (Comment is another AR model). When I call Statistic::Comment.stats from rails console, it works. When I call it from a rake task I get NameError: uninitialized constant Statistic::Comment::Comment on line 6.
[10:21:38] vasilakisFiL: what could be the issue ?
[10:21:53] arBmind: has joined #RubyOnRails
[10:23:40] GreekFreak: kalws ton vasilakisfil!
[10:23:54] srinidhi: has joined #RubyOnRails
[10:24:30] trosborn: has joined #RubyOnRails
[10:24:35] GreekFreak: try wrapping the 'Comment' class in a 'Statistic' module. OR try doing Statistic::Comment in line 6. (I'll edit your pastie on what I mean about the module)
[10:25:12] vasilakisFiL: I have 2 distinct classes: Statistic::Comment and Comment. On line 6 I want to call Comment
[10:25:54] GreekFreak: vasilakisfil, ah. that's your problem. It looks for your 'line 6' Comment within the namespace of Statistic::Comment
[10:26:08] vasilakisFiL: hmm so I need to do ::Comment ?
[10:26:18] ferr: Hey, do you guys know any free software to track rails errors in production?
[10:26:28] vasilakisFiL: I am confused why it's working correctly from the rails console but not from the rake task :/
[10:26:52] GreekFreak: vasilakisfil, I had that problem a while ago. I think ::Comment will work. test it and see
[10:26:54] bronson: has joined #RubyOnRails
[10:27:42] GreekFreak: vasilakisfil, the console works a bit different. It loads more of the code but the rake loads only what you include in the rake file. So your console knows that ::Comment exists, but the rake file doesn't have it
[10:27:52] mrbubbles: has joined #RubyOnRails
[10:27:54] GreekFreak: try inluding the Comment class in the rake file and see if that makes a difference
[10:28:40] vasilakisFiL: ok I am trying it now and see..but if I had anyother class inside Statistics::Comment like Foobar wouldn't that work without calling ::Foobar ?
[10:29:09] vasilakisFiL: is it because I have Comment inside Statistics and Comment outside statistics ?
[10:30:08] GreekFreak: vasilakisfil, I'm not 100% sure, but yes it would. I think it's getting confused. I had similar issues when I worked with Engines and had the same file name in the parent app and an extended version of the class in my engine. It gets tricky because of how rails defaults for certain situations
[10:31:05] GreekFreak: vasilakisfil, if you had Foobar, it knows to look for the file, but because you have Comment in Statistics::Comment, it assumes you're talking about the same one. Again, I'm not 100% sure of the mechanics but it's has something to do with that
[10:33:23] pawnbox: has joined #RubyOnRails
[10:39:15] Palsson: has joined #RubyOnRails
[10:42:35] sevenseacat: has joined #RubyOnRails
[10:43:37] FooMunki: has joined #RubyOnRails
[10:47:17] [gmi]: has joined #RubyOnRails
[10:49:09] llakey: has left #RubyOnRails: (".")
[10:49:16] croberts: has joined #RubyOnRails
[10:49:35] pawnbox_: has joined #RubyOnRails
[10:51:05] uglybandersnatch: has joined #RubyOnRails
[10:54:55] tambet: has joined #RubyOnRails
[10:55:19] baweaver: has joined #RubyOnRails
[10:56:01] jeanlinux: has joined #RubyOnRails
[10:58:52] j3r0: has joined #RubyOnRails
[10:59:58] msyvich: Is there a way of using string interpolation within a %w structure? e.g. %w( "#{user}"@10.10.10.10 )
[11:01:36] msyvich: Ah got it, just need %W
[11:01:55] webdestroya: has joined #RubyOnRails
[11:03:39] flashpoint9: has joined #RubyOnRails
[11:05:08] RTG`: scepticulous: are you loading/requiring that model multiple times? eg require it after rails has already autoloaded it
[11:07:26] maesitos: has joined #RubyOnRails
[11:10:44] arup_r: has joined #RubyOnRails
[11:12:51] sp1rs: has joined #RubyOnRails
[11:14:29] artto: has joined #RubyOnRails
[11:15:01] laser_: has joined #RubyOnRails
[11:15:04] trinaldi: has joined #RubyOnRails
[11:15:23] laser_: has left #RubyOnRails: ()
[11:15:31] maesitos: has joined #RubyOnRails
[11:16:13] Champion_The: has joined #RubyOnRails
[11:16:58] Champion_The: hi, if I use font-awesome gem it applies only for application layout, how make rails to apply for my custom layout?
[11:19:28] chouhoulis: has joined #RubyOnRails
[11:22:36] arup_r: Actually, you can use it to any other layouts also if you include them..
[11:22:47] sevenseacat: font-awesome is a stylesheet and has no concept of application layouts
[11:23:49] arup_r: yeah, but have to include them..
[11:24:13] arup_r: to the menifest files
[11:24:31] Champion_The: but it doesnt load up to that layout
[11:24:32] arup_r: and that menifest file also need to be referenced by any layouts..
[11:24:40] hayden_: has joined #RubyOnRails
[11:24:40] Champion_The: only application.scss.css
[11:25:08] arup_r: Champion_The: In your other layout you referenced the application.scss.css ?
[11:25:23] arup_r: like style_sheet_link_tag ...
[11:25:47] Champion_The: i use 2 layouts, index and application
[11:25:52] Champion_The: in both i have
[11:25:59] arup_r: Champion_The: gist please
[11:26:15] arup_r: include the <head> of both layouts
[11:26:49] rodfersou: has joined #RubyOnRails
[11:28:01] pawnbox: has joined #RubyOnRails
[11:29:06] Champion_The: <%= stylesheet_link_tag "index" %> and <%= stylesheet_link_tag "application" %>
[11:29:16] Champion_The: and then in my /stylesheets
[11:29:41] Champion_The: i heve 2 files index.scss.erb and application.scss.erb
[11:30:14] Champion_The: and both files have *= require font-awesome
[11:30:24] Champion_The: works only for application
[11:31:00] sevenseacat: well if you dont answer questions you're asked, no-one can help you
[11:31:05] sevenseacat: "doesnt work" also isnt something we can fix
[11:31:12] nettoweb: has joined #RubyOnRails
[11:32:01] Champion_The: I said earlier that font-awesome doesn't load up to index but application
[11:32:05] Champion_The: index i use for homepage
[11:32:10] Champion_The: and application for the rest
[11:32:39] sevenseacat: so it gives you an error?
[11:32:41] ldnunes: has joined #RubyOnRails
[11:32:49] Champion_The: if i take a look at source of the index page theres no font-awesome css file
[11:32:52] defsdoor: has joined #RubyOnRails
[11:33:20] Champion_The: can i send a link of my website here?
[11:33:28] sevenseacat: you can gist your code as requested
[11:33:55] techsethi: has joined #RubyOnRails
[11:36:22] Irikos: has left #RubyOnRails: ()
[11:36:45] Irikos: has joined #RubyOnRails
[11:37:27] Irikos: Hello! After playing with RoR for a while, I decided to read the guides(best idea ever!). Anyway, was wondering, is Model.all.each do |model| ALWAYS a bad practice (compared to Model.find_each), or just when using very large number of records? What's the everyday, best way, to parse through an entire Model's db?
[11:37:28] pawnbox: has joined #RubyOnRails
[11:38:02] maximski: has joined #RubyOnRails
[11:38:18] nettoweb: has joined #RubyOnRails
[11:38:22] sevenseacat: its not a common practice to iterate over an entire table
[11:38:25] arup_r: Champion_The: just to confirm both parties. did you register the custom menifest file in the assets.rb file ? just asking
[11:39:50] Champion_The: i learn rails
[11:39:59] Irikos: sevenseacat, sure, I can see why, but I still need to do it. This "necessity" has appeared in the past in different requirements (in interviews as well), and I always used Model.all.each. I was curious if that was a bad practice.
[11:40:13] sevenseacat: its not an efficient practice
[11:40:21] sevenseacat: you have to load the entire contents of the table in memory
[11:41:10] Champion_The: in config/initializers/assets.rb?
[11:41:26] nettoweb: has joined #RubyOnRails
[11:41:49] lipoqil: has joined #RubyOnRails
[11:43:42] Sephyros: has joined #RubyOnRails
[11:44:14] Champion_The: like this? Rails.application.config.assets.precompile += %w( index.scss.erb )
[11:45:17] DEA7TH: has joined #RubyOnRails
[11:45:43] cassioscabral: has joined #RubyOnRails
[11:45:58] arup_r: then restart server
[11:48:58] Champion_The: yeah it works
[11:49:51] quazimodo: has joined #RubyOnRails
[11:49:52] quazimod1: has joined #RubyOnRails
[11:49:59] quazimod2: has joined #RubyOnRails
[11:53:21] Champion_The: has left #RubyOnRails: ("Leaving")
[11:54:42] csmb: has joined #RubyOnRails
[11:54:43] jpterry: has joined #RubyOnRails
[11:54:43] DigitalDarwin: has joined #RubyOnRails
[11:56:53] srinidhi: has joined #RubyOnRails
[11:57:03] rubyonrails313: has joined #RubyOnRails
[11:58:02] allcentury: has joined #RubyOnRails
[11:58:28] Palsson: has joined #RubyOnRails
[12:01:04] spitty: has joined #RubyOnRails
[12:01:23] reber: has joined #RubyOnRails
[12:01:56] maesitos: has joined #RubyOnRails
[12:02:27] jeanlinux: has joined #RubyOnRails
[12:06:29] Sephyros: In rails exist something like "User.not.joins(:workplace)"? workplace its a relation between User and Corporation
[12:07:28] tbuehlmann: Sephyros, you want all users that don't have a workplace?
[12:07:29] Sephyros: i want only users that have workplace_id == nil, but i need the return to be an active record relation
[12:08:01] sevenseacat: User.where(workplace_id: nil) ?
[12:08:58] Sephyros: column Users.workplace doesnt exist
[12:09:06] tbuehlmann: either that or is workplaces the join table and there is no workplace_id column on users?
[12:09:21] Sephyros: sorry i forgot to say its workplace_ids
[12:09:30] sevenseacat: then you need to clarify your schema
[12:09:32] tbuehlmann: now I'm confused
[12:09:37] tbuehlmann: yeah, that'd be great
[12:09:42] Sephyros: lol, wait, i will explain
[12:09:50] sevenseacat: don't explain, show your schema
[12:10:28] Sephyros: i will write on gist
[12:12:35] defsdoor: has joined #RubyOnRails
[12:14:17] maesitos: has joined #RubyOnRails
[12:16:10] tbuehlmann: Sephyros: in case it wasn't clear, just gist your db/schema.rb file for now
[12:17:15] Sephyros: i dont have this file =/ i am a little new on ruby
[12:17:27] yxejamir: has joined #RubyOnRails
[12:18:33] tbuehlmann: oh, you don't? isn't this a regular rails application?
[12:19:05] Sephyros: its old ruby and rails verions
[12:19:41] Sephyros: Ruby: 2.1.5p273 and Rails: 4.1.8
[12:20:01] sevenseacat: you either have a db/schema.rb or a db/structure.sql
[12:20:18] sevenseacat: if you don't, then you arent using active record
[12:20:57] FooMunki: has joined #RubyOnRails
[12:21:10] sg19: has joined #RubyOnRails
[12:21:21] chouhoulis: has joined #RubyOnRails
[12:21:52] CornishPasty: What if I AM activerecord?
[12:22:23] sg19: has left #RubyOnRails: ()
[12:22:23] sevenseacat: then I have many colourful words for you
[12:22:57] moeabdol1: has joined #RubyOnRails
[12:26:16] blackmesa: has joined #RubyOnRails
[12:27:37] Tempesta_: has joined #RubyOnRails
[12:28:58] bronson: has joined #RubyOnRails
[12:29:46] wviana: has joined #RubyOnRails
[12:30:29] tambet: has joined #RubyOnRails
[12:30:34] ayoros: has joined #RubyOnRails
[12:32:18] nocontrol: has joined #RubyOnRails
[12:34:33] Ergo: has joined #RubyOnRails
[12:36:47] vedu: Hello I am trying to permit particular values for a key in params, like params.permit(:name, :email, { role: [:model, :client] }, ) => I want to permit only the values 'model' and 'client' for the key :role
[12:37:07] sevenseacat: thats not how it works
[12:37:20] sevenseacat: that sounds like a validation
[12:37:47] vedu: sevenseacat: oh so I can only whitelist keys, not values?
[12:38:06] openstruct: has joined #RubyOnRails
[12:40:02] vedu: sevenseacat: then how can I permit values based on current_user? Like I do not want anyone to assume the role :admin by whitelisting :role in the users controller
[12:40:22] bob_f_: has left #RubyOnRails: ()
[12:40:24] sevenseacat: then why are you whitelisting the role field?
[12:40:35] bob_f: has joined #RubyOnRails
[12:40:41] sevenseacat: also, it still sounds like a validation
[12:40:56] Sephyros: Sorry for the delay
[12:41:03] Sephyros: here i have structure.sql
[12:41:11] Sephyros: <script src="https://gist.github.com/Sephyros/b834e94f7946fbd3bb56.js"></script>
[12:41:24] Sephyros: https://gist.github.com/Sephyros/b834e94f7946fbd3bb56
[12:41:54] mrbubbles: has joined #RubyOnRails
[12:42:01] Sephyros: i need two collections, one created by u
[12:42:11] sevenseacat: Sephyros: there's no users table there
[12:42:23] thecyclone: has joined #RubyOnRails
[12:42:40] vedu: sevenseacat: yeah you are right. should be in validations. thanks
[12:43:15] sevenseacat: Sephyros: you've also misspelled occupations
[12:43:31] dirtibirdi: has joined #RubyOnRails
[12:43:49] Sephyros: User < Person
[12:44:20] dstarh: has joined #RubyOnRails
[12:44:53] sevenseacat: Sephyros: none of your tables have a field called workplace_ids
[12:44:59] Sephyros: The software isnt mine, the architect left the corporation
[12:45:00] mrbubbles: has joined #RubyOnRails
[12:45:03] sevenseacat: or anything called workplace
[12:45:06] krz: has joined #RubyOnRails
[12:45:24] Sephyros: workplace was an example
[12:45:41] helpa: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[12:45:43] Sephyros: sorry, i need Users that dont have roles 9 and 10
[12:46:16] Sephyros: i tried User.where.not(role_ids: [9,10])
[12:46:35] Sephyros: but i got "column people.role_ids doesnt exist"
[12:46:35] sevenseacat: if I answer that, will you just come back with another complaint?
[12:47:59] maesitos: has joined #RubyOnRails
[12:48:35] sevenseacat: http://guides.rubyonrails.org/active_record_querying.html#specifying-conditions-on-the-joined-tables
[12:49:04] Sephyros: ive tried to abstract the idea but i only confused you
[12:49:41] sevenseacat: when you abstract the idea, we come up with solutions for the abstraction
[12:49:48] sevenseacat: that may or may not fix your actual problem
[12:50:23] c0defeed: Does anyone have a recommendation for implementing autocomplete the way that Chrome implements it for the URL bar?
[12:51:35] sevenseacat: c0defeed: how is that autocomplete different?
[12:51:41] solars: hi, if I have a bulk update statement like: Item.where(channel: cnum).update_all(['generated_timestamp = ?', generated]) - is there any nice way I could substitute it with update or create? Or do I have to iterate and do it for each individually? I could not find anything..
[12:52:16] sevenseacat: solars: Item.where(channel: cnum).create_all doesnt make sense
[12:52:36] godzillaenlacasa: has joined #RubyOnRails
[12:53:23] c0defeed: sevenseacat, I keep finding things like this: http://jqueryui.com/autocomplete/, where options appear in a dropdown box below the input field. Chrome's is more like, well, "autocompleting."
[12:53:25] solars: sevenseacat, you're right, copied the wrong line, it should be Item.where(channel: cnum, pid: pids) - where pids is a list of property ids
[12:53:49] sevenseacat: solars: that still doesnt make sense to tack a create on the end of
[12:54:47] sevenseacat: c0defeed: https://www.dropbox.com/s/1g4xna4j83je37g/autocomplete.png?dl=0 ?
[12:55:09] vmarcetic: has joined #RubyOnRails
[12:55:11] solars: sevenseacat, what I mean is update or create in case the record doesn't exist yet - I'm aware that there is probably no solution like update_all but I thought there might be something nicer than iterating
[12:55:28] sevenseacat: solars: iterating isnt going to do what I think you want
[12:55:44] sevenseacat: again, iterating over existing records and calling create makes no sense
[12:57:05] c0defeed: sevenseacat, http://imgur.com/2C6m6gR
[12:57:26] solars: sevenseacat, haha sorry, I completely ignored the where, it of course doesn't make sense like that
[12:57:38] jgpawletko: has joined #RubyOnRails
[12:57:56] sevenseacat: c0defeed: oh i see, thats different
[12:58:08] solars: sevenseacat, I think you understood what I meant, so I guess I have to iterate over all the pids and create or update
[12:58:24] yardenbar: has joined #RubyOnRails
[12:59:05] sevenseacat: c0defeed: I don't know of any library that will auto-fill the text box like that - HTML text boxes don't work like that
[13:00:45] yardenbar: Hi all, how can I run path/to/script.rb from resque-scheduler ?
[13:00:52] c0defeed: sevenseacat, Ok, thanks
[13:05:01] dasnoob: has joined #RubyOnRails
[13:05:44] vasilakisfil_: has joined #RubyOnRails
[13:06:46] msyvich: has joined #RubyOnRails
[13:09:18] dasnoob: hey guys, can someone give me a slight push in the right direction?
[13:09:41] Hates_: dasnoob: well we need to know the issue first :)
[13:10:26] arup_r: has joined #RubyOnRails
[13:10:30] dasnoob: I'm trying to learn RoR by creating a simple timetracking project. Basically, it's a calendar with some time entries (I'll deal with those later), but I'm stuck figuring out the way to connect different models
[13:11:35] dasnoob: For example, I currently have 2 models, Year and Month, and I did "year has many months" and "month belongs to year" relations
[13:11:45] dasnoob: however, I'm not sure whether that's the correct approach
[13:13:12] j3ffbzh: has joined #RubyOnRails
[13:13:22] makenoise: has joined #RubyOnRails
[13:14:56] andatche: has joined #RubyOnRails
[13:16:04] Palsson: has joined #RubyOnRails
[13:16:30] tbuehlmann: dasnoob, don't you just want a model Entry that has some kind of date?
[13:16:38] Ergo^: has joined #RubyOnRails
[13:17:31] IrishGringo: has joined #RubyOnRails
[13:17:33] shanemcd: has joined #RubyOnRails
[13:19:01] sp1rs: has joined #RubyOnRails
[13:19:51] dasnoob: tbuehlmann: that's correct, but I was trying to add Yearly overview - where you can see how much time was tracked for each month, as well as monthly overview where you can see what day was your most productive day, etc
[13:20:19] tbuehlmann: do you need a model for that?
[13:20:27] dasnoob: I'm trying to find simple apps and check out their models so that I can figure out a best approach
[13:21:05] dasnoob: so, I do need a model for timetrack (entry), but the year/month should be pulled straight from the entry, right?
[13:21:14] sp1rs: has joined #RubyOnRails
[13:21:38] dasnoob: like, when you create an entry, you assign the correct date to it - that date should be used to figure out which year/month/day the entry is related to
[13:22:06] chouhoulis: has joined #RubyOnRails
[13:23:08] dasnoob: I thought I should have a "month" model so I can easily go through all the timetracks related to that month, instead of having to do something like Timetrack.all.each
[13:23:32] dasnoob: again, I'm a total beginner, I am clearly overcomplicating it =(
[13:23:44] Pandorian: has joined #RubyOnRails
[13:24:24] erry: has left #RubyOnRails: ("ooh.. What does THIS button do!?")
[13:24:56] shanemcd: has joined #RubyOnRails
[13:25:02] mfaeh: has joined #RubyOnRails
[13:25:44] Abhijit: has joined #RubyOnRails
[13:26:19] Abhijit: this is my user and jobs model. https://gist.github.com/abhijitnavale/faf4895e49456aee21fa on the new job form page, inside the skills input box it prints #<Skill::ActiveRecord_Associations_CollectionProxy:0x007f90653f9420> how to avoid that?
[13:26:53] Abhijit: the skiils input box should be empty and when i take that input inside i should be able to process it manualy.
[13:29:27] emilkarl: has joined #RubyOnRails
[13:29:31] Pandorian: has joined #RubyOnRails
[13:29:44] matthias_: has joined #RubyOnRails
[13:30:26] tbuehlmann: dasnoob, naw, perfectly reasonable approach
[13:30:46] tbuehlmann: I just don't think this makes a database backed model
[13:31:25] sp1rs: has joined #RubyOnRails
[13:31:43] emilkarl: Is using a partial for a collection slower/faster/eqal than using an each loop and HTML in the template itself? Lets say a list of 500 <li>s with some content will be rendered.
[13:31:44] flashpoint9: has joined #RubyOnRails
[13:31:46] jottr: has joined #RubyOnRails
[13:32:45] maesitos_: has joined #RubyOnRails
[13:33:58] Surt_Q: has joined #RubyOnRails
[13:34:43] tbuehlmann: dasnoob, what about having a "MonthReport" service object (just a ruby class) that handles all the collecting of data required for a month display?
[13:35:36] c0defeed: Am I crazy? Shouldn't this work? http://imgur.com/7XW8d1Y
[13:35:55] chagel: has joined #RubyOnRails
[13:37:36] pvertenten: has joined #RubyOnRails
[13:38:24] dasnoob: tbuehlmann: thanks for the tip, I'll go play some more and try different approaches. Maybe the best idea is to figure out the smallest possible model first (the entry itself) and start from there. I guess I took the wrong route and thus confused myself
[13:38:55] tbuehlmann: that's a good idea I guess
[13:41:57] dionysus69: has joined #RubyOnRails
[13:42:32] goodcodeguy: has joined #RubyOnRails
[13:42:46] fmcgeough: has joined #RubyOnRails
[13:44:03] xxx1337: has joined #RubyOnRails
[13:44:30] tambet: has joined #RubyOnRails
[13:44:39] xxx1337: hey guys, question here: I'm going on a job interview for a front-end ruby onrails enviroment startup position and I need advice on whether to take this job and leave my current mostly frontend but full stack position with php
[13:45:08] xxx1337: The startup sounds like it will pay less than what I currently have and not have benefits
[13:45:30] ddv: xxx1337: there is your answer then
[13:45:30] xxx1337: but on the other hand I really want a job where I'm doing ruby because I feel it's a better language with better opportunities to develop cooler things
[13:45:40] vedu: c0defeed: did you try without the !
[13:45:49] xxx1337: I don't currently have any ruby experience especially on my resume
[13:46:35] xxx1337: I eventually want to be a backend ruby developer
[13:46:49] xxx1337: I'm not sure if being a front-end ruby developer at this place will be all that beneficial
[13:47:17] snowy: has joined #RubyOnRails
[13:47:54] shanemcd: has joined #RubyOnRails
[13:48:17] tbuehlmann: c0defeed, nope, there's no such method
[13:49:09] xxx1337: What would you guys do in this situation? Go for the rails opportunity or stay with stability.
[13:49:58] c0defeed: vedu, it works without the !. I wanted to use the !. It looks like I can't use the !. According to tbuehlmann, there is no !ing.
[13:50:39] vedu: c0defeed: yes exactly what the error said. you can make your own
[13:50:41] tbuehlmann: c0defeed, I told bs, there's such a method
[13:52:50] ddv: xxx1337: this is a personal choice
[13:52:56] ddv: xxx1337: you can only make
[13:53:33] makenoise: has joined #RubyOnRails
[13:55:26] workmad3: xxx1337: go to the interview, see if you get an offer before deciding what to do
[13:56:14] flip_digits: has joined #RubyOnRails
[13:56:16] xxx1337: how would i frame that to them? I'm not sure if I should pretend to be enthusiastic or be realistically skeptical during the interview
[13:56:47] thecyclone: has joined #RubyOnRails
[13:56:56] workmad3: xxx1337: treat it like any interview... and you don't need to tell them that you're hesitant about taking the job
[13:57:33] flip_digits: Question: is there a way to open the underlying step_definition that a particular cucumber step is using? Something like And show me the step instead of And show me the page
[13:57:43] workmad3: xxx1337: also remember that an interview is an opportunity for you to get more information about the potential job too... so that's when you can dig more into what they class as a 'front-end rails' position, whether it's a place you want to work, etc.
[13:58:06] xxx1337: alright htanks
[13:58:09] sudoubuntu: has joined #RubyOnRails
[13:58:10] workmad3: xxx1337: end of the day, the decision is yours, and it has a big impact on your future
[13:58:11] asahi: has joined #RubyOnRails
[13:58:37] xxx1337: question: how did you guys find your first rails opportunity?
[13:58:39] ferr: I'm trying to do ajax update call, but I get an argument error, could anyone tell me what arguments this require? https://gist.github.com/Fercell/d81f9ab23d215fa56619
[13:58:45] workmad3: xxx1337: so get the information you want/need first and make a decision from a position of knowledge (knowledge of the position and knowledge that it's a job you have an offer for)
[14:00:04] xxx1337: one of the reasons why i want this position is to set myself up for other rails opportunities. I find it difficult to apply to most rails jobs though because they require previous rails experience (which I have non professionally)
[14:00:10] tbuehlmann: ferr, can't you use a remote form? can't you use a remote link_to/button_to?
[14:00:11] xxx1337: so how did you guys get started?
[14:00:50] ferr: tbuehlmann: I can't, I really need this to be ajax call
[14:01:24] drbayer: has joined #RubyOnRails
[14:01:33] workmad3: xxx1337: personally, I kinda drifted into it after the first company I worked for went bankrupt (they did symbian mobile development)... got a job with an old professor from uni who wanted someone to help do programming on various projects and I guided it towards rails because I had previous interest in it
[14:01:56] workmad3: so not particularly helpful experience for you to gain pointers from :)
[14:02:04] tbuehlmann: ferr: oh. `@user = User.where(id: params[:id])` returns a relation of users, not a single user
[14:02:50] tambet_: has joined #RubyOnRails
[14:03:14] tambet_: has left #RubyOnRails: ()
[14:03:39] ramortegui: has joined #RubyOnRails
[14:03:53] jscheel: has joined #RubyOnRails
[14:04:48] chouhoulis: has joined #RubyOnRails
[14:04:56] Takumo: when using puma and capistrano, it says "discovery /var/www/..." does that need to be an absolute path?
[14:05:00] Takumo: because the path will
[14:05:06] Takumo: change depending on the capistrano stage
[14:07:05] Guest6988: has joined #RubyOnRails
[14:07:13] chouhoulis: has joined #RubyOnRails
[14:07:45] mices: if i'm using sass-rails i should rename application.css to application.scss ?
[14:09:15] vasilakisfil_: has joined #RubyOnRails
[14:09:22] Takumo: mices: or application.css.scss (which is what I use)
[14:09:41] mices: Takumo: ty
[14:11:46] mices: Takumo: can i use *= require in the scss file or i can only use @import ?
[14:12:08] ddv: mices: you have to @import statements
[14:12:26] grn: has joined #RubyOnRails
[14:12:36] shanemcd: has joined #RubyOnRails
[14:13:02] mices: ddv: so then you mean no, i can't use *= require in an .scss file
[14:13:11] ddv: exactly
[14:13:26] ddv: mices: also easy to find out yourself
[14:13:59] mices: so if i'm following docs that say to use require in my css file, i have to use an @import equivelent statement instead
[14:16:47] dirtibirdi: has joined #RubyOnRails
[14:18:03] alphaatom: has joined #RubyOnRails
[14:18:22] jmignault: has joined #RubyOnRails
[14:18:36] sp1rs: has joined #RubyOnRails
[14:19:11] tambet_: has joined #RubyOnRails
[14:19:23] tambet_: has left #RubyOnRails: ()
[14:19:41] arup_r: I am getting system stackoverflow error, https://gist.github.com/aruprakshit/c9e601c5c90517004c9d .. But as per my lazy lode code, I should not get it.. any idea what could be wrong ?
[14:21:33] m0rph: has joined #RubyOnRails
[14:22:11] tambet: has joined #RubyOnRails
[14:22:48] Abhijit: how can i make Model.where(condition) match aproximately?
[14:22:54] Abhijit: do not match exact.
[14:23:08] Abhijit: and ignore starting whitespace.
[14:23:20] tambet: has left #RubyOnRails: ()
[14:23:28] arup_r: Abhijit: using LIKE and some regex. What is RDBMS ?
[14:23:56] elaptics`away: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[14:24:12] elaptics: has joined #RubyOnRails
[14:25:46] artto: has joined #RubyOnRails
[14:26:08] arup_r: check their doc
[14:26:19] Abhijit: why? i have to do it in rails controller.
[14:26:32] yellow5: has joined #RubyOnRails
[14:26:38] ayoros: has joined #RubyOnRails
[14:27:38] tbuehlmann: Abhijit, very simple idea: strip whitespaces from your search string, then use LIKE as suggested. if you want a better search, try https://github.com/Casecommons/pg_search
[14:27:56] workmad3: Abhijit: because their docs will give you the syntax for what you want to achieve
[14:28:15] Abhijit: tbuehlmann, workmad3 ok. thanks.
[14:29:48] Macaveli: has joined #RubyOnRails
[14:30:36] jhack: has joined #RubyOnRails
[14:31:25] bronson: has joined #RubyOnRails
[14:31:29] kerunaru: has joined #RubyOnRails
[14:32:10] m0rph: has joined #RubyOnRails
[14:33:00] pinkerton: has joined #RubyOnRails
[14:33:10] rafaelfranca: has joined #RubyOnRails
[14:33:43] pinkerton: has left #RubyOnRails: ()
[14:34:18] arup_r: why `||=` caching not working for me ? any idea
[14:34:48] arup_r: oh, I know now
[14:36:11] emachnic: has joined #RubyOnRails
[14:36:40] emachnic: has joined #RubyOnRails
[14:36:59] Abhijit: remvoed starting whitespace with strip.
[14:38:31] emilkarl: has joined #RubyOnRails
[14:39:13] pawnbox: has joined #RubyOnRails
[14:39:32] adavia: has joined #RubyOnRails
[14:39:40] nerium: has joined #RubyOnRails
[14:41:05] nerium: Is there a way to log timeouts in production?
[14:41:32] squaresurf: has joined #RubyOnRails
[14:41:43] mices: if i'm supposed to place a script at the bottom of my page and i put it in the asset pipeline then the difference is now it's site-wide instead of just for that view, but usually this may not be significant, right or wrong?
[14:43:07] bool_: has joined #RubyOnRails
[14:43:11] shanemcd: has joined #RubyOnRails
[14:45:26] DmitryBochkarev: has joined #RubyOnRails
[14:47:06] nachoman: has joined #RubyOnRails
[14:48:44] jhack: has joined #RubyOnRails
[14:52:45] artto: has joined #RubyOnRails
[14:53:41] mices: i had bootstrap image gallery working but when i swapped it out for blueimp, no luck
[14:54:03] bmalum: has joined #RubyOnRails
[14:54:59] flashpoint9: has joined #RubyOnRails
[14:56:21] dirtibirdi: has joined #RubyOnRails
[14:58:16] myntcake: has joined #RubyOnRails
[14:59:44] sp1rs: has joined #RubyOnRails
[15:01:55] drbayer: has joined #RubyOnRails
[15:03:01] shanemcd: has joined #RubyOnRails
[15:05:21] unl0ckd: has joined #RubyOnRails
[15:05:44] adavia: has joined #RubyOnRails
[15:06:12] unl0ckd: has joined #RubyOnRails
[15:06:26] moeabdol: has joined #RubyOnRails
[15:06:27] ayoros: has joined #RubyOnRails
[15:06:43] asahi: has left #RubyOnRails: ()
[15:07:56] artto: has joined #RubyOnRails
[15:08:53] jaguarjohnson: has joined #RubyOnRails
[15:10:26] allcentury: has joined #RubyOnRails
[15:10:58] treehug88: has joined #RubyOnRails
[15:11:12] techsethi: has joined #RubyOnRails
[15:11:35] a1fa: is it possible to have a AR relationship with an array of IDs?
[15:12:45] vasilakisfil_: has joined #RubyOnRails
[15:13:37] a1fa: or do i need another table that's has_many with individual ids?
[15:14:18] tubbo: a1fa: you'd need another table
[15:14:42] a1fa: tubbo: had a feeling that would be the case
[15:14:54] tubbo: depending on the circumstance, it's possible to have a :tag_ids array on a model and then define the tags model yourself, for example
[15:15:01] tubbo: which would just be Tag.where(id: tag_ids)
[15:15:25] a1fa: tubbo: would it be to "hackish" to use a varchar and store an array -- it would also have to play nice with form helper select method
[15:16:50] a1fa: i guess i am going to have to figure out how to make this work with select form and another table, as it is
[15:17:16] tubbo: a1fa: yeah so that's when you're gonna run into problems. it's a lot better to just not fight the framework, and use rails' nested attributes helpers in the form as well as the `has_many :through` or `has_and_belongs_to_many` helpers in the model.
[15:20:09] vasilakisfil_: has joined #RubyOnRails
[15:20:23] durexlw: has joined #RubyOnRails
[15:20:32] a1fa: thanks tubbo
[15:21:59] jas02: has joined #RubyOnRails
[15:22:18] JulienITARD: has joined #RubyOnRails
[15:22:38] pvertenten: has joined #RubyOnRails
[15:23:01] durexlw: Anyone has an idea why this instruction throws an error? select( [ :jaar, :maand, Arel::Nodes::NamedFunction.new('SUM', MonthlyTransaction.arel_table[:saldo]) ] ).group(:jaar, :maand) }
[15:23:16] jottr: has joined #RubyOnRails
[15:24:18] durexlw: it gives the error "RuntimeError: unsupported: Symbol". It seems to have to do with the part "MonthlyTransaction.arel_table[:saldo]", cause if I change that to "MonthlyTransaction.arel_table['saldo']", it throws the error "RuntimeError: unsupported: String"
[15:25:15] B1n4r10: has joined #RubyOnRails
[15:25:28] underplank: has joined #RubyOnRails
[15:25:58] ferr: This code works fine on console, but when I put it into function, it does not work, any ideas why? https://gist.github.com/Fercell/b9591d6c3de6815d9d5e
[15:26:59] podman: has joined #RubyOnRails
[15:27:51] durexlw: ferr, do you take into account fastlinks?
[15:28:00] durexlw: err turbolinks
[15:28:08] uglybandersnatch: has joined #RubyOnRails
[15:28:59] durexlw: ferr: $(document).ready -> alert "page has loaded!"
[15:29:14] ferr: durexlw: it is something because of variables
[15:29:37] ferr: user_checkboxes is empty out of success call
[15:30:03] durexlw: and when you use the console, the user_checkboxes are present?
[15:30:06] flashpoint9: has joined #RubyOnRails
[15:30:33] mag42c: has joined #RubyOnRails
[15:31:01] ferr: if I take it out of the function, it works
[15:31:11] ferr: If I remove the first and last lines of code, it works fine
[15:31:26] aegis3121: has joined #RubyOnRails
[15:33:13] DragonPunch: has joined #RubyOnRails
[15:33:16] senya: has joined #RubyOnRails
[15:33:35] durexlw: ferr: do you ever call the function?
[15:33:47] durexlw: a named function is't run until you actually call it
[15:34:00] mary5030: has joined #RubyOnRails
[15:34:05] durexlw: that would explain why it world without the first line of code
[15:34:14] vasilakisfil__: has joined #RubyOnRails
[15:34:16] ss_much: has joined #RubyOnRails
[15:34:48] senya: Hi! What is a best way to pass a hash between two controller actions? I would use Flash, but the hash is too big to fit in cookies.
[15:35:04] durexlw: senya: what are you trying to do?
[15:35:11] mary5030: has joined #RubyOnRails
[15:35:36] durexlw: why would you want to pass a hash between two controller actions?
[15:35:36] defsdoor: has joined #RubyOnRails
[15:35:45] fschuindt: has joined #RubyOnRails
[15:36:11] shanemcd: has joined #RubyOnRails
[15:36:25] artto: has joined #RubyOnRails
[15:37:31] senya: durexlw: I get the hash in first action from user upload, then I have a verification action and screen which need the hash to check it and then I want to pass data further to the next action - it is a kind of registration
[15:37:31] flashpoint9: has joined #RubyOnRails
[15:38:09] kies^: has joined #RubyOnRails
[15:38:41] senya: I don't want t pass it as a hidden field since it is comparatively big and there is no point for it to travel back and forth
[15:39:18] durexlw: senya: can you be more specific? It's hard helping with this limited info. In rails it's a good rule of thumb to say that if you struggle with something you're thinking about it wrong.... so with that in mind I'd like to explore all possibilities
[15:39:23] jeanlinux: has joined #RubyOnRails
[15:39:48] ddv: senya: is this a multi step wizard?
[15:39:49] dirtibirdi: has joined #RubyOnRails
[15:40:42] senya: ddv: yes, kind of
[15:40:58] ddv: senya: show some code
[15:41:23] zave: has joined #RubyOnRails
[15:41:36] rdavila: has joined #RubyOnRails
[15:41:57] ddv: senya: what feature are you trying to implement?
[15:42:28] suchness: has joined #RubyOnRails
[15:44:20] senya: durexlw: ddv: I'm trying to implement user registration based on user data archive. a user uploads an archive of json data, then the action checks if it fits the schema, and after that the user enters some more data and after that the actual registration is being performed basing on the user's input and the json archiv
[15:45:59] senya: this is very early piece of code: https://gist.github.com/anonymous/76aef6c897ed8cf6cedf
[15:46:11] shanemcd: has joined #RubyOnRails
[15:46:38] senya: I tried Rails.cache here, but, it's not satisfactory, of course
[15:46:54] sp1rs: has joined #RubyOnRails
[15:47:07] ddv: senya: verify_archive doesn't belong in the controller, but why don't you just create an incomplete registration record in the database and update this record during each step?
[15:47:20] zave: has joined #RubyOnRails
[15:47:44] Scott2619: has joined #RubyOnRails
[15:47:55] Scott2619: Hi can somebody please help?
[15:48:14] Scott2619: I am trying to open 2 files one with keywords and one with a list or product numbers and descriptions
[15:48:27] Scott2619: I am trying to see if one of the keywords are in the description
[15:48:29] Scott2619: I have done this
[15:48:30] Scott2619: https://gist.github.com/scott2619/9a8b0af0db5f628e2d52
[15:48:49] ddv: Scott2619: #ruby
[15:48:57] Scott2619: but its not working as description is always the same
[15:51:59] Jon30: has joined #RubyOnRails
[15:52:26] senya: ddv: no, it doesn't fit my case well
[15:52:29] treehug88: has joined #RubyOnRails
[15:52:41] ddv: senya: oh I see why not?
[15:53:03] reckoner: has joined #RubyOnRails
[15:53:34] reckoner: does link_to method: :update work for you?
[15:53:55] ddv: reckoner: why don't you try yourself, are you lazy?
[15:54:18] reckoner: ddv i did try jerkoff.
[15:54:24] reckoner: i'm asking here because i tried it.
[15:54:51] senya: ddv: because I use the json archive from the step 1 to build some other object in the database, other than the registration record, and I can't do that before I have the user data from the step 2
[15:54:56] shinnya: has joined #RubyOnRails
[15:55:05] reckoner: it really pisses me off whne people response like that. it's not helpful.
[15:55:14] reckoner: this place used to be a bastion of information.
[15:56:06] blackmesa: has joined #RubyOnRails
[15:56:22] makenoise: has joined #RubyOnRails
[15:57:00] ddv: reckoner: yes it's all our fault you don't know how to ask questions properly :(
[15:57:20] reckoner: ddv what about my question didn't you understand.
[15:57:21] eljimmy: has joined #RubyOnRails
[15:57:56] reckoner: it was prettttty basic
[15:58:37] reckoner: you could've responsed even... "YES".... or "NO" or maybe even
[15:58:44] reckoner: have you tried including 'ujs'
[15:58:55] reckoner: instead. you went with being a dick.
[15:59:11] ddv: reckoner: I think you need to calm down
[15:59:26] reckoner: i think i'm pretty justified either way.
[15:59:57] Devalo: has joined #RubyOnRails
[16:00:50] reckoner: i'm cool withe people smacking someone down, but at least go out of your way to correct them to back it up.
[16:01:25] syf-revk: has joined #RubyOnRails
[16:05:36] kdough: has joined #RubyOnRails
[16:06:11] malcolmva: has joined #RubyOnRails
[16:07:12] durexlw: reckoner: never crossed my mind using that syntax
[16:07:28] syf-revk: has joined #RubyOnRails
[16:07:38] blackmesa: has joined #RubyOnRails
[16:09:16] durexlw: reckoner: it seems to redirect to the current page, but the params that seem to have something inside
[16:09:17] reckoner: durexlw, it's not advisable. i seldom do this normally.
[16:09:38] reckoner: i fixed it by including ujs. without which this won't work.
[16:10:04] reckoner: https://github.com/rails/jquery-ujs
[16:10:14] treehug88: has joined #RubyOnRails
[16:10:34] n008f4g_: has joined #RubyOnRails
[16:10:40] aegis3121: has joined #RubyOnRails
[16:11:05] smathy: has joined #RubyOnRails
[16:12:03] dionysus69: has joined #RubyOnRails
[16:12:03] tweeeaks: has joined #RubyOnRails
[16:13:06] tvw: has joined #RubyOnRails
[16:14:03] robbkidd_: has joined #RubyOnRails
[16:14:37] artmann_: has joined #RubyOnRails
[16:15:14] voker57_: has joined #RubyOnRails
[16:15:20] Isthar_: has joined #RubyOnRails
[16:15:37] cookiez: has joined #RubyOnRails
[16:15:37] sneep: has joined #RubyOnRails
[16:15:38] disgrntld: has joined #RubyOnRails
[16:15:39] sneep: has joined #RubyOnRails
[16:15:39] c0defeed: How can I select the most recent record from a table while also filtering on a value in a different column
[16:15:56] syf-revk: has joined #RubyOnRails
[16:16:08] waldi_: has joined #RubyOnRails
[16:16:46] shanemcd: has joined #RubyOnRails
[16:17:22] tbuehlmann: c0defeed, you just do it: YourModel.where(foo: 'bar').order(created_at: :desc)
[16:17:57] LowTemplar: has joined #RubyOnRails
[16:19:54] jeanlinux: has joined #RubyOnRails
[16:20:40] c0defeed: tbuehlmann, Cool, thanks. I was tripping on syntax
[16:20:50] tweeeaks: c0defeed: or if you want just the one, you can use last: Model.where(foo: bar).last
[16:21:06] c0defeed: tweeeaks, thanks
[16:21:06] tweeeaks: or of course add .limit(1) to tbuehlmann's solution
[16:21:09] jeanlinux: has joined #RubyOnRails
[16:22:35] jcugno: has joined #RubyOnRails
[16:22:54] durexlw: reckoner: ow, I see :) yeah, i see why you needed that
[16:23:33] durexlw: Anyone has an idea why this instruction throws an error? select( [ :jaar, :maand, Arel::Nodes::NamedFunction.new('SUM', MonthlyTransaction.arel_table[:saldo]) ] ).group(:jaar, :maand) }
[16:23:41] durexlw: it gives the error "RuntimeError: unsupported: Symbol". It seems to have to do with the part "MonthlyTransaction.arel_table[:saldo]", cause if I change that to "MonthlyTransaction.arel_table['saldo']", it throws the error "RuntimeError: unsupported: String"
[16:23:51] iuuso: has joined #RubyOnRails
[16:24:16] durexlw: I ended up writing the select in sql and that works, but I always get a funny feeling using sql with orm
[16:24:23] jeanlinux: has joined #RubyOnRails
[16:25:20] rubyonrailed: has joined #RubyOnRails
[16:25:49] tjohnson: has joined #RubyOnRails
[16:25:50] smathy: Model.where(foo: 'bar').order(:created_at).last
[16:27:25] smathy: More semantic is all.
[16:27:46] htmldrum: has joined #RubyOnRails
[16:30:01] antgel: has joined #RubyOnRails
[16:30:06] smathy: durexlw, I don't know why you're getting that error, but why not change to: MonthlyTransaction.arel_table[:saldo].sum
[16:31:06] durexlw: smathy: well, I didn't change it to that, because I didn't realize the .sum existed :) I'll try that man, thanks for the suggestion... by the wya, I don't understand either why it doens't work, seems pretty valid.
[16:31:06] Criten: has joined #RubyOnRails
[16:31:09] jeanlinux: has joined #RubyOnRails
[16:31:57] heyitsme: has joined #RubyOnRails
[16:32:46] AzaToth: has joined #RubyOnRails
[16:32:53] smathy: durexlw, I'd have to take a look through the stacktrace to see why, thankfully you don't have to.
[16:32:53] diegoviola: has joined #RubyOnRails
[16:33:23] bronson: has joined #RubyOnRails
[16:33:30] sp1rs: has joined #RubyOnRails
[16:33:33] durexlw: smathy: "ActiveModel::MissingAttributeError: missing attribute: saldo"
[16:33:41] durexlw: let me check something...
[16:34:21] durexlw: is it because it's lacking in the group by?
[16:35:01] hamed_r: has joined #RubyOnRails
[16:35:21] smathy: durexlw, btw, you can probably do this in ActiveRecord: MonthlyTransaction.group(:jaar,:maand).sum(:saldo)
[16:35:22] jeanlinux: has joined #RubyOnRails
[16:35:43] durexlw: no kidding...
[16:35:59] durexlw: learning every minute. I'll definately try that
[16:36:21] smathy: durexlw, you won't get back MonthlyTransaction objects, just a hash - but it might be all you need.
[16:37:13] kies^: has joined #RubyOnRails
[16:37:45] the-undefined_: has joined #RubyOnRails
[16:37:59] durexlw: smathy: https://gist.github.com/durexlw/0338ffeae95f2baf9c32
[16:38:15] dopie: smathy: I'm working on the spec you helped me a while ago and was wondering if you had a time to look over it and see what you would change ...
[16:38:38] dopie: I really like how you separated everything and was trying to build upon it
[16:38:39] dopie: https://gist.github.com/staycreativedesign/a9a76f5421a366ca464e
[16:39:01] smathy: durexlw, yeah, the total field won't be called `saldo`
[16:39:22] smathy: durexlw, try `sum_saldo` instead.
[16:39:59] smathy: I think that's the Rails convention, but not sure wrt the arel thing.
[16:40:13] durexlw: oh, no shit... that makes sense... I'll try that..
[16:41:11] smathy: Actually, it won't work, the arel option doesn't add an `AS` for the sum, so you'll need to either use the AR version I showed, or add an .as(...) to your arel.
[16:41:19] c0defeed: Question: Is there a way to update an instance variable in a controllers "new" action using another action on the same controller?
[16:41:57] smathy: durexlw, like: MonthlyTransaction.arel_table[:saldo].as('sum') or something
[16:42:24] m0rph: has joined #RubyOnRails
[16:42:34] durexlw: smathy: the ar version works
[16:42:40] m0rph: has left #RubyOnRails: ()
[16:42:41] durexlw: indeed returns hash
[16:43:16] smathy: durexlw, right, so I wasn't sure if that was cool for your use case - but if so, that's the simplest.
[16:43:31] IrishGringo: has joined #RubyOnRails
[16:43:45] smathy: dopie, I'd always have the request itself as the subject for any controller spec
[16:43:53] thecyclone: has joined #RubyOnRails
[16:45:41] dopie: in my case the subject(:response) { get :index }
[16:45:53] dopie: for #patch_uploads would beo
[16:46:00] FLeiXiuS: has joined #RubyOnRails
[16:46:09] syf-revk: has joined #RubyOnRails
[16:46:16] dopie: subject(:response) { post :upload_documents }
[16:46:25] smathy: dopie, patch, but yes.
[16:46:37] durexlw: smathy: got it to work
[16:46:39] dopie: anything else you see differently?
[16:46:44] durexlw: with the arel
[16:46:50] dopie: or that I can improve on?
[16:46:52] smathy: dopie, like I'd have: subject(:response) { patch :upload_documents, p } with a let(:p) { {user: ...etc} }
[16:46:56] dirtibirdi: has joined #RubyOnRails
[16:46:57] smathy: durexlw, cool.
[16:47:26] durexlw: select( [ MonthlyTransaction.arel_table[:saldo].sum.as('saldo') ] ).where( Arel::Nodes::Group.new(MonthlyTransaction.arel_table[:cijfer_1].eq('6').or(MonthlyTransaction.arel_table[:cijfer_1].eq('7')))).group(:jaar, :maand) }
[16:47:30] smathy: dopie, I also make sure that any `before` or `let` within a context block actually match that context.
[16:47:43] squaresurf: has left #RubyOnRails: ("(null)")
[16:47:47] smathy: dopie, the context is like the precondition for a set of tests.
[16:48:06] durexlw: smathy: so "MonthlyTransaction.arel_table[:saldo].sum" works, but it needed indeed the '.as'. Thanks for the help man. I really appreciate it
[16:48:41] dopie: So in my case
[16:48:56] dopie: line 44 is user logs in and uploads step 1 documents
[16:49:14] smathy: dopie, so, a context doesn't describe a test, it described the preconditions. Use a `describe` as the verb (what's happening) and the context as the adverb (the custom situation for these tests)
[16:51:10] dopie: So "user is logged in" and how would i write the context for the uploading of the documents?
[16:51:44] dopie: since its running in the before block
[16:53:12] evenix: has joined #RubyOnRails
[16:53:37] smathy: dopie, I just put a comment in with the reworking of that second describe.
[16:54:05] smathy: dopie, see how I've pulled out everything common to the patch to upload_documents out of the context blocks.
[16:54:28] smathy: So the mechanics of the tests are the same, and the context blocks just adjust the inputs that differ between them.
[16:56:26] augcesar: has joined #RubyOnRails
[16:56:36] smathy: dopie, so the only time you'd have a "user is logged in" context would be if you were going to have another "user logged out" context.
[16:56:52] dopie: you drop everything in lets
[16:58:11] smathy: I am the rspec-whisperer.
[16:58:19] dopie: Ok im getting to understand on how you do it
[16:58:36] naftilos76: has joined #RubyOnRails
[16:58:40] trxtr: has joined #RubyOnRails
[16:58:49] durexlw: gotta run. Thanks for the help guys. Take care
[16:58:59] smathy: durexlw, byes, y/w
[16:59:16] asahi: has joined #RubyOnRails
[17:00:27] diegoviola: has joined #RubyOnRails
[17:00:56] dopie: smathy: Where can i get more knowledge like yours on testing... this goes beyond everything I was taught and see out there
[17:01:03] dopie: Any books you suggest?
[17:02:34] asahi: anyone know a way around the raindrops version 0.12 for rails 4.2? I can't get this gem to install
[17:03:20] smathy: dopie, just added another slight tweak, using shared_examples for common tests: https://gist.github.com/staycreativedesign/a9a76f5421a366ca464e#gistcomment-1713033
[17:03:37] htmldrum: has joined #RubyOnRails
[17:03:45] shanemcd: has joined #RubyOnRails
[17:03:49] sonofdirt: has joined #RubyOnRails
[17:04:30] smathy: dopie, honestly, I have no idea, I couldn't find any of this sort of stuff explained. Most people seem to just cream their pants over the stupid keyword additions in rspec and never focus on its true power which is this late binding combined with the block contexts.
[17:05:24] evenix: weird.. how come I'm getting a unexpected tLABEL error on jruby 1.7.12 ruby 1.9.3
[17:05:33] dopie: smathy: to add other types of tests it just add them in it blocks?
[17:05:41] evenix: I thought tLABEL error were fixed from 1.9.2 to 1.9.3
[17:05:46] smathy: evenix, this is Rails, you're looking for a #ruby channel (or maybe a jruby channel)
[17:06:06] evenix: @smathy good point
[17:06:20] smathy: dopie, for the shared examples, yes and you can move those out into another file if they're more widely relevant, docs here: https://www.relishapp.com/rspec/rspec-core/docs/example-groups/shared-examples
[17:07:15] Detch: has joined #RubyOnRails
[17:07:55] Sephyros: ServiceSolicitation.where("code REGEXP ?", '^2016\d{4}') should work correct?
[17:09:03] KensoDev: has joined #RubyOnRails
[17:09:23] Sephyros: PG use ~* thanks anyway
[17:09:56] sp1rs: has joined #RubyOnRails
[17:11:08] asahi: has left #RubyOnRails: ()
[17:11:10] jottr_: has joined #RubyOnRails
[17:11:40] momomomomo: has joined #RubyOnRails
[17:11:41] stannard: has joined #RubyOnRails
[17:12:56] rodfersou|lunch: has joined #RubyOnRails
[17:13:55] [Butch]: has joined #RubyOnRails
[17:15:10] Uber|Dragon: has joined #RubyOnRails
[17:15:19] B1n4r10: has joined #RubyOnRails
[17:15:30] mrbubbles: has joined #RubyOnRails
[17:15:36] benlieb: has joined #RubyOnRails
[17:18:30] dopie: trying to give you kudos on the page
[17:18:34] dopie: on the chat
[17:18:50] dopie: so much cleaner
[17:20:20] Rodya_: has joined #RubyOnRails
[17:22:09] dopie: smathy: if they arent shared examples i still would put them in it blocks correct
[17:22:22] smathy: dopie, don't pay me back, just pay it forward.
[17:22:29] smathy: dopie, not sure what you're asking there.
[17:23:07] smathy: dopie, oh, sorry, I forgot to update the `it` blocks to account for the new subject...
[17:23:45] smathy: dopie, oh, you already had that.
[17:24:24] smathy: dopie, so yeah, either as I have my comment now, or if you didn't want the shared examples then just put the `it { is_expected.. }` lines back in place of the `it_behaves_like...` lines.
[17:24:52] smathy: (just fixed an underscore in the name of the shared example, it should have been a space)
[17:25:26] dopie: yeah i saw that :)
[17:25:40] shanemcd: has joined #RubyOnRails
[17:25:48] dopie: Man its so much cleaner
[17:25:54] dopie: and I totally get everything youre doing
[17:29:58] baweaver: has joined #RubyOnRails
[17:30:00] sp1rs: has joined #RubyOnRails
[17:32:03] dopie: smathy: should i test my other methods that interwine with upload documents like step_params
[17:32:41] yellow5: has joined #RubyOnRails
[17:32:45] rakm: has joined #RubyOnRails
[17:32:47] smathy: dopie, if it's an action, ie. there's a route that maps to it, then yes.
[17:32:59] senya: has left #RubyOnRails: ()
[17:33:42] dopie: k got it...
[17:36:20] makenoise: has joined #RubyOnRails
[17:37:49] dirtibirdi: has joined #RubyOnRails
[17:44:45] qejk: has joined #RubyOnRails
[17:45:17] shanemcd: has joined #RubyOnRails
[17:45:24] hiljusti: has joined #RubyOnRails
[17:45:56] shanemcd: has joined #RubyOnRails
[17:46:42] momomomomo: has joined #RubyOnRails
[17:46:53] DoctorMonocular: has joined #RubyOnRails
[17:46:54] reckoner: has left #RubyOnRails: ("*poof!*")
[17:47:41] hiljusti: anyone familiar with the pg_power gem?
[17:48:01] rodfersou: has joined #RubyOnRails
[17:48:12] m0rph: has joined #RubyOnRails
[17:49:16] mDuff: has joined #RubyOnRails
[17:49:25] m0rph: has left #RubyOnRails: ()
[17:50:46] iuuso_: has joined #RubyOnRails
[17:50:47] banister: has joined #RubyOnRails
[17:51:31] mDuff: If I have a resource with an identifier that contains literal semicolons, and I generate a form trying to delete such a resource with <%= form_tag(..., id: that_identifier) %>, only the part before the first semicolon in the ID is used. Is this expected behavior? Is there a reasonable workaround?
[17:53:58] B4daBing73: has joined #RubyOnRails
[17:55:07] Oog: has joined #RubyOnRails
[17:56:15] sleungcy: has joined #RubyOnRails
[18:02:05] Pandorian: has joined #RubyOnRails
[18:02:21] mcodyb_: has joined #RubyOnRails
[18:05:40] jxs_: has joined #RubyOnRails
[18:05:55] norc: has joined #RubyOnRails
[18:06:31] stannard: has joined #RubyOnRails
[18:07:42] deuxclique: has joined #RubyOnRails
[18:07:53] atomical: has joined #RubyOnRails
[18:08:06] stannard: has joined #RubyOnRails
[18:09:51] deuxclique: has joined #RubyOnRails
[18:11:22] _3by8: has joined #RubyOnRails
[18:12:20] deuxclique: has joined #RubyOnRails
[18:12:47] douglascorrea: has joined #RubyOnRails
[18:13:31] ddv: mDuff, show some code
[18:13:49] _3by8: When I go to edit one of my records via the edit controller, it's not pulling in a boolean value... does it have something to do with it being boolean?
[18:14:08] ddv: mDuff, why are you not using form_for?
[18:16:02] jeanlinux: has joined #RubyOnRails
[18:17:07] mDuff: @ddv, not using form_for because I don't have a proper model here -- the objects I'm manipulating aren't database-backed.
[18:17:48] ddv: mDuff, doesn't matter
[18:18:01] tweeeaks: _3by8: from a form? did you add the boolean to your params permit list?
[18:18:55] _3by8: tweeeaks: yeah, when I go to the edit view it's not setting the value that has already been set which is boolean, and I thought the params permit list was only for when you update/create.
[18:19:36] mDuff: Mmm. The documentation for form_for talks about binding to models (things that actually have model attributes, for instance), and I don't grok what it does or how it tries to do it if I don't have things that are actually Rails model objects.
[18:19:58] branchini: has joined #RubyOnRails
[18:21:17] cnk: has joined #RubyOnRails
[18:21:24] shanemcd: has joined #RubyOnRails
[18:21:51] sp1rs: has joined #RubyOnRails
[18:22:07] dirtibirdi: has joined #RubyOnRails
[18:23:06] noodman: has joined #RubyOnRails
[18:24:09] jeanlinux: has joined #RubyOnRails
[18:24:36] _3by8: tweeeaks: I figured it out, I was using options_for_select in my edit view, I just placed the values directly in it.
[18:25:54] branchini: I need some help, or advice or a point in a direction. I have a model that has about 10 boolean fields. I created a form with check boxes to select which fields to query on the objects. I cant seem to find a way to do nested OR selects
[18:26:30] xMopxShell: has joined #RubyOnRails
[18:26:51] branchini: is there a way to dynamically search fields for true depending on if they were checked in a form?
[18:28:11] FLeiXiuS`: has joined #RubyOnRails
[18:29:04] morbid_ape: has joined #RubyOnRails
[18:29:06] morbid_ape: has left #RubyOnRails: ()
[18:29:41] djbkd: has joined #RubyOnRails
[18:30:20] njero: has joined #RubyOnRails
[18:33:00] norc: branchini, sure.
[18:33:10] openstruct: has joined #RubyOnRails
[18:33:24] Rodya_: has joined #RubyOnRails
[18:34:56] dionysus69: has joined #RubyOnRails
[18:35:01] norc: branchini, if you want to roll your own, just send the method :or to your query chain
[18:35:14] norc: branchini, i.e. Model.where(exp).or(exp2).or(exp3)
[18:35:25] bronson: has joined #RubyOnRails
[18:35:39] norc: Not particularly pretty should it should be fairly trivial to impement using .send() :)
[18:35:49] smathy: That's Rails 5 only ^
[18:36:05] branchini: how would you add a varying .or(exp) depending on how many boxes were checked?
[18:36:09] douglascorrea: has joined #RubyOnRails
[18:36:36] norc: smathy, huh?
[18:36:37] branchini: and I am on rails 4
[18:36:45] smathy: norc, there's no .or in Rails < 5
[18:37:17] workmad3: norc: `or` is introduced in rails 5... and it also doesn't work quite like just an extra `where`... you do `Foobar.where("something").or(Foobar.where("something else"))`
[18:37:30] norc: smathy, oh. :)
[18:38:39] baweaver: has joined #RubyOnRails
[18:38:54] branchini: I dont get why i cant do something like .find_by_sql("Select * from Artists WHERE a = true OR b = true OR c = true")
[18:39:14] branchini: and then dynamically build the select string depending on the selceted checkboxes
[18:39:31] branchini: ive tried where the fields = '1' and = 1
[18:40:03] workmad3: branchini: because then you need to worry about SQL injection in a massive way
[18:40:49] branchini: well I don't think so. I have a get request to a search method. I am getting a hash of stuff from params, so the check box comes back a = 1
[18:41:17] branchini: then for every field, i build the string, so I dont directly put what they input in the query. But it's not working...
[18:41:37] norc: branchini, not a big fan of SO generally, but this one seems to mention 3 possibilities: http://stackoverflow.com/a/31096106
[18:41:50] blackmesa: has joined #RubyOnRails
[18:41:51] smathy: branchini, you can make `or` with arel tricks, so for your above: Artist.where Artist.where( params[:artist].slice(:a, :b, :c).select{|*,v| v == true} ).where_values.reduce(:or)
[18:42:01] norc: branchini, "its not working" is the best error description. Tells us a lot about your code, the stack trace... :)
[18:43:06] branchini: Ok thanks. I'm gonna check that link. If I cant get it I will post a link to the code. Sorry for not being more descript on the errors
[18:43:56] cassioscabral: has joined #RubyOnRails
[18:44:04] FLeiXiuS: what do you guys recommend for a syntax highlighter / editor that's preferably light weight.
[18:44:41] FLeiXiuS: I need to highlight and allow editing some very basic scripts stored within text blocks.
[18:45:21] workmad3: FLeiXiuS: I've been fond of CodeMirror in the past... it's not super lightweight, but it's at least built in a way that you only pull in the pieces/plugins you want, and it's nicely themeable too
[18:45:21] jeanlinux: has joined #RubyOnRails
[18:45:47] norc: FLeiXiuS, editors are like religion - pick one and do not talk about it.
[18:46:11] workmad3: norc: wrong sort of editor discussion, I think ;)
[18:46:30] FLeiXiuS: workmad3, ^
[18:46:39] norc: workmad3, I have yet to see good things come out of any editor related discussion. ;-)
[18:46:44] FLeiXiuS: I've used redcloth for a while - but its not really what I was looking for.
[18:46:59] FLeiXiuS: norc, Im speaking in reference to html editors ;-)
[18:47:04] [Butch]: has joined #RubyOnRails
[18:47:09] FLeiXiuS: Or rather, html web based editors *
[18:47:20] FLeiXiuS: Wow that can get confusing, much like it did.
[18:47:46] workmad3: norc: a.k.a. it's the discussion that starts with "All of the options are shit. Which one is least shit?" and tends to get fewer people worked into a religious frenzy :)
[18:47:50] FLeiXiuS: Let me take a look at code mirror.
[18:47:52] Timberwo|f: has joined #RubyOnRails
[18:48:04] FLeiXiuS: We all know sublime reigns.
[18:48:20] norc: FLeiXiuS, Oh!
[18:48:32] norc: Look at the damage I did.
[18:48:41] norc: We can forget about having any rails related discussion for the next 30 minutes or so.
[18:48:58] workmad3: norc: that's good... I'm off in 10 minutes :)
[18:49:06] srinidhi: has joined #RubyOnRails
[18:49:29] sneakerhax: has joined #RubyOnRails
[18:50:48] hiljusti: has joined #RubyOnRails
[18:50:50] mices: has joined #RubyOnRails
[18:50:55] norc: workmad3, clearly your last argument made such a strong case that nobody even dares to oppose.
[18:51:27] smathy: /TOPIC editor fight - GO!
[18:51:44] htmldrum: has joined #RubyOnRails
[18:52:02] shanemcd: has joined #RubyOnRails
[18:52:30] Pazician: has joined #RubyOnRails
[18:52:31] FLeiXiuS: I feel like im out of lube for this conversation.
[18:53:04] pipework: ACTION slides a drink down the table to FLeiXiuS
[18:53:55] hahuang61: has joined #RubyOnRails
[18:54:03] norc: So I have a library that makes great use of Net::Telnet to interface with.. things. For obvious reasons I have avoided writing any kind of specs - so...
[18:54:27] norc: I want to mock Net::Telnet but cannot seem to find anything :(
[18:54:54] FLeiXiuS: norc, I'd tell you a pretty good joke about UDP, but you might not get it.
[18:55:14] ddv: did someone ask what the best editor is?
[18:55:18] FLeiXiuS: Sorry I thought we were still off topic.
[18:55:33] norc: FLeiXiuS, heh. funny.
[18:55:42] ddv: the best editor is.....
[18:55:48] ddv: of course
[18:56:48] norc: Meh, I would really like something like VCR to work with my telnet library. :(
[18:56:59] adavia: has joined #RubyOnRails
[18:57:33] mDuff: Hmm; switched to form_for, and we're closer to working. Still not matching in the routes, but at least this time it *looks like* it should match. :)
[18:57:35] mDuff: No route matches [DELETE] "/ca_certs/C%253DUS%253BST%253DIllinois%253BL%253DChicago%253BO%253DTest%20Org%253BOU%253DTest%20OU%253BCN%253DTest%20Org%20CA%253Bname%253DEasyRSA%253BemailAddress%253Dchaduffy@cisco.com%253Bserial%253D15525610047165600394.crt" ...but the following route exists: ca_cert_path DELETE /ca_certs/:id(.:format) ca_certs#destroy
[18:57:42] bronson: has joined #RubyOnRails
[18:58:51] norc: mDuff, Im guessing the period (from the email address) in your :id is causing the issues.
[18:59:49] norc: mDuff, http://guides.rubyonrails.org/routing.html#dynamic-segments
[19:00:13] mDuff: Thank you!
[19:00:59] UrbanM: has joined #RubyOnRails
[19:01:01] shanemcd: has joined #RubyOnRails
[19:02:27] ZtabuDus: has joined #RubyOnRails
[19:04:29] nullwarp: has joined #RubyOnRails
[19:05:20] y2mq37: has joined #RubyOnRails
[19:06:46] shanemcd: has joined #RubyOnRails
[19:06:54] B1n4r10: has joined #RubyOnRails
[19:07:17] _3by8: has joined #RubyOnRails
[19:07:19] blackmesa: has joined #RubyOnRails
[19:07:32] nettoweb: has joined #RubyOnRails
[19:08:38] baweaver: has joined #RubyOnRails
[19:08:53] jenrzzz: has joined #RubyOnRails
[19:09:04] _3by8: I have a potential client who wants me to build a form for them for their GoDaddy website. They used their Website Builder software to do it with. Looks like I can use an iframe. Can anyone think of any reasons why that's a bad idea or why it might not work?
[19:10:21] openstruct: It's a Rails app with autogenerated code from GodDaddy's software?
[19:11:21] _3by8: I'm thinking about embedding a Rails app into their page using an iframe.
[19:11:24] PlasmaStar: has joined #RubyOnRails
[19:11:34] ur5us: has joined #RubyOnRails
[19:11:45] norc: _3by8, HSTS/X-Frame-Options
[19:12:30] nullwarp: has joined #RubyOnRails
[19:12:40] norc: _3by8, ignore the HSTS part. But the webserver needs to be configured to allow for it.
[19:13:00] _3by8: norc: on my end?
[19:13:02] smathy: _3by8, why an iframe? You know that a form just submits to a URL right?
[19:13:47] norc: _3by8, the webserver that serves the page that includes the iframe can be configured to specifically deny iframes, which all modern browsers will respect.
[19:13:57] soahccc: At which level would you consider it worth it to actively trying to reduce object allocations per request? I got interested with the frozen string discussion going on and new insights on allocation via monitoring
[19:14:36] Guest34101: has joined #RubyOnRails
[19:14:41] pawnbox: has joined #RubyOnRails
[19:14:46] smathy: soahccc, at the point where solving the problem with hardware becomes impossible.
[19:14:57] _3by8: smathy: I'm not sure if I'm understanding what you're saying but since I can't use Ruby on their hosting plan, I was going to create a small app that I could inline on one of their pages.
[19:15:12] _3by8: smathy: Is there a better way to do it?
[19:15:42] norc: _3by8, I think the webserver in fact needs to explicitely be configured to allow for cross-domain origins in your iframe.
[19:15:55] norc: Since any other configuration would be a violation of the same-origin policy.
[19:16:12] soahccc: smathy: well our site is quite fast for what it does I think and hardware is not even remotely at the limit. I just saw these big numbers and wanted to reduce them... ~180k allocs for our front page (shop)
[19:16:16] _3by8: norc: I see, I'm going to sign up for a month just to test this out and see if it works.
[19:16:25] smathy: _3by8, yes, I understood what your plan was, I was saying that you can just put the form code up on their godaddy site with an action="http://your.rails.domain/foo"
[19:17:00] pawnbox: has joined #RubyOnRails
[19:18:34] _3by8: smathy: unfortunately I don't think that will work, I have suuuuper limited options when it comes to actually building a form on their side. My freedom to put script elements which the customer needs and then style those elements is apparently pretty limited.
[19:19:11] jenrzzz: has joined #RubyOnRails
[19:19:13] smathy: _3by8, I think norc is mistaken, as long as your page within your iframe doesn't have JS that tries to interact with the code outside the iframe, then it shouldn't be a problem.
[19:19:27] _3by8: smathy: great, thanks :)
[19:19:40] norc: smathy, ah I was thinking the other way around.
[19:19:43] _3by8: You guys are super helpful, I love it.
[19:19:50] norc: smathy, the rails webserver still needs to send the X-Frame-Options header though.
[19:20:07] norc: smathy, but if _3by8 is in control of the rails server (or rather the http server) this should not be an issue.
[19:20:50] smathy: norc, I don't think it will, I think as long as the iframe loads the rails page, which then submits back to the same server, it should be fine.
[19:22:11] smathy: norc, AFAIK the policy stuff is only if your 'iframe'd page and the framING page interact in some way. I've not re-tested this in the latest browsers, so maybe they've added some new junk recently, but that's how it always was.
[19:23:12] soahccc: smathy: rails recently sets x-frame-options by default iirc. We have this on our "iframeable actions"... https://gist.github.com/2called-chaos/719770a3604bba0f07fb
[19:23:43] norc: smathy, nope - the reason is basically to prevent so called clickjacking attacks, where you load an outside (trusted) website, overlay hidden elements over the iframe - and then have the user interact with your website, while he thinks he is interacting with the trsuted frame.
[19:25:00] BtcBen: has joined #RubyOnRails
[19:25:51] dirtibirdi: has joined #RubyOnRails
[19:28:50] Pandorian: has joined #RubyOnRails
[19:32:31] arup_r: has joined #RubyOnRails
[19:32:42] s2013: has joined #RubyOnRails
[19:33:11] _3by8: soahccc: that looks like that just disables iframes on the Rails side of things.
[19:33:25] smathy: norc, (and soahccc), just to be sure we're talking about the same thing, I'm refuting this comment from you: "I think the webserver in fact needs to explicitely be configured to allow for cross-domain origins in your iframe" If the contained site does not send an X-Frame-Options then all will be good, yes, Rails sends this - so you'll need to remove it, but you don't need any explicit allow.
[19:33:49] jenrzzz_: has joined #RubyOnRails
[19:34:21] soahccc: smathy: aye
[19:34:25] smathy: soahccc, re your alloc - I'm just telling you when I'd care, ie. when it becomes a problem that I can't solve with hardware.
[19:34:34] bronson: has joined #RubyOnRails
[19:34:43] LowTemplar: I don't think i'm understanding embedded ruby very well.
[19:35:29] LowTemplar: I want to simply do this in ruby : 5.times do puts "hello" end on a .erb page, but formatting that into the <% doesn't make much sense
[19:35:29] soahccc: LowTemplar: that doesn't really have that much to do with rails or ruby. at least if you just frame it
[19:35:30] smathy: LowTemplar, are you meaning ERB?
[19:35:47] smathy: LowTemplar, !gist your template
[19:35:47] helpa: LowTemplar: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[19:37:11] dirtibirdi: has joined #RubyOnRails
[19:38:17] LowTemplar: Here we are, https://gist.github.com/tikonwc3/85372f6cc2423704463c#file-basic-output-html-erb . I would think that this would just straight up print it to the page when it hits puts, but it doesn't at all
[19:38:23] norc: LowTemplar, <% is just for outer control code and does not print the result.
[19:38:53] arup_r: yeah, I can't write ERB code here in IRC.. it will be having a syntax error. lol
[19:39:26] arup_r: LowTemplar: in ERB <%= "hi" %> prints
[19:39:46] mrgreenfur: has joined #RubyOnRails
[19:39:48] arup_r: and <% %> just executed the code, nothing more than that
[19:40:02] norc: LowTemplar, puts prints to STDOUT. ERB cares about what your expression returns.
[19:40:13] norc: LowTemplar, puts itself returns nil.
[19:40:39] norc: LowTemplar, and more importantly the outer expression is just 5.times do end
[19:40:57] norc: So the entire expression will return 5.
[19:41:09] LowTemplar: Ahh that makes sense
[19:41:37] mices: has joined #RubyOnRails
[19:41:47] LowTemplar: So if instead I change it to puts "5" I can just say 5, and it will do so. That makes sense ^^
[19:42:10] norc: LowTemplar, well currently the erb will actually return something. It will in its current state print 5.
[19:42:33] norc: Shame, looks like no eval bot here.
[19:42:56] LowTemplar: I wrote that horribly, I need my coffee. I can change puts "5" to just 5 or if I made a variable beforehand I could print its value by just putting it in there.
[19:42:58] smathy: LowTemplar, any time you use <%= imagine that being replaced with a `puts` to the web browser at that position in the document.
[19:43:11] codesoda: has joined #RubyOnRails
[19:43:22] LowTemplar: smathy, thank you. That is incredibly vision clearing.
[19:44:01] LowTemplar: norc , thank you for the in depth explanation. I feel much less scatterbrained now.
[19:44:49] norc: LowTemplar, https://gist.github.com/norc/593c8a4060e1c92789ed
[19:44:55] norc: this is probably what you meant to do.
[19:45:29] smathy: LowTemplar, I put some possible ways of doing what I think you're trying to do in the comments of your gist: https://gist.github.com/tikonwc3/85372f6cc2423704463c#gistcomment-1713175
[19:45:43] LowTemplar: That is exactly what I did, I got it working now
[19:46:07] Rodya_: has joined #RubyOnRails
[19:46:40] norc: LowTemplar, also since you seem to be starting right now, you might want to directly start off with slim instead of erb.
[19:46:46] LowTemplar: I haven't seen .map before, this is the language that just keeps giving
[19:47:23] norc: LowTemplar, it feels a lot more like ruby and saves you a lot of time dealing with HTML (which Im assuming you will be doing since we are in rails)
[19:47:24] Radar: GOOD MORNING
[19:47:26] ayoros: has joined #RubyOnRails
[19:47:34] Radar: LowTemplar: Why did you PM me yesterday?
[19:47:44] dionysus69: how do I join rails community on slack? I submitted a form application from http://www.rubyonrails.link/ yesterday, now what?
[19:47:49] dirtibirdi: has joined #RubyOnRails
[19:47:59] Radar: LowTemplar: oh I see now. I was out of brain
[19:48:05] Radar: dionysus69: you wait to be accepted by the magical cabal
[19:48:07] LowTemplar: norc , I would love to take a more gentle approach, but my boss said do it this way and only this way and also put it on openshift and read this seemingly outdated book. tl;dr I can't go to anything else
[19:48:08] norc: dionysus69, Id be willing to accept any 5 digit donation or more to help speed up your application!
[19:48:37] Radar: dionysus69: much like norc, I will accept a _4_ digit donation to speed it up
[19:48:43] dionysus69: haha interesting, who checks the forms one admin or couple ?
[19:48:58] LowTemplar: I'll accept a 3 digit donation.
[19:49:06] LowTemplar: I won't do anything useful, i'll just take it.
[19:49:11] dionysus69: ah I am sorry I am not rich I would donate though for fun if I were xD
[19:49:58] VojvodaDjujic: has joined #RubyOnRails
[19:50:28] LowTemplar: Radar , about your book on rails : How often do you cover subjects in depth? I read Agile dev with rails 4 and was incredibly dissapointed with how slapshod it felt.
[19:51:02] Radar: LowTemplar: the whole book is in-depth.
[19:51:15] Radar: everything DHH has done / been involved in recent years has been slapshod
[19:51:23] VojvodaDjujic: hey has anybody tried rails docker image?
[19:51:24] Radar: rbenv, turbolinks, actioncable
[19:51:28] VojvodaDjujic: from official hub?
[19:51:31] Radar: VojvodaDjujic: !used
[19:51:31] helpa: VojvodaDjujic: Don't ask "does anyone use <thing>?". It's better to just state your problem and if anyone has used <thing> they will most likely answer.
[19:51:57] VojvodaDjujic: I am interested if it works with capybara-webkit
[19:52:14] VojvodaDjujic: since many images do not work ok with headless webkit
[19:52:33] VojvodaDjujic: if somebody knows if it works out of the box it would save me the effort
[19:53:13] freen: has joined #RubyOnRails
[19:53:22] norc: Radar, my first DHH video was a hate speech about composite primary keys, and how dumb db admins must be to even consider them - it was also the last DHH video I ever watched.
[19:53:38] LowTemplar: Wait a darn minute.
[19:53:55] netzfisch: has joined #RubyOnRails
[19:54:10] jenrzzz: has joined #RubyOnRails
[19:54:10] LowTemplar: It seems the general consensus here is that DHH is awful. Have I been lied to about the accredation of their books?
[19:55:26] smathy: DHH is just a contrarian.
[19:56:06] VojvodaDjujic: but did he ran webkit in docker rails image successfuly?
[19:56:17] LowTemplar: Oh, like Linus and his C hacking lol
[19:56:21] smathy: VojvodaDjujic, you could have found out for yourself by now ;)
[19:56:45] smathy: LowTemplar, Linus isn't so much contrarian as just intolerant.
[19:56:59] dirtibirdi: has joined #RubyOnRails
[19:57:00] jenrzzz: has joined #RubyOnRails
[19:57:04] smathy: DHH can be pretty intolerant too :)
[19:57:49] manfrin: has joined #RubyOnRails
[19:58:12] norc: None of them compare to Ulrich Drepper though.
[19:58:25] norc: Obligatory bug report while we are at it: https://sourceware.org/bugzilla/show_bug.cgi?id=10134
[19:58:32] LowTemplar: Never heard of him, must have done something awful.
[19:58:49] smathy: LowTemplar, re being "awful" - this is about as "awful" as he gets: https://m.signalvnoise.com/the-majestic-monolith-29166d022228#.h54xblth0 Make up your own mind.
[19:59:13] srinidhi1: has joined #RubyOnRails
[19:59:34] norc: LowTemplar, he was basically controlling the development of the glibc for the majority of the time.
[19:59:59] norc: LowTemplar, and the bug description fits how most people around the internet perceived him pretty well.
[20:01:35] yvbh: has joined #RubyOnRails
[20:02:11] LowTemplar: norc, I'm afraid i'm too much of a noob to understand some of what he is saying, but i'm sure it will make sense when I finally get a dev job
[20:02:28] aweis: has joined #RubyOnRails
[20:02:38] openstruct: has joined #RubyOnRails
[20:03:19] norc: LowTemplar, http://www.sourceware.org/ml/libc-alpha/2000-08/msg00061.html -- just read this random example I pulled off the internet to get a taste of his personalitz.
[20:03:51] pawnbox: has joined #RubyOnRails
[20:03:52] yvbh: Can I get to have a look at the submitted proposals of GSOC 2015?
[20:05:47] asdfghjkl_: has joined #RubyOnRails
[20:07:22] norc: LowTemplar, generally any bug that was assigned to him had a high chance of being responded to with "fuck off" or "you dont pay me"
[20:07:38] mrbubbles: has joined #RubyOnRails
[20:07:51] treehug88: has joined #RubyOnRails
[20:08:07] tubbo: LowTemplar: you are trying to use a channel full of opinionated, lazy trolls as the means by which you validate DHH's legitimacy? ;)
[20:08:50] FooMunki: has joined #RubyOnRails
[20:08:51] smathy: Pfft, Drepper was ok, he hated Stallman - so can't be too bad.
[20:09:12] makenoise: has joined #RubyOnRails
[20:10:27] tubbo: y'all act as if DHH ever did anything not slapshod
[20:10:41] arup_r: How these clever people running ERB inside a JS file? :D https://github.com/danielspaniel/ember-data-factory-guy/blob/master/blueprints/factory/files/tests/factories/__name__.js
[20:10:45] tubbo: i mean, there was a reason why rails 2.3 was rewritten and merged with Merb, because there was no place else to go
[20:11:12] smathy: Crybabies are even more numerous than assholes on the internet.
[20:11:15] tubbo: arup_r: i'm gonna say that's EJS, not ERb
[20:11:22] LowTemplar: Wow, those are some rude emails..
[20:11:49] tubbo: arup_r: haha they are very easy to confuse
[20:13:08] ayoros: has joined #RubyOnRails
[20:13:16] smathy: tubbo, "opinionated, lazy trolls" - wow, h8r
[20:13:33] jenrzzz: has joined #RubyOnRails
[20:14:12] nettoweb: has joined #RubyOnRails
[20:14:14] noodman: has joined #RubyOnRails
[20:15:50] LowTemplar: wow. opinions, so confuse, so learning, wow
[20:17:16] ishitaverma: has joined #RubyOnRails
[20:17:18] arup_r: anyway, my mind is slipping towards to Ember slowly..
[20:17:19] yvbh: Can I get to have a look at the submitted proposals of GSOC 2015?
[20:17:48] arup_r: that community and framework is so attractive... I couldn't prevent myself.
[20:18:11] smathy: You're dead to me.
[20:18:43] tubbo: smathy: <3
[20:18:58] arup_r: ACTION don't get short english.. :/
[20:19:03] tubbo: smathy: been reading too much @holman recently https://zachholman.com/posts/deploying-software
[20:19:16] smathy: arup_r, http://www.urbandictionary.com/define.php?term=you%27re+dead+to+me
[20:20:35] arup_r: ok. read it there..
[20:21:43] nerium: has joined #RubyOnRails
[20:21:48] smathy: You know I love you arup_r (not really, really you're dead to me (not really, really just winding you up (not really, dead to me (aww, c'mon, I can't stay mad at you (yes I can ;)))))
[20:21:54] johnflux: has joined #RubyOnRails
[20:21:54] johnflux: has joined #RubyOnRails
[20:21:59] tubbo: ^ everything is an expression
[20:22:02] ishitaverma: has joined #RubyOnRails
[20:22:09] shanemcd: has joined #RubyOnRails
[20:22:42] arup_r: I got bored with remote: true.. that's why :p
[20:22:47] tubbo: i've also been following the developments on 'cssx' which is kinda like JSX except it's CSS.
[20:22:54] slash_nick: smathy: (i think that's missing a closing ;))
[20:23:00] smathy: tubbo, yeah, Zach has a lot of good things to say, but I gave up a long while ago looking for useful AND correct code.
[20:23:12] smathy: slash_nick, I count the mouth as a close.
[20:23:17] LowTemplar: I should have just learned ruby instead of PHP. So much easier to do so much. Too bad it feels nothing like any other language i've done
[20:23:17] slash_nick: well, it crashed my client
[20:23:43] tubbo: arup_r: so a react component could, in the future, include the JS actions, CSS rules, and HTML markup.
[20:23:51] tubbo: which is basically what web components wanted to do
[20:23:52] baweaver: has joined #RubyOnRails
[20:24:02] tubbo: WHY DIDNT WE JUST DO THAT THREE FUCKING YEARS AGO
[20:25:04] pawnbox: has joined #RubyOnRails
[20:25:28] arup_r: react next year then, and after that meteor.. after that I don't know.. hehe
[20:26:28] arup_r: hum.. true true...
[20:26:44] arup_r: tubbo: Are you already started ?
[20:28:44] dirtibirdi: has joined #RubyOnRails
[20:29:14] tpendragon: Been playing with phoenix/elixir for a month or so, much fun.
[20:30:01] yxejamir: has joined #RubyOnRails
[20:31:00] ishitaverma: Where do we submit our proposal for RGSOC or GSOC? How to go about it?
[20:31:49] msyvich: has joined #RubyOnRails
[20:32:15] LowTemplar: Question for someone with decent xp with rails 4: I have to pull many, many things from several tables. Any reccomended way to do that?
[20:33:10] Jasaka: has joined #RubyOnRails
[20:33:24] Scient: thats a really bad question
[20:33:30] Scient: you need to be more specific
[20:33:46] stannard: has joined #RubyOnRails
[20:33:59] baweaver: has joined #RubyOnRails
[20:34:14] Scriptonaut: has left #RubyOnRails: ()
[20:34:40] hahuang61: has joined #RubyOnRails
[20:34:45] jeanlinux: has joined #RubyOnRails
[20:35:23] LowTemplar: Fair enough, I want to use orm to do this, but where do I even begin? I have the db properly hooked up, but i've never really done ORM, and my lack of rails experience makes me wonder where I should even place the file. I'm currently thinking in controller
[20:35:37] jenrzzz: has joined #RubyOnRails
[20:36:06] smathy: ishitaverma, seriously, did you try googling gsoc?
[20:36:08] nettoweb: has joined #RubyOnRails
[20:36:27] smathy: tubbo, many years ago, in a quiet corner of the world, wise old English gentleman named Tim Berners-Lee (along with the Swiss) invented a new, simpler, markup language and network protocol for internet-based documents. He gazed at his creation and he was pleased. What seemed like the next day, a crazy young American named Rob McCool shoehorned CGI into the first httpd and in doing so opened a portal to hell which could never be closed. Since
[20:36:27] smathy: that day we've all been building the most complex asynchronous, remote, graphical applications using an infrastructure that was basically designed for university libraries to share academic documents.
[20:37:02] smathy: LowTemplar, !querying
[20:37:03] helpa: LowTemplar: http://guides.rubyonrails.org/active_record_querying.html - ActiveRecord Querying Guide by Ryan Bigg
[20:39:00] mDuff: has joined #RubyOnRails
[20:39:28] LowTemplar: Thanks smathy ^^
[20:39:43] Guest34101: has joined #RubyOnRails
[20:39:57] tubbo: smathy: haha
[20:40:03] lemur: has joined #RubyOnRails
[20:40:16] tubbo: ACTION believes there's a sweet spot in the middle between documents and applications
[20:41:15] smathy: Pick any web app and there are SOOOO many better platforms on/with which to deliver that same (better really) functionality, but OMG, browsers, everyone has them, no install, and google makes finding my "app" easier.
[20:41:46] smathy: tubbo, yeah, Sun thought there was too ;)
[20:42:04] smathy: ...and Macromedia/Adobe :)
[20:42:16] smathy: ...and Microsoft.
[20:42:26] djbkd: has joined #RubyOnRails
[20:42:36] tubbo: ehh, that's a stretch
[20:42:52] tubbo: none of them cared about the web's real power: mass interoperability
[20:42:56] tubbo: too busy caring about vendor lock-in
[20:43:04] tubbo: no lock-in no cry
[20:43:11] smathy: Hard to argue that about Java really.
[20:43:20] tubbo: or silverlight
[20:43:27] tubbo: or $CLOSED_BROWSER_PLUGIN
[20:43:33] smathy: No, I mean hard to argue that Java was about vendor lockin.
[20:43:53] tubbo: smathy: why else would sun create such a massive ecosystem around it?
[20:44:08] hello9: has joined #RubyOnRails
[20:44:16] smathy: ...because they thought it was a better way to build apps than HTML/CSS/JS.
[20:44:33] tubbo: that's what they told you, yeah ;)
[20:44:55] ewnd9: has joined #RubyOnRails
[20:45:27] hello9: when dealing with an object name that doesn't have a plural form (e.g information, help, traffic, etc.) is it more the 'rails way' to leave the controller/views in the false plural form? (informations, helps, traffcs, etc.)?
[20:45:50] smathy: You could definitely argue that they were late to the party, I don't think they opened it until 2006.
[20:46:48] smathy: ...before then it was still free for developers, the lock in was on the browser-author side of things.
[20:46:54] bphogan: hello9: I don't.
[20:47:59] bphogan: hello9: I also go with the rule that a URL should express the content, regardless of what the model name is. So, if traffic/show/1 makes sense, cool.
[20:48:12] smathy: hello9, no, in fact "Information".pluralize # => "Information". It's rails way to add an inflection exception for it.
[20:48:42] bphogan: but perhaps city/chicago/traffic might be more appropriate from a URL standpoint. (I have no idea what you are doing tho so ignore me)
[20:49:17] bphogan: hello9: but definitely add your own inflections for things and Rails will handle it all for ya. Just did that with criteria/criterion.
[20:49:20] hello9: bphogan, that's right alone the lines. say it was like city/1/traffic vs city/1/traffics
[20:49:27] hello9: traffics is how it comes out by default
[20:49:45] hello9: is that bad practice since it
[20:49:45] bphogan: hello9: but are you doing city/1/traffics/25/edit/
[20:49:50] hello9: s not a real work
[20:49:53] bphogan: or is traffic just a list of the traffic for a city
[20:50:00] hello9: its nested
[20:50:04] hello9: has its own resources
[20:50:22] bphogan: ok. Then yea… just use inflection and when you generate the controller all will be taken care of for you :)
[20:50:33] smathy: hello9, http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html#method-i-inflections
[20:50:56] rodferso1: has joined #RubyOnRails
[20:51:11] bphogan: hello9: see config/initializers/inflections.rb :)
[20:51:22] trosborn: has joined #RubyOnRails
[20:51:25] adavia: has joined #RubyOnRails
[20:51:29] hello9: ah okay, thanks a lot
[20:51:42] puff: has joined #RubyOnRails
[20:53:01] emachnic: has joined #RubyOnRails
[20:54:52] ishitaverma: has left #RubyOnRails: ()
[20:56:26] emachnic: has joined #RubyOnRails
[20:56:49] diego4: has joined #RubyOnRails
[20:57:08] diego4: has joined #RubyOnRails
[20:58:43] snowy: has joined #RubyOnRails
[20:59:35] mices: has joined #RubyOnRails
[21:00:43] mices: i migrated my app to another machine and getting the error
[21:00:43] mices: Faraday::ConnectionFailed in Devise::SessionsController#create
[21:01:52] jheathco: has joined #RubyOnRails
[21:02:24] dirtibirdi: has joined #RubyOnRails
[21:05:17] jheathco: [jheathco:~/sites/les.dev on master*]# rvm use 1.9.3
[21:05:17] jheathco: ruby-1.9.3-p448 is not installed.
[21:05:25] jheathco: this make sense to anyone if i've got 1.9.3-p327 installed?
[21:05:32] jheathco: and why it won't use whichever variant i have?
[21:07:00] rubyonrailed: I'm having problems with setting up travis-ci with rails and airbrake. I set the environment variables and am getting this error. The gist has my airbrake config, travis.yml, and errors. https://gist.github.com/JasonMannon/83a344907dda902a3fa5
[21:08:23] ql6wlld: has joined #RubyOnRails
[21:09:19] makenoise: has joined #RubyOnRails
[21:17:02] josephkokenge: has joined #RubyOnRails
[21:18:44] Coldblackice: has joined #RubyOnRails
[21:18:56] zave: has joined #RubyOnRails
[21:19:12] matthias_: has joined #RubyOnRails
[21:19:57] s2013: has joined #RubyOnRails
[21:24:20] zave: has joined #RubyOnRails
[21:26:49] shanemcd: has joined #RubyOnRails
[21:27:53] manfrin_: has joined #RubyOnRails
[21:30:10] Pandorian: has joined #RubyOnRails
[21:30:19] mdw: has joined #RubyOnRails
[21:30:56] uglybandersnatch: has joined #RubyOnRails
[21:31:36] douglasc_: has joined #RubyOnRails
[21:32:53] Cohedrin: has joined #RubyOnRails
[21:33:45] xploshioon: has joined #RubyOnRails
[21:33:49] sypheren: has joined #RubyOnRails
[21:34:05] smathy: jheathco, the bare version probably equates to the highest/latest patch, use the full "1.9.3-p327" string instead.
[21:36:06] deuxclique: has joined #RubyOnRails
[21:37:02] xploshioon: in a nested form, how can I validate if "ID"... if I make and f.input i can see the value, but in and if how can I know the value?
[21:38:01] arup_r: f.object.id
[21:38:05] arup_r: xploshioon: ^
[21:38:14] smathy: rubyonrailed, putting env vars on separate lines creates multiple entries in the travis test matrix.
[21:38:28] jheathco: has left #RubyOnRails: ()
[21:38:58] jenrzzz: has joined #RubyOnRails
[21:39:50] smathy: rubyonrailed, ie. see https://docs.travis-ci.com/user/environment-variables/#Defining-Multiple-Variables-per-Item
[21:40:36] quazimodo: has joined #RubyOnRails
[21:40:37] quazimod1: has joined #RubyOnRails
[21:40:37] quazimod2: has joined #RubyOnRails
[21:44:00] atomical_: has joined #RubyOnRails
[21:44:42] trosborn: has joined #RubyOnRails
[21:44:54] n008f4g_: has joined #RubyOnRails
[21:45:11] theunraveler: has joined #RubyOnRails
[21:46:31] kirillzh: has joined #RubyOnRails
[21:49:09] kirillzh: has joined #RubyOnRails
[21:49:16] quazimodo: has joined #RubyOnRails
[21:49:23] 7JTAACKRB: has joined #RubyOnRails
[21:49:23] 64MAAHBJN: has joined #RubyOnRails
[21:49:48] kirillzh: How to move this functionality into separate method so I can reuse it? https://gist.github.com/kirillzh/a1726059822b183760a6
[21:50:31] kirillzh: https://gist.github.com/anonymous/05ceaa4c7e6577e7db31
[21:55:00] jsrn_: has joined #RubyOnRails
[22:00:21] xploshioon: @arup_r that works,thanks
[22:00:45] FernandoBasso: has joined #RubyOnRails
[22:01:20] norc: kirillzh, are you asking about how to define a method in ruby?
[22:01:32] norc: Perhaps a beginners book might be best for you then.
[22:01:53] czerasz: has joined #RubyOnRails
[22:01:56] kirillzh: norc specifically this block of code
[22:02:00] dirtibirdi: has joined #RubyOnRails
[22:02:20] norc: kirillzh, other than you not knowing how methods are defined, I do not understand your problem.
[22:02:48] kirillzh: norc or is there a better way to cache only if certain condition is met?
[22:03:01] baweaver: has joined #RubyOnRails
[22:03:11] Spami: has joined #RubyOnRails
[22:05:25] smathy: kirillzh, your second question is nothing to do with your first.
[22:06:06] kirillzh: smathy agreed. Never mind the first one.
[22:06:20] wethu: has joined #RubyOnRails
[22:07:13] LowTemplar: Noob question for the rails wizards, When I created my rails app, I didn't think about it using sqlite at the get go. While I do have the db hooked up in the config, is there anything else I need to take care of before generating a model?
[22:07:17] norc: kirillzh, if you want to know how to put this into a method, I recommend you get a basic Ruby book because learning the first basics of Ruby is out of the scope of this channel.
[22:07:44] s2013: has joined #RubyOnRails
[22:08:17] leksster: has joined #RubyOnRails
[22:08:24] norc: LowTemplar, probably not. Why dont you try and see?
[22:08:49] Ropeney: has joined #RubyOnRails
[22:08:58] LowTemplar: norc because i'm afraid i'll do the equivelant of deleting system32 in windows. At least I can always reclone if it dies horribly :P
[22:09:04] mdw: has joined #RubyOnRails
[22:09:34] norc: LowTemplar, http://guides.rubyonrails.org/getting_started.html
[22:09:44] norc: An excellent concise guide telling you the basic steps to get rolling.
[22:10:12] Spami: has joined #RubyOnRails
[22:10:25] tvw: has joined #RubyOnRails
[22:11:21] branchini: has joined #RubyOnRails
[22:11:37] LowTemplar: norc, I've been trained using pluralsight, I'm mostly trying to put it all together. However, this is actually pretty comprehensive and looks like it will be a great reference.
[22:11:45] smathy: kirillzh, your current code won't work, your delete will run before the write happens.
[22:12:33] kirillzh: smathy I understood that as well. Trying to write method using read and write without fetch.
[22:13:57] DEA7TH: has joined #RubyOnRails
[22:14:32] sevenseacat: has joined #RubyOnRails
[22:15:25] codesoda: has joined #RubyOnRails
[22:15:56] trinaldi: has joined #RubyOnRails
[22:18:04] smathy: kirillzh, comment added to your gist: https://gist.github.com/anonymous/05ceaa4c7e6577e7db31#gistcomment-1713302
[22:19:43] jottr_: has joined #RubyOnRails
[22:20:00] maxdoubt: has joined #RubyOnRails
[22:20:30] maxdoubt: could somebody explain https://github.com/hashrocket/decent_exposure and why passing instance variables to the view is a bad practice?
[22:21:25] diego2: has joined #RubyOnRails
[22:21:32] manfrin: has joined #RubyOnRails
[22:23:24] smathy: maxdoubt, mostly OO theory about the visibility of instance variables.
[22:23:57] maxdoubt: smathy: right… to me, this gem feels like an unecessary abstraction layer
[22:24:11] sleungcy: has joined #RubyOnRails
[22:24:18] Mia: has joined #RubyOnRails
[22:24:18] Mia: has joined #RubyOnRails
[22:24:21] maxdoubt: smathy: so i’m just trying to understand any justification for its use
[22:24:35] bronson: maxdoubt: controller assigns tend to turn into soup.
[22:24:56] bronson: I know of a few views on our project where smart programmers have inadvertently allowed that to happen.
[22:25:24] bronson: That said, I'm not sure decent_exposure will do much to prevent that.
[22:25:37] maxdoubt: bronson: i get that, but moving the soup into a separate layer… doesn’t seem like the fix, rather a refactor would be ideal
[22:25:41] kirillzh: smathy thanks! That's what I got. https://gist.github.com/anonymous/05ceaa4c7e6577e7db31#gistcomment-1713302
[22:25:57] trosborn: there is a good railscast on it: http://railscasts.com/episodes/259-decent-exposure?view=asciicast
[22:26:22] smathy: maxdoubt, well the justification is basically that instance variables shouldn't be exposed outside of the class, like what if, in your controller, you set some instance variable so you can store state and run some other method in your controller. So then, because of that entirely reasonable and OOP use of an instance variable, you suddenly have a new variable exposed to any view that wants to use it.
[22:26:24] IrishGringo: has joined #RubyOnRails
[22:27:46] diego2: has joined #RubyOnRails
[22:27:52] hahuang61: has joined #RubyOnRails
[22:27:58] kirillzh: smathy in one case I just call Rails.cache.fetch_request(request), in another case I want to modify response, store it in cache and return
[22:28:14] bronson: not sure DE fixes that... expose(:person) is available in all views as well, right?
[22:28:28] teaearlgraycold: Is there a good way to see when the current rails session cookie will expire in JS?
[22:28:34] maxdoubt: bronson: that’s what i’m thinking… you’ve just turned instance variables into methods
[22:28:38] Axy: has joined #RubyOnRails
[22:28:38] Axy: has joined #RubyOnRails
[22:30:09] maxdoubt: in addition to losing some of the logic that the controller should be able to handle (eg: repond_to do |format|)
[22:30:19] smathy: maxdoubt, you've always been able to expose methods to views if you want using helper_method
[22:30:54] maxdoubt: i guess i’m just not seeing the advantages of using DE
[22:31:07] smathy: maxdoubt, no one's disagreeing with you.
[22:31:12] smathy: Time to move on now.
[22:32:05] xploshioon: has joined #RubyOnRails
[22:32:25] workmad3: has joined #RubyOnRails
[22:34:11] wethu: has joined #RubyOnRails
[22:35:40] baweaver: has joined #RubyOnRails
[22:37:32] workmad3: has joined #RubyOnRails
[22:39:04] tubbo: maxdoubt: i enjoy using decent_exposure.
[22:40:20] maxdoubt: tubbo: would you mind explaining what you like about it?
[22:40:38] smathy: tubbo is a self-proclaimed opinionated, lazy troll ;)
[22:40:45] tubbo: smathy: <3 u know it
[22:40:51] tubbo: but yeah i really do use decent_exposure
[22:41:03] tubbo: i even made a layer on top of it called controller_resources based on ye olde inherited_resources
[22:41:07] smathy: Not saying it's bad, just unnecessary.
[22:41:40] tubbo: maxdoubt: i find it useful, but also it's not necessary :) however, i use it in tandem with some other stuff to basically give me a one-liner that figures out what to call my model methods and what to set them to
[22:41:54] tubbo: https://github.com/tubbo/controller_resources
[22:42:08] Guest34101: has joined #RubyOnRails
[22:42:26] tubbo: basically i found myself writing the same 5-10 lines in each controller, and now all of my controller actions just illustrate the "happy path"
[22:42:50] tubbo: it's really just less typing than having to do @foos = Foo.where(params)
[22:42:57] maxdoubt: tubbo: ah, okay… i could see where it would be helpful for duplicating code across controllers
[22:43:14] tubbo: yeah it just makes everything as consistent as possible
[22:43:17] smathy: Not enough magic, you should infer the model name from the controller class.
[22:43:30] tubbo: smathy: pull requests welcome
[22:43:51] smathy: OMG, I just realized that I AM a lazy troll!
[22:44:16] bronson: tubbo: you'll know you've succeeded when controllers are 100% automatic, no lines needed.
[22:44:28] bronson: just define your routes and ship it. :)
[22:44:31] tubbo: they should be haha controllers suck
[22:45:00] tubbo: i usually permit my params in pundit policies too, like i wish i could just do controller(:posts) { index { Post.where(search_params) } } haha
[22:45:30] meoblast001: has joined #RubyOnRails
[22:46:15] smathy: No controllers, OMG, what would Rails become?
[22:46:29] stannard: has joined #RubyOnRails
[22:46:56] maxdoubt: that’s how i feel looking at my colleagues DE code, thinking to myself, “wtf does this do?!?”
[22:47:38] tubbo: smathy: merb?
[22:47:45] smathy: Exactly :)
[22:47:50] smathy: Merb/Sinatra/Roda/etc.
[22:48:54] branchini: I am hoping someone could help me. https://gist.github.com/branchdev/786c912344acdd7308ea I have a form of checkboxes that does a get request to my search page. I am having trouble when multiple checkboxes are ticked
[22:49:44] branchini: It is only returning the last box that was checked results. How could i go about looping over all the selected checkboxes and adding the results to the @results?
[22:51:52] smathy: branchini, what do you *think* `@results = something` will do?
[22:51:59] VojvodaDjujic: has left #RubyOnRails: ()
[22:52:11] smathy: branchini, anyway, I thought you were going to use an OR statement here?
[22:52:17] benlieb: has joined #RubyOnRails
[22:52:56] quazimodo: has joined #RubyOnRails
[22:52:57] quazimod1: has joined #RubyOnRails
[22:52:58] quazimod2: has joined #RubyOnRails
[22:53:05] branchini: I could not get an OR to work, I couldn't get the SQL select to work, this is the only way I was able to find to select checkbox booleans
[22:53:22] Devalo: has joined #RubyOnRails
[22:53:40] branchini: I was hoping @results would be an array of objects where each boolean field is true
[22:53:45] smathy: branchini, also, if you're claiming there's ever anything in @results then that's not your real code because [] is always true.
[22:55:38] branchini: its filling results that have the last option selected... not sure what you mean about real code
[22:55:45] smathy: branchini, you think assigning something with = will somehow add to any existing things in the thing you're assigning to?
[22:56:12] smathy: branchini, well, `if @keys` will never be false, so that else block which assigns to @results will never be entered.
[22:56:17] branchini: is there a way to do a += but wont duplicate if the object is already in the array?
[22:56:29] smathy: branchini, so if you're telling me that @results has a value other than [] then what you're showing in that gist is not your real code.
[22:57:06] smathy: Also, really: [11:41:51] smathy: branchini, you can make `or` with arel tricks, so for your above: Artist.where Artist.where( params[:artist].slice(:a, :b, :c).select{|*,v| v == true} ).where_values.reduce(:or)
[22:57:20] branchini: oh, i messed up at first then edited it, i had @temp, but i have @ resulsts in both parts of that if
[22:57:37] smathy: branchini, so instead of editing it, copy-paste so it's your actual code.
[22:57:46] merqlove: has joined #RubyOnRails
[22:57:50] smathy: branchini, but really, just do what I told you to do 4 hours ago.
[22:57:59] kirillzh: has joined #RubyOnRails
[22:58:33] branchini: sorry i hadn't seen that message. I will try that now
[22:58:52] hiljusti: has joined #RubyOnRails
[22:58:55] smathy: You'll need to change :a, :b, :c to whatever your params are, and remove the [:artist] if they're at the top level of params.
[22:59:23] smathy: You can remove the slice entirely if you just want any/all params which have true values.
[23:00:14] smathy: Oh, you might need == '1' instead of == true
[23:00:42] jenrzzz_: has joined #RubyOnRails
[23:00:48] smathy: ...I forgot that the `true` conversion happens later.
[23:02:16] _bogus_: has joined #RubyOnRails
[23:02:16] _bogus_: has joined #RubyOnRails
[23:02:28] smathy: branchini, I just commented in your gist: https://gist.github.com/branchdev/786c912344acdd7308ea#gistcomment-1713341
[23:02:29] DoctorMonocular: has joined #RubyOnRails
[23:02:50] smathy: (just fixed something, refresh)
[23:03:00] branchini: oh wow, ok thanks
[23:03:06] _bogus_: hi there.. does anybody knows a good example of how to load a form in a bootstrap modal dialog ? im trying some examples i've found on google without much success
[23:03:40] _bogus_: a form from a view
[23:05:19] snowy: has joined #RubyOnRails
[23:05:26] smathy: _bogus_, you don't just put the form inside the appropriate .model* wrappers?
[23:06:59] _bogus_: smathy, apparently... for now i can only show the model with static content.. there's somethings like "remote: true" and a _partial.js.erb to load the view inside the model.... but i cant get it to work.. it requests the file to the server but shows nothing
[23:07:05] _bogus_: i'll paste a gist
[23:07:46] uglybandersnatch: has joined #RubyOnRails
[23:07:50] smathy: Hmm, maybe I'm misunderstanding what "load a form" means.
[23:08:46] llakey: has joined #RubyOnRails
[23:09:02] chouhoulis: has joined #RubyOnRails
[23:09:18] _bogus_: https://gist.github.com/anonymous/551049c287acc006512a
[23:09:32] _bogus_: i want to load it using ajax
[23:09:59] _bogus_: the usuarios/new form (without layout) inside the modal dialog in site/index
[23:11:23] smathy: _bogus_, so no, just put the form into that code instead of the <p>hello</p>
[23:11:23] Mia: has joined #RubyOnRails
[23:11:23] Mia: has joined #RubyOnRails
[23:11:24] intrigueD: has joined #RubyOnRails
[23:11:45] smathy: _bogus_, like you'll have the form already there in your HTML, and then clicking the link will just display the modal with the form already there.
[23:11:46] jenrzzz: has joined #RubyOnRails
[23:14:21] deuxclique: has joined #RubyOnRails
[23:16:02] _bogus_: but later i'll need to load other forms...
[23:17:00] Papierkorb: has joined #RubyOnRails
[23:17:04] deuxcliq_: has joined #RubyOnRails
[23:19:39] differentreality: has joined #RubyOnRails
[23:20:22] trosborn: has joined #RubyOnRails
[23:21:07] banister: has joined #RubyOnRails
[23:21:58] [gmi]: has joined #RubyOnRails
[23:23:14] wethu: has joined #RubyOnRails
[23:25:57] kpwarr: I noticed that rails requires a superuser postgres account to do testing. Does it also require a superuser account in the production environment?
[23:26:10] jgpawletko: has joined #RubyOnRails
[23:27:54] uglybandersnatch: has joined #RubyOnRails
[23:28:49] LowTemplar: Rails has so many gotcha moments.
[23:29:56] bronson: kpwarr: don't think so. it just wants full perms for the db it's using.
[23:30:20] Pandorian: has joined #RubyOnRails
[23:30:53] bronson: LowTemplar: such as? url_helpers are on my list. so much time spent trying to get url_for to do the right thing...
[23:31:28] makenoise: has joined #RubyOnRails
[23:32:59] LowTemplar: bronson: such as link_to, It takes my current controller then appends the path I want
[23:33:02] jfelchner: has joined #RubyOnRails
[23:33:20] Radar: LowTemplar: depends on how you're using it
[23:33:38] bronson: LowTemplar: ha, I guessed (mostly) correct!
[23:33:44] one_zero: has joined #RubyOnRails
[23:33:45] DoctorMonocular: has joined #RubyOnRails
[23:34:01] LowTemplar: bronson: You did, actually gave me a laugh
[23:34:37] LowTemplar: Radar: I just want to go from one view to another. Doesn't seem like it wants to go easy this time
[23:35:10] makenoise: has joined #RubyOnRails
[23:37:06] DoctorMo_: has joined #RubyOnRails
[23:37:15] smathy: _bogus_, so have other modal blocks and a different data-target in your links.
[23:37:48] _bogus_: but its not convenient to render all the forms I need inside one page just in the case of user decides to open it.
[23:38:58] smathy: kpwarr, it doesn't need a super user for testing either, you just need a user with CREATEDB permission for the existing user OR just create the db manually.
[23:39:08] trosborn: LowTemplar: I might not understand what you want exactly, but as far as I remember you can stick a full URL into link_to and it will override the append
[23:39:12] smathy: _bogus_, how many forms will there be?
[23:41:52] Radar: LowTemplar: !rule0
[23:41:52] helpa: LowTemplar: Show rather than tell. Explaining your problem with code, stacktraces or errors is always preferred to explaining it with just text. Show us what's happening, rather than telling us. Put the code on https://gist.github.com and then give us the HTTP link to the Gist.
[23:41:56] jenrzzz: has joined #RubyOnRails
[23:42:11] Radar: LowTemplar: ^ is the best rule to remember. When something's not behaving, show us it not behaving.
[23:42:32] LowTemplar: Radar: Is that acceptable even if its a single line of code?
[23:42:52] kirillzh: has joined #RubyOnRails
[23:43:19] Radar: LowTemplar: always
[23:44:03] LowTemplar: radar: ok, i'll be sure to use it then
[23:44:28] Radar: LowTemplar: one line of code can be shared in the channel
[23:44:33] Radar: two lines yes also
[23:44:35] Radar: three lines, no
[23:44:35] mary5030: has joined #RubyOnRails
[23:45:24] baweaver: has joined #RubyOnRails
[23:45:53] Spami: has joined #RubyOnRails
[23:51:15] deuxclique: has joined #RubyOnRails
[23:52:16] deuxclique: has joined #RubyOnRails
[23:52:18] atomical: has joined #RubyOnRails
[23:54:55] Devalo: has joined #RubyOnRails
[23:55:42] flip_digits: has joined #RubyOnRails
[23:56:09] flip_digits: Question: how do you test background jobs
[23:56:51] Uber|Dragon: has joined #RubyOnRails
[23:57:02] sleungcy: has joined #RubyOnRails
[23:57:28] mices: has joined #RubyOnRails
[23:57:44] superlou: has joined #RubyOnRails
[23:57:46] mices: how do i set cert path for devise