« Back to channel list

#RubyOnRails - 10 March 2016

« Back 1 day Forward 1 day »
[00:00:04] jesc: has joined #RubyOnRails
[00:00:13] jhass: has joined #RubyOnRails
[00:00:23] uglybandersnatch: has joined #RubyOnRails
[00:00:37] Ericx2x_: has joined #RubyOnRails
[00:00:44] Ericx2x_: sorry I d/cd
[00:00:48] Ericx2x_: lost the chat
[00:01:20] DoctorMonocular: has joined #RubyOnRails
[00:02:44] nfk: that's good, then you won't remember what might happen if yo mess up tacking wires on the battery
[00:02:59] mustmodify__: has joined #RubyOnRails
[00:03:47] Ericx2x_: I look at this link and I simply tell myself "raspberry pi can't have a battery backup unit"
[00:03:48] Ericx2x_: http://www.repairhub.co.uk/content/resources/raspberry-pi-battery-backup
[00:04:01] Ericx2x_: I consider that to be a royal pain in the ass
[00:04:05] Ericx2x_: seting that up
[00:04:16] Ericx2x_: It's not what I would consider fun
[00:04:36] vedu: has joined #RubyOnRails
[00:04:42] nfk: ericx2x_, btw, that's a 9V battery
[00:04:55] nfk: or so it looks like from pic
[00:04:59] nfk: and it is from text
[00:05:11] Ericx2x_: pain in the ass setup nonetheless
[00:05:26] nfk: a modern li-poly battery should have much better voltage match
[00:06:09] nfk: and it's far more complicated than it needs to be, it's both a charger, going by text and a basic UPS
[00:06:25] pwnd_nsfw: has joined #RubyOnRails
[00:06:36] smathy: moses, np.
[00:06:54] Ericx2x_: nfk I think you're missing my point lol I don't want to spend any more time setting up a server than I have to
[00:07:04] Ericx2x_: I would love to buy something ready to go like a laptop
[00:07:31] Ericx2x_: sure a pi is efficient in terms of energy but I don't get kicks out of hardware setup
[00:07:54] smathy: ericx2x_, can you wander back on topic at some point soon please.
[00:07:59] nfk: i really think you're making a logical fallacy there by trying to come up with reason to go with what you already have decided to get
[00:08:08] nfk: and secondly, let me find you something better
[00:08:58] smathy: stevenxl, in the rails console?
[00:09:04] Ericx2x_: nfk: I haven't logically decided to get it yet. I gave pi a consideration but rethinking it I feel the setup and maintenance would be a nightmare
[00:09:11] nfk: https://www.adafruit.com/category/44
[00:09:22] nfk: the only question is, how much faffing it needs
[00:09:31] nfk: it might be as easy as pluggin it in but i'm not sure
[00:09:31] Ericx2x_: smathy: what topic are you referring to?
[00:09:48] nfk: ericx2x_, in what way would it be a maintenance nightmare?
[00:09:54] smathy: ericx2x_, Rails.
[00:11:07] smathy: mustmodify__, the extra _ is a common thing clients do when your other self hasn't timed out and disconnected yet (and so your proper nick is already taken). A ban doesn't disconnect you from the server.
[00:11:14] smathy: mustmodify__, ^
[00:11:20] smathy: Oh, it was the right one :)
[00:12:01] Ericx2x_: plenty of things
[00:12:21] Ericx2x_: battery, research time, setup time etc
[00:12:28] smathy: nfk, you too please, you guys should just /QUERY each other if you want to talk about non-Rails things.
[00:12:38] Ericx2x_: all for roughly what a laptop would do, but anyway I'm going to stop talking about it per smathy request
[00:14:04] moses: how come the js and the css are not loading for any other pages besides my home page
[00:14:11] moses: do i need to control that somewhere?
[00:14:52] Radar: moses: !rule0
[00:14:53] helpa: moses: 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.
[00:15:29] moses: everything is working its just not pretty like the homepage :/
[00:15:40] smathy: arthropododo, there are a few, capy, webrat, watir, Celerity - no idea how popular the others are, capy is definitely the most ubiquitous.
[00:15:40] IFrank00: has joined #RubyOnRails
[00:15:42] moses: its like the css and js wasnt loaded
[00:16:02] Haydos__: has joined #RubyOnRails
[00:16:26] nfk: ericx2x_, look at internet results, either i'm a moron or they are overengineering it
[00:16:34] superlou: has joined #RubyOnRails
[00:16:52] nfk: also it seems that they make an assumption that the lipo cell can't handle itself
[00:16:56] ivanskie_work_: has joined #RubyOnRails
[00:17:04] smathy: C'mon moses, this is not even close to one of those things you have to guess about.
[00:17:17] moses: im super new to this :/
[00:17:23] moses: like 3 hours ago new
[00:17:47] flappynerd: has joined #RubyOnRails
[00:18:08] nfk: https://www.youtube.com/user/bigclivedotcom // am i the only one who sees no content there?
[00:18:24] flappynerd: hi, so I've got a somewhat interesting connundrum... I need to add join records, but I need the lookup to happen on a column that's different than either of the foreign keys
[00:18:38] nfk: ah, it's back
[00:18:49] arthropododo: smathy: thank you very much!
[00:19:01] smathy: arthropododo, you're welcome.
[00:19:02] flappynerd: how can I do that? I've tried a few things, but mainly I'm wondering if/how I can manually get the auto-generated unique ID of the new record in the fields_for object
[00:19:26] flappynerd: e.g. fields_for :posts_tags do |f| ... I know I can reference e.g. f.object
[00:19:35] flappynerd: and for records that already exist, I can reference f.object.id
[00:19:39] smathy: moses, not talking about Rails, do you not know how a web page works?
[00:19:42] flappynerd: but what about new objects?
[00:19:58] flappynerd: I've been googling around to try to find docs on the f.object but I'm not sure where to look
[00:20:01] flappynerd: and so far I haven't found it
[00:20:02] smathy: moses, google: "View Source"
[00:20:39] montyboy: has joined #RubyOnRails
[00:20:47] baweaver: has joined #RubyOnRails
[00:20:52] flappynerd: hi smathy :)
[00:20:54] smathy: flappynerd, new objects don't have ids.
[00:20:56] moses: smathy: ok so i wrote a controller for what the site is initially pointed to and it executes everything and looks great, but i didnt write any type of controller for how the other pages interact
[00:21:09] flappynerd: smathy: well yes, but there's a unique id that goes on the form, it's more of an index rather than an id
[00:21:30] flappynerd: post[post_tags_attributes[1234586990192938][tag_id] for example
[00:21:36] flappynerd: derp, missing ]
[00:21:38] nfk: ericx2x_, https://youtu.be/o8Pj81ACxn4?t=14m52s // that's literally 4 resistors, a capacitor, a diode and two transistors for the entire circuitry
[00:21:47] flappynerd: how can I get the 1234586990192938 number off of f.object manually?
[00:21:48] smathy: flappynerd, no idea what that is.
[00:21:48] nfk: and a lipo battery with it's down internal controller
[00:22:00] jstransky: has joined #RubyOnRails
[00:22:20] flappynerd: smathy: that comes from f.link_to_add
[00:22:41] nfk: and the voltage should be just right
[00:23:00] moses: here is the page source : http://pastebin.com/7bxa7gpn
[00:23:06] nfk: also, you might not need even those transistors, at least not two of them
[00:23:08] flappynerd: like, typically in regular HTML you can specify a form array with <input name="things[]"> but that only works for things that are a flat array, it wouldn't work for <input name="things[][some_attribute">
[00:23:20] nfk: since it's designed to turn on only when power supply is off
[00:23:36] nfk: and you don't need it
[00:23:50] flappynerd: so you'd need to use something like <input name="things[0][some_attribute]"> and <input name="things[1][some_attribute]"> then <input name="things[n][some_attribute]"> etc etc
[00:23:59] moses: here it is using pastie: http://pastie.org/10754356
[00:24:00] nfk: perhaps it might be better to design something from scratch but it would not be terribly complicated
[00:24:00] flappynerd: the f.link_to_add auto generates some kind of index for me
[00:24:29] flappynerd: but I have to do this more or less manually because the attribute I need to use to look up the proper FK doesn't exist on the join model
[00:24:58] smathy: moses, and does that HTML look right to you?
[00:25:10] smathy: flappynerd, !code please
[00:25:10] helpa: flappynerd: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[00:25:31] jstransky: when using button_to, how do I add a class to the button input element?
[00:26:00] DLSteve: has joined #RubyOnRails
[00:26:06] moses: i need help using the controller command in rails
[00:27:16] smathy: moses, well, first tell me what's wrong. Identifying what's wrong will help you work out how to fix it.
[00:27:39] moses: heres what im guessing is wrong
[00:27:49] moses: the page that i set a controller on loads correctly
[00:27:54] moses: all the other pages dont load correctly
[00:28:20] smathy: jstransky, see here: http://devdocs.io/rails/actionview/helpers/urlhelper#method-i-button_to See how both the second and third argument are options?
[00:29:08] blackmesa: has joined #RubyOnRails
[00:29:10] jstransky: smathy: yes
[00:29:11] smathy: moses, no, explain to be what's wrong with the HTML.
[00:29:17] kies: has joined #RubyOnRails
[00:29:22] jstransky: smathy: not really clear on what I can do with those
[00:29:58] smathy: jstransky, and you know how you're used to writing things like: button_to :foo, something: 123, something_else: 456 ?
[00:30:11] evenix: has joined #RubyOnRails
[00:30:16] moses: smathy: no idea, very inexperienced with html if you tell me where to look i can probably figure it out
[00:30:21] evenix: oh man i figured out the issue
[00:30:34] smathy: jstransky, that's just shorthand for: button_to :foo, { something: 123, something_else: 456 }
[00:30:51] evenix: https://github.com/zquestz/omniauth-google-oauth2/issues/229 <-- it was actually coming from Faraday slash Net HTTP
[00:30:55] smathy: jstransky, ruby lets you omit the {}s around a hash when it's the last argument of a method.
[00:31:14] evenix: when :post request are made it doesn't automatically gzip the response
[00:31:23] evenix: i thought that was working for older version of ruby such at 2.2.3
[00:31:29] jstransky: ok, good to know
[00:31:30] evenix: https://github.com/ruby/ruby/blob/ruby_2_2/lib/net/http.rb
[00:31:58] evenix: 'decompresses gzip and deflate responses unless a Range header was sent.' ..i dont think i was using a range header
[00:32:26] jstransky: wait, that doesn’t actually make sense
[00:32:34] marcdel: has joined #RubyOnRails
[00:32:58] jstransky: does that mean basically I can freely omit {} when calling methods?
[00:33:15] moses: so i need a view for every page i make in rails?
[00:33:20] ensyde_: has joined #RubyOnRails
[00:33:21] smathy: jstransky, you already have been, I'm sure.
[00:33:42] jstransky: oh nm, when a HASH is the last arg. got it.
[00:33:43] smathy: jstransky, like when you write: has_many :foos, through: :bars - that's really: has_many :foos, { through: :bars }
[00:34:06] smathy: jstransky, right, so with button_to, you need to pass two hashes, one for options and one for html_options.
[00:34:38] mostlybadfly: has joined #RubyOnRails
[00:34:47] moses: when you use command: rails generate controller x y
[00:34:50] moses: what are x and y
[00:34:54] moses: x is the name of the page
[00:34:57] flappynerd: here's what I've got so far https://gist.github.com/anonymous/d45649b49650f96b10b8
[00:34:59] jstransky: here’s my call as it is.
[00:34:59] jstransky: <%= button_to 'Logout', admin_logout_path, method: :delete %>
[00:35:04] moses: what is y?
[00:35:16] nfk: moses, try rails g controller
[00:35:22] nfk: and read what it prints to the screen
[00:35:32] nfk: and now i'm really out
[00:36:07] jstransky: if the docs define button_to as accepting 3 params, how is what I just pasted working with a path as the second?
[00:36:12] jstransky: is that a hash?
[00:36:17] smathy: jstransky, ok so this is a bit tricky because that second argument can be a hash OR a string. It's the url_for trickery.
[00:37:25] flappynerd: it seems like maybe this is a limitation of rails
[00:37:31] jstransky: well before you tell me, how does one supply two hashes without {}s
[00:37:59] flappynerd: jstransky: if you need to separate/deliniate then you must use {} I'm pretty sure
[00:38:04] smathy: jstransky, well as I said, ruby allows you to omit the braces from a hash if it's the last argument.
[00:38:15] smathy: jstransky, so you tell me how to pass two hashes.
[00:38:25] flappynerd: the "nice" and or "shorthand" where you leave off braces won't work because it wouldn't know where one hash begins and the other ends
[00:38:44] jstransky: so if a function defined hashes as its last two arguments, I’d have supply the first one inside {} and the last without?
[00:38:53] flappynerd: jstransky: correct
[00:38:55] pawnbox: has joined #RubyOnRails
[00:38:58] jstransky: the last one being optional
[00:39:38] jstransky: ooook, not sure why thats a thing but fine.
[00:39:50] jstransky: I appreciate the insight
[00:39:59] flappynerd: jstransky: it's a thing because... it's a thing? lol I dunno what you want
[00:40:08] flappynerd: shorthand doesn't work if you need to delineate two hashes
[00:40:19] flappynerd: jstransky: how is the function supposed to know where one hash begins and the other ends?
[00:40:28] jstransky: anyway, back to adding a class to the button input element
[00:40:30] smathy: jstransky, so read further in the docs and you'll see how to add a class to either the form or the button itself.
[00:40:45] jstransky: ok, let me rtfm
[00:41:30] smathy: jstransky, (I'm assuming you know you can add any HTML attribute to any element created by rails helpers by passing it as key: value in the html_options argument of said helper.
[00:42:10] dalbusch1t: has joined #RubyOnRails
[00:42:23] hnanon: has joined #RubyOnRails
[00:42:45] hnanon: How is a method called within another method?
[00:42:50] jstransky: heh no, I did a whole lynda.com course on rails last year then immediatly got thrown on to a wordpress project so of course I forgot it all :)
[00:43:13] smathy: jstransky, ok, that was the one bit that I *didn't* think I needed to tell you :)
[00:43:18] smathy: Glad I mentioned it.
[00:43:21] jstransky: So now that I’m helping style a rails project I’m kinda just fumbling around in the dark.
[00:43:53] jstransky: I’m a quick study but I need training wheels for a bit still
[00:44:00] ensyde__: has joined #RubyOnRails
[00:44:05] DarkStar: has joined #RubyOnRails
[00:44:41] moses: is it perfectly fine to generage all your pages as controllers?
[00:45:08] moses: so each page is the index of a controller?
[00:45:24] alex88_: has joined #RubyOnRails
[00:45:36] one_zero_i: has joined #RubyOnRails
[00:45:47] flappynerd: moses: I would probably make e.g. a PagesController and make named routes for each page
[00:45:54] smathy: flappynerd, looking at your code I still don't understand what you're trying to do, why you included a random number in the []s, or even why you have a link_to_remove when the object is NOT persisted. So confusing.
[00:46:11] jcugno_: has joined #RubyOnRails
[00:46:12] flappynerd: moses: e.g. PagesController#about_us and PagesController#faq
[00:46:14] k1t_: has joined #RubyOnRails
[00:46:19] dotty_: has joined #RubyOnRails
[00:46:24] flappynerd: smathy: well the link to remove just removes the form from the page
[00:46:28] podman_: has joined #RubyOnRails
[00:46:31] manveru_: has joined #RubyOnRails
[00:46:32] flappynerd: afaik this is all pretty much default rails form helpers
[00:46:48] flappynerd: if you want to manage 1:M or in this case M:M relationships on a form
[00:46:57] flappynerd: smathy: and I didn't make those random numbers, rails does
[00:47:07] smathy: moses, !guides is where I'd recommend you start.
[00:47:07] helpa: moses: http://guides.rubyonrails.org/ - Ruby on Rails guides. Recommended reading.
[00:47:32] moses: so the url goes host/pages/specific_page?
[00:47:33] AntiSpamMeta: has joined #RubyOnRails
[00:47:42] neanderslob__: has joined #RubyOnRails
[00:47:45] uglybandersnatch: has joined #RubyOnRails
[00:47:48] flappynerd: smathy: the code in "orignal.haml" is working as expected
[00:47:54] smathy: flappynerd, Rails did not generate the code with [#{SecureRandom.hex}] in it.
[00:48:03] flappynerd: smathy: right, I did
[00:48:10] hnanon: https://gist.github.com/anonymous/193cece9bc196bd807c1
[00:48:13] smathy: flappynerd, maybe that's something (else) from the nested_form gem or something.
[00:48:15] flappynerd: that's just my attempt to get it working given the new specs I need
[00:48:16] speakingcode: has joined #RubyOnRails
[00:48:18] w0bni: has joined #RubyOnRails
[00:48:25] kumavis_: has joined #RubyOnRails
[00:48:29] jcm_: has joined #RubyOnRails
[00:48:35] flappynerd: and as is not entirely surprising to me, the random hex stays the same on each input
[00:48:37] hnanon: I want to call the first two methods with lines 12 and 13.
[00:48:41] Prira_: has joined #RubyOnRails
[00:48:45] Liothen-: has joined #RubyOnRails
[00:48:50] flappynerd: when I use form helpers, as you can see in original.haml rails generates proper separate indexs for me automatically
[00:48:52] cschneid_: has joined #RubyOnRails
[00:49:11] flappynerd: but I want to do the lookup not based on one of the standard foreign keys in my join table
[00:49:11] vedu_: has joined #RubyOnRails
[00:49:16] Leeky_: has joined #RubyOnRails
[00:49:28] nullwarp: has joined #RubyOnRails
[00:49:31] adre: has joined #RubyOnRails
[00:49:31] samuelkadolph: has joined #RubyOnRails
[00:49:32] DarkBushido: has joined #RubyOnRails
[00:49:37] gremly: has joined #RubyOnRails
[00:49:38] flappynerd: e.g. normally it works fine because manager_id is a field on the join model, but I need to lookup using a different field on the Manager model
[00:49:55] svkurowski: has joined #RubyOnRails
[00:49:56] mcr-credil: has joined #RubyOnRails
[00:50:06] djinni`: has joined #RubyOnRails
[00:50:09] gambl0re: has joined #RubyOnRails
[00:50:10] gambl0re: has joined #RubyOnRails
[00:50:12] Meow-J_: has joined #RubyOnRails
[00:50:31] Jon30: is anyone else having issues with google drive api today? I am using google_drive and google-api-client gems to authenticate and write to google drive's spreadsheet files... everything was working fine for a year and suddenly 40 minutes ago both of my apps are getting: "Unauthorized client or scope in request"
[00:50:34] dmz: has joined #RubyOnRails
[00:50:34] dmz: has joined #RubyOnRails
[00:50:41] superlou: has joined #RubyOnRails
[00:50:53] webdestroya: has joined #RubyOnRails
[00:51:08] flappynerd: smathy: and also, btw, remove works fine whether the join record exists or not, if the record exists it adds a _destroy field and if the record doesn't exist it just removes that row from the page
[00:51:21] braincrash: has joined #RubyOnRails
[00:51:47] flappynerd: maybe Radar knows something about this?
[00:51:49] TheMoonMaster: has joined #RubyOnRails
[00:51:56] Radar: Radar knows a lot.
[00:52:09] Radar: Is this about Ransack?
[00:52:09] flappynerd: if I can get that unique index off of ff or ff.object I think I'll be fine
[00:52:21] flappynerd: just not sure where to find the docs on that particular class
[00:52:37] pwnd_nsfw: has joined #RubyOnRails
[00:53:00] flappynerd: Radar: I am wanting to make a form for a join model but use something other than one of the foreign keys on the join model as the lookup mechanism https://gist.github.com/anonymous/d45649b49650f96b10b8
[00:53:10] Radar: Too hard fo rme right now, sorry.
[00:53:13] flappynerd: that's what works with a normal join model and then what I've got so far
[00:53:47] flappynerd: Radar: ok, any idea where I can find the docs on the "f" and "f.object" respectively of a `form_for @foo |f|` call?
[00:53:51] flappynerd: that's probably all I need
[00:53:56] flappynerd: just haven't been able to find it yet on google
[00:54:01] Radar: ActionView::FormBuilder at a guess.
[00:54:21] flappynerd: k I'll check that, thanks
[00:54:22] p8m: has joined #RubyOnRails
[00:55:03] smathy: flappynerd, I still have no idea what your actual issue here is, that index value is not used at all by Rails.
[00:55:27] flappynerd: smathy: well it's created by rails
[00:55:35] smathy: flappynerd, !xyproblem
[00:55:35] helpa: flappynerd: http://mywiki.wooledge.org/XyProblem
[00:55:36] flappynerd: I don't think rails really cares about it on the backend
[00:55:46] smathy: flappynerd, we already established that it wasn't created by Rails.
[00:55:54] manfrin: has joined #RubyOnRails
[00:55:58] flappynerd: but... it is... it's created by ff.text_field
[00:55:59] smathy: flappynerd, what Rails creates is [0], [1], [2], etc.
[00:56:25] flappynerd: well, it's created by some kind of javascript that rails has when making these kinds of forms
[00:56:36] flappynerd: I guess it's created by whatever rails calls on click of f.link_to_add
[00:56:40] smathy: flappynerd, best not to just contradict me, perhaps, as I said, it's something that nested_form adds.
[00:56:54] smathy: flappynerd, you are using nested_form right?
[00:57:09] flappynerd: yep, I'm using nested_form_for
[00:57:27] smathy: flappynerd, right, so that would make sense then, seeing as you saw these bizarre indices in nested forms.
[00:57:33] flappynerd: ooh I might have found it
[00:57:37] flappynerd: ff.index might be the trick
[00:58:20] smathy: flappynerd, !xy man, you already said you didn't think rails really cares about it on the backend, why are you trying so hard to generate it?
[00:58:20] helpa: flappynerd: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[00:58:33] flappynerd: thanks Radar
[00:59:07] jstransky: smathy: so I kinda guess and this worked <%= button_to 'Logout', admin_logout_path, method: :delete, class: "some-class" %>
[00:59:16] SteenJobs: has joined #RubyOnRails
[00:59:21] smathy: jstransky, perfect :)
[00:59:34] jstransky: but not sure how it knew I was targeting only the button input
[01:01:09] smathy: jstransky, Rails tries to be very DWIM - Do What I Mean.
[01:01:26] someish: has joined #RubyOnRails
[01:01:43] weaksauce: has joined #RubyOnRails
[01:02:41] jottr: has joined #RubyOnRails
[01:02:42] gremly: has joined #RubyOnRails
[01:04:04] shanemcd: has joined #RubyOnRails
[01:04:29] sleungcy: I need help with setting up a delayed method on a single table inherited model. I am getting the error "job cannot be created for non-persisted record"
[01:05:02] sleungcy: I tried calling .persisted(premium_user), and it returns false
[01:05:23] sleungcy: but if I do premium_user.becomes(RegularUser).persisted? it returns true?
[01:06:36] mustmodify: Ah ha! I finally found a situation where you can't use REST.
[01:06:56] mustmodify: and it really is kind of unfortunate.
[01:07:33] mustmodify: using Twilio or Plivo or one of those telephony-services-that-hit-your-web-app.
[01:08:05] mustmodify: At first I thought it could be RESTful but now I see I have to allow a user to press 1 or 2 to make a choice, but also allow 8 for spanish.
[01:08:27] milesmatthias: has joined #RubyOnRails
[01:08:29] mustmodify: So you're hitting a confirmation resource with the option of switching languages instead of creating a confirmation.
[01:10:09] flip_digits: has joined #RubyOnRails
[01:12:05] trosborn: has joined #RubyOnRails
[01:13:23] smathy: has joined #RubyOnRails
[01:14:21] Vlatiska: has joined #RubyOnRails
[01:14:40] Vlatiska: Hello, i have a question about adding boostrap theme inside my project
[01:16:03] Vlatiska: i use gem boostrap-sass, and i have download a theme.css and put it on my app/assets/stylesheets
[01:16:31] Sephyros: has joined #RubyOnRails
[01:16:39] flappynerd: has joined #RubyOnRails
[01:16:57] Cervajz: has joined #RubyOnRails
[01:17:06] Vlatiska: All seem to work execpt my custom.css.scss, do i need to change something in my application.css?
[01:17:13] flappynerd: ok one more, if I've got an array in my params, e.g. params[:post][:post_tags_attributes] can I concat/add to that array?
[01:17:34] statelesscode: has joined #RubyOnRails
[01:17:37] flappynerd: when I try using + as with normal arrays I get an error, google says this is because params is not really a hash but rather a api.rubyonrails.org/classes/ActionController/Parameters.html
[01:19:56] shanemcd_: has joined #RubyOnRails
[01:23:42] AntiSpamMeta: has joined #RubyOnRails
[01:23:54] DoctorMonocular: has joined #RubyOnRails
[01:26:12] DoctorMonocular: has joined #RubyOnRails
[01:26:19] rafaelfranca: has joined #RubyOnRails
[01:27:49] Trynemjoel: has joined #RubyOnRails
[01:29:04] SeanLazer: has joined #RubyOnRails
[01:29:20] hnanon: Do I need .take at the end of line 2 to update the job?
[01:29:23] hnanon: https://gist.github.com/anonymous/ce74b1c16be15340d17d
[01:31:09] blackmesa: has joined #RubyOnRails
[01:31:28] capin: has anyone run into this error when trying to install solidus in an existing rails app, https://gist.github.com/ipatch/d6468817e4662f834a37
[01:32:02] arBmind: has joined #RubyOnRails
[01:32:13] ss_much: has joined #RubyOnRails
[01:32:13] DoctorMonocular: has joined #RubyOnRails
[01:32:24] AntonyBaasan: has joined #RubyOnRails
[01:33:16] DoctorMonocular: has joined #RubyOnRails
[01:35:20] Trynemjoel: has joined #RubyOnRails
[01:39:20] DoctorMo_: has joined #RubyOnRails
[01:40:02] ur5us: has joined #RubyOnRails
[01:42:23] DoctorMonocular: has joined #RubyOnRails
[01:43:26] DoctorMo_: has joined #RubyOnRails
[01:44:15] moeabdol3: has joined #RubyOnRails
[01:44:21] DoctorMonocular: has joined #RubyOnRails
[01:46:24] DoctorMonocular: has joined #RubyOnRails
[01:47:15] chipotle: has joined #RubyOnRails
[01:47:32] DoctorMonocular: has joined #RubyOnRails
[01:48:13] domgetter: has joined #RubyOnRails
[01:48:30] domgetter: Is there a way to pass an index to fields_for?
[01:48:47] Pazician: has joined #RubyOnRails
[01:48:52] DoctorMonocular: has joined #RubyOnRails
[01:50:46] domgetter: I have a form that's adding new entries from a form partial using ajax, but I don't know how to tell fields_for to take an index so that the resulting html has the extra brackets in the name attribute of the tags
[01:51:31] DoctorMonocular: has joined #RubyOnRails
[01:52:33] qejk: has joined #RubyOnRails
[01:54:33] DoctorMonocular: has joined #RubyOnRails
[01:54:53] CanTonic: has joined #RubyOnRails
[01:55:37] capin: nvm, I figured it out
[01:55:43] DoctorMonocular: has joined #RubyOnRails
[01:55:49] quazimodo: has joined #RubyOnRails
[01:56:41] CanTonic: has joined #RubyOnRails
[01:57:16] krzkrzkrz: has joined #RubyOnRails
[01:57:58] shanemcd_: has joined #RubyOnRails
[02:00:46] DoctorMo_: has joined #RubyOnRails
[02:02:36] DoctorMonocular: has joined #RubyOnRails
[02:03:27] DoctorMonocular: has joined #RubyOnRails
[02:07:58] jonee: has joined #RubyOnRails
[02:09:31] sankaber: has joined #RubyOnRails
[02:10:57] hnanon: Why is "job" not updating: https://gist.github.com/anonymous/ce74b1c16be15340d17d
[02:11:24] Radar: Do you mean to be doing find_by instead of where?
[02:12:08] Cervajz: has joined #RubyOnRails
[02:16:16] DoctorMonocular: has joined #RubyOnRails
[02:16:54] hnanon: Radar: I think so.
[02:17:19] hnanon: But will shouldn't where also get the job?
[02:17:31] DoctorMonocular: has joined #RubyOnRails
[02:20:24] DoctorMo_: has joined #RubyOnRails
[02:20:36] Radar: where will return an AR::Relation which is probably not what you want
[02:21:22] DoctorMonocular: has joined #RubyOnRails
[02:21:43] hnanon: Radar: Ok, thanks.
[02:21:56] hnanon: Radar: I've been meaning to ask you about this:
[02:22:55] hnanon: http://jeromedalbert.com/how-dhh-organizes-his-rails-controllers/
[02:23:03] hnanon: Do you have an opinion on that?
[02:23:12] trosborn: has joined #RubyOnRails
[02:23:33] DoctorMonocular: has joined #RubyOnRails
[02:23:33] hnanon: When I read it, it seemed insightful.
[02:23:44] jayp: has joined #RubyOnRails
[02:24:39] sleungcy: has joined #RubyOnRails
[02:25:23] delgiudices: has joined #RubyOnRails
[02:25:38] delgiudi_: has joined #RubyOnRails
[02:25:42] DoctorMonocular: has joined #RubyOnRails
[02:30:39] trosborn: has joined #RubyOnRails
[02:31:13] workmad3: has joined #RubyOnRails
[02:33:45] trosborn: has joined #RubyOnRails
[02:33:47] tsujp: has joined #RubyOnRails
[02:34:10] blackmesa: has joined #RubyOnRails
[02:35:07] smathy: has joined #RubyOnRails
[02:35:17] Alejandro15: has joined #RubyOnRails
[02:35:42] duderonomy: has joined #RubyOnRails
[02:36:02] Alejandro15: has left #RubyOnRails: ()
[02:36:18] DmitryBochkarev: has joined #RubyOnRails
[02:36:45] trosborn: has joined #RubyOnRails
[02:37:52] DoctorMonocular: has joined #RubyOnRails
[02:38:56] DoctorMonocular: has joined #RubyOnRails
[02:40:32] rafaelfranca: has joined #RubyOnRails
[02:40:55] DoctorMonocular: has joined #RubyOnRails
[02:41:51] trosborn: has joined #RubyOnRails
[02:43:00] DoctorMonocular: has joined #RubyOnRails
[02:44:47] Radar: TB;DR: Too busy, didn't read.
[02:45:49] KensoDev: has joined #RubyOnRails
[02:46:18] RegulationD: has joined #RubyOnRails
[02:46:19] shanemcd: has joined #RubyOnRails
[02:46:49] SteenJobs: has joined #RubyOnRails
[02:48:02] DoctorMo_: has joined #RubyOnRails
[02:50:01] DoctorMonocular: has joined #RubyOnRails
[02:53:15] DoctorMonocular: has joined #RubyOnRails
[02:54:57] trosborn: has joined #RubyOnRails
[02:55:03] shanemcd_: has joined #RubyOnRails
[02:55:17] DoctorMonocular: has joined #RubyOnRails
[02:57:10] jottr: has joined #RubyOnRails
[02:57:20] DoctorMonocular: has joined #RubyOnRails
[02:57:50] adre: has joined #RubyOnRails
[02:58:41] mattp_: has joined #RubyOnRails
[02:59:01] arup_r: has joined #RubyOnRails
[02:59:07] DoctorMonocular: has joined #RubyOnRails
[02:59:44] livcd: has joined #RubyOnRails
[03:00:12] DoctorMonocular: has joined #RubyOnRails
[03:01:12] andatche: has joined #RubyOnRails
[03:01:59] dmz: has joined #RubyOnRails
[03:02:00] veloutin: has joined #RubyOnRails
[03:02:06] spion: has joined #RubyOnRails
[03:02:08] njero: has joined #RubyOnRails
[03:02:51] Scient: has joined #RubyOnRails
[03:03:03] sbhatore: has joined #RubyOnRails
[03:03:28] bronson: has joined #RubyOnRails
[03:03:55] delgiudi_: Is there a common way to get the current_path of the controller
[03:04:42] moses: when im attempting to generate a controller its not updating the files in my project
[03:04:45] moses: what do i do?
[03:05:42] delgiudi_: moses what do you mean it's not updating the files in your project?
[03:05:48] DoctorMonocular: has joined #RubyOnRails
[03:05:58] moses: when i generate a controller in the terminal
[03:06:16] moses: it says its creating stuff like all the commands run but when i look in the file system
[03:06:20] moses: theres nothing
[03:06:25] moses: idk what to do
[03:06:30] delgiudices: are you sure you're looking in the right place?
[03:06:44] delgiudices: can you paste the output of rails g controller name
[03:06:46] moses: rails generate controller pagescontroller index
[03:06:50] smathy: delgiudi_, request.fullpath
[03:06:59] moses: app/controllers/pagescontroller_controller.rb
[03:07:00] smathy: Oh, gone.
[03:07:12] delgiudices: smathy thanks
[03:07:18] delgiudices: sorry i had wrong nickname
[03:07:21] smathy: delgiudices, oh, that's you now :) Np.
[03:07:23] DoctorMonocular: has joined #RubyOnRails
[03:07:25] moses: but when i go there
[03:07:26] smathy: (I have NICK changes ignored)
[03:07:26] Scient: has joined #RubyOnRails
[03:07:27] moses: its not there :/
[03:07:42] delgiudices: how did you know i was gone anyway
[03:08:23] smathy: moses, do this in your terminal, then do an ls of that directory, and copy-paste the whole lot into a gist.
[03:08:32] delgiudices: exactly was going to say jsut that
[03:09:04] pawnbox: has joined #RubyOnRails
[03:09:17] DoctorMonocular: has joined #RubyOnRails
[03:09:47] smathy: moses, which part of the request didn't you understand?
[03:09:53] trosborn: has joined #RubyOnRails
[03:10:02] moses: the pronoun that you used
[03:10:09] moses: i didnt associate it with anything
[03:12:23] DmitryBochkarev: has joined #RubyOnRails
[03:12:29] DoctorMo_: has joined #RubyOnRails
[03:12:52] capin: anyone know how i can setup the admin user for the solidus gem in production? i'm deploying using capistrano
[03:15:15] smathy: moses, "an ls" - as in /bin/ls
[03:15:18] smathy: moses, list
[03:15:34] smathy: moses, I assume that's how you were looking in the file system?
[03:16:51] DoctorMonocular: has joined #RubyOnRails
[03:17:08] banister: has joined #RubyOnRails
[03:19:24] arup_r: a fresh morning here...
[03:19:25] kinduff: has joined #RubyOnRails
[03:19:26] DoctorMonocular: has joined #RubyOnRails
[03:19:30] moses: i deleted the project and restarted and it worked
[03:19:40] uglybandersnatch: has joined #RubyOnRails
[03:19:46] moses: i need a controller for every page?
[03:20:06] moses: how do i get the css and js to boot up with every page?
[03:20:33] smathy: No idea what "boot up" means.
[03:20:34] chipotle: has joined #RubyOnRails
[03:21:22] arup_r: moses: how long in Rails ?
[03:21:30] moses: 5 hours ago
[03:21:30] trosborn: has joined #RubyOnRails
[03:21:32] duncannz: has joined #RubyOnRails
[03:21:38] DoctorMonocular: has joined #RubyOnRails
[03:21:44] kinduff: Good morning everybody. I have a question about nested forms and self-associated model. A Category has_many subcategories using master_category_id foreign key. It also belongs_to master_category. How can I make a nested form that allows me to create infinite subcategories in the same form?
[03:21:46] moses: I had to take my dog for a long walk
[03:22:09] kinduff: currently using nested_form_fields gem to do the basic job
[03:23:11] arup_r: moses: then start with a good book, otherwise you will get stuck at every moment.. :)
[03:23:37] moses: why does my homepage look sick but the other pages have 0 styling?
[03:24:11] smathy: moses, last time we talked it was because your HTML was horribly broken.
[03:24:29] moses: ok lets re examine that let me grab some of it
[03:24:40] moses: should i get some of the other pages? or the main page?
[03:25:00] shanemcd: has joined #RubyOnRails
[03:25:33] DoctorMonocular: has joined #RubyOnRails
[03:25:45] arup_r: yeah,, keep asking basic things... like that.
[03:25:58] smathy: moses, you should view the source of the page that doesn't work and tell me what's broken.
[03:26:02] arup_r: smathy: o/ .. what's time there.. ? :)
[03:26:32] moses: http://pastie.org/10754446
[03:28:04] smathy: moses, right, so looking at that, what could possibly be causing the lack of CSS/JS on your page?
[03:28:30] moses: so the href is incorrect
[03:29:02] moses: but my real question and why im currently frustrated is how did the home pages get corrected automatically?
[03:29:08] hahuang61: has joined #RubyOnRails
[03:29:34] smathy: moses, well because you did things the way Rails is designed, how did this one get so horribly broken?
[03:29:53] moses: this one is just from a template i pulled
[03:29:57] smathy: moses, which tutorial or guide are you working through?
[03:30:22] jottr: has joined #RubyOnRails
[03:30:36] DoctorMonocular: has joined #RubyOnRails
[03:31:00] smathy: moses, umm, so I don't understand your plan. Are you just reading through the API?
[03:31:09] Rubie: has joined #RubyOnRails
[03:31:26] moses: trying to implement things i read
[03:31:59] smathy: moses, why don't you head on over to http://guides.rubyonrails.org/getting_started.html and read through it, then read the rest of that guide and/or buy a book like Agile Web Development with Rails or Rails 4 in Action and work through those tutorials.
[03:32:12] delgiudices: has joined #RubyOnRails
[03:32:19] moeabdol3: has joined #RubyOnRails
[03:32:37] moses: I did read all of that
[03:32:42] DoctorMonocular: has joined #RubyOnRails
[03:32:45] moses: it doesnt say how to generate individual pages
[03:33:32] arup_r: moses: Why you are not taking the good advises, what smathy and me gave you,
[03:33:34] smathy: moses, yes it does.
[03:33:37] DoctorMonocular: has joined #RubyOnRails
[03:33:46] moses: the example it uses is that of a blog
[03:33:54] arup_r: You first need to understand the framework, then play with it.
[03:35:10] smathy: moses, look, we love helping people, but it's absurd to come in here without any real grounding in Rails at all. It'd be like trying to learn how to fly a helicopter by stepping into the cockpit, flipping a few switches, and calling a helicopter pilot.
[03:35:33] moses: some people can do that
[03:35:58] smathy: moses, I know, you ain't one of them.
[03:36:00] shanemcd: has joined #RubyOnRails
[03:36:41] sneakerhax: has joined #RubyOnRails
[03:36:47] DoctorMonocular: has joined #RubyOnRails
[03:36:57] moses: so all the pages go in the controller folder ive designated ?
[03:37:10] blackmesa: has joined #RubyOnRails
[03:37:14] moses: because index landed there
[03:37:23] smathy: moses, !guides
[03:37:23] helpa: moses: http://guides.rubyonrails.org/ - Ruby on Rails guides. Recommended reading.
[03:37:32] smathy: That's all you're getting until you go learn some things.
[03:37:58] smathy: I mean you had web page with a full <html> document INSIDE another doc's <body> tag, and you didn't know immediately what was wrong. You're a long way from even understanding the basics of a STATIC web page, let alone a web app framework like Rails.
[03:38:46] moses: meh that part doesnt matter
[03:39:01] bronson: has joined #RubyOnRails
[03:39:45] smathy: That you think it doesn't matter matters even more.
[03:40:42] DoctorMonocular: has joined #RubyOnRails
[03:41:19] moses: the fact that you think theres only one way to learn tells me you are old
[03:41:35] moses: how old are you?
[03:41:59] arup_r: moses: respect people.
[03:42:43] moses: how is that not respectful?
[03:43:00] arup_r: and... all advises for the good sake of yours.. we can read your level of understanding of rails from your question.
[03:43:00] smathy: moses, you misunderstand, I'm not saying anything about the ways there are to learn, I'm explaining what the purpose of this channel is.
[03:43:02] slash_nick: i'd get banned for telling you how it sounded
[03:43:08] Rubie: has joined #RubyOnRails
[03:43:15] Tempesta_: has joined #RubyOnRails
[03:43:15] smathy: moses, it's NOT to hold someone's hand through the most basic level of web technologies.
[03:44:35] smathy: It's not just that arup_r, there are questions moses is asking that ARE ANSWERED in the guide he claims to have read.
[03:44:44] bronson: has joined #RubyOnRails
[03:44:58] moses: point them out
[03:45:12] moses: ill admit i was wrong
[03:45:26] smathy: moses, I'll point out one, it tells you how to create individual pages.
[03:45:59] smathy: I don't care what you admit, I care what you DO, I care whether you demonstrate a willingness to listen and take advice.
[03:46:04] gbgdev: has joined #RubyOnRails
[03:46:15] capin: am i missing something here, http://imgur.com/ryQztUr but I can't seem to figure out how to upload an image using the solidus gem :/
[03:46:27] moeabdol3: has joined #RubyOnRails
[03:47:25] moses: Actually right now what I really do need to know and cant find is how to generate all of the links and scripts at the top of a page using rails
[03:48:00] smathy: capin, not many people here will know about solidus, they have their own slack and channel.
[03:48:04] smathy: capin, https://github.com/solidusio/solidus
[03:48:25] capin: smathy: thanks i just asked there ;)
[03:48:46] smathy: capin, np, I'm sure it's quiet, but patience :)
[03:49:02] Guest34101: has joined #RubyOnRails
[03:49:09] slash_nick: moses: might you be talking about a layout?
[03:49:15] rafaelfranca: has joined #RubyOnRails
[03:49:19] capin: hehe, https://www.youtube.com/watch?v=raTts-iGixU
[03:49:32] smathy: moses, yep, and you don't know because you're trying to skim through a guide which is very dense with information. Anyway, I thought you were going to admit you were wrong.
[03:49:41] Pazician: has joined #RubyOnRails
[03:49:44] moses: im reading the getting started
[03:49:50] moses: and i cant find anything close to what im looking at
[03:49:56] moses: this is worded so terribly
[03:50:22] smathy: moses, yeah, the guides that actually cost money have been edited better.
[03:50:53] moses: whats the best e book to get that actually has a really good linar mapping of what to do?
[03:51:37] capin: ACTION likes rails 4 in action ;)
[03:51:56] Lingo: has joined #RubyOnRails
[03:52:25] smathy: moses, either of the two I already recommended.
[03:52:49] smathy: moses, ...but honestly, the guides explain everything about the issue you're currently struggling with.
[03:53:10] moses: can you point out where? is it when they are generating new blog entries?
[03:54:55] smathy: moses, I have no interest in doing that because I can tell that all that will do is get you to step 2 out of 10,000, and so far you've demonstrated very little willingness to take direction and do the necessary legwork.
[03:56:02] moses: alright alright ill read it again
[03:56:22] smathy: moses, plus it's actually impossible for me to understand how anyone could have read the Getting Started guide and NOT know which other sections of the guide to look in for the problem you're having.
[03:57:12] moses: so are pages referred to as resources in rails?
[03:58:00] smathy: I wasn't.
[03:58:43] krzkrzkrz: has joined #RubyOnRails
[03:58:51] pawnbox: has joined #RubyOnRails
[03:59:55] Rinalds: has joined #RubyOnRails
[03:59:59] trosborn: has joined #RubyOnRails
[04:01:14] moses: ok so pages inherit things via ruby so things are streamlined
[04:01:45] moses: so how do my pages inherit information from a parent class?
[04:03:55] smathy: The only meaning of "page" in our context is the resulting webpage sent to or view in a browser.
[04:05:42] kinduff: Anyone with experience with Cocoon?
[04:05:51] smathy: kinduff, !used
[04:05:51] helpa: kinduff: 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.
[04:06:35] Trynemjoel: has joined #RubyOnRails
[04:07:39] kinduff: I'm trying to use Cocoon to make an infinite nested form, the main model references itself for a has_many, belongs_to associations but the helper link_to_add_association (that is inside the fields view) renders the partial in a loop of dead.
[04:08:06] kinduff: Basically what I'm trying to do is to have a Category model that has infinite subcategories (using the same model) referencing itself
[04:08:30] kinduff: A Category has_many subcategories using master_category_id foreign key. It also belongs_to master_category.
[04:10:16] smathy: kinduff, do you have the self-referential anaf working already?
[04:10:33] kinduff: what's anaf, smathy?
[04:10:39] smathy: accepts_nested_attributes_for
[04:11:26] kinduff: yes: accepts_nested_attributes_for :subcategories
[04:11:54] moses: ok so how does inheritance work in rails?
[04:12:00] kinduff: https://gist.github.com/kinduff/a63d49b302e0558588af
[04:12:19] kinduff: am I doing good by making this this way?
[04:12:34] rew: has joined #RubyOnRails
[04:12:51] smathy: kinduff, yeah, looks right.
[04:13:25] smathy: kinduff, so I suppose the difficulty is in creating the "next level of nesting" when you're adding a new subcategory?
[04:13:39] kinduff: yes, exactly that
[04:13:52] smathy: kinduff, !gist your partial
[04:13:52] helpa: kinduff: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[04:14:01] smathy: I assume this partial has the fields_for block in it?
[04:14:08] moses: ok so controllers are objects
[04:14:15] kinduff: smathy, yes
[04:14:54] moses: or classes
[04:14:55] moses: either one
[04:15:54] rrrepsaj: has joined #RubyOnRails
[04:16:20] braincrash: has joined #RubyOnRails
[04:16:26] smathy: kinduff, and you're using render_options to pass in locals for the current level/context?
[04:16:44] kinduff: smathy, https://gist.github.com/kinduff/7c652a1301f9bdc3eebe
[04:17:12] kinduff: missing the project model and assoc, but not it is not necessary to show that
[04:19:17] kinduff: the main issue here with Cocoon is that the link_to_add_association helper renders the view in an infinite loop
[04:20:07] kdough: has joined #RubyOnRails
[04:21:54] smathy: kinduff, sorry man, I can't see anything obviously wrong. Not sure why it'd be in an infinite loop. I'd recommend stepping through with byebug so you can see what's happening that you're not seeing/expecting.
[04:22:13] kinduff: smathy, thanks for taking a look tho! :)
[04:22:27] smathy: kinduff, you know you can put byebug in a view/partial too right?
[04:22:44] kinduff: nice tip! didn't knew that one
[04:23:17] smathy: kinduff, might be as easy as putting one in your _category_fields and seeing what object it's being called with.
[04:24:28] kinduff: smathy, thank you, gonna try that
[04:26:28] alphaatom: has joined #RubyOnRails
[04:31:27] adre: has joined #RubyOnRails
[04:32:43] SeanLazer: has joined #RubyOnRails
[04:33:54] hahuang65: has joined #RubyOnRails
[04:34:22] pawnbox: has joined #RubyOnRails
[04:36:40] pawnbox: has joined #RubyOnRails
[04:36:48] tjbiddle: has joined #RubyOnRails
[04:36:56] shanemcd: has joined #RubyOnRails
[04:37:14] treaki__: has joined #RubyOnRails
[04:37:52] tjbiddle: Design question: If I have Customers belong to a Company. Would it be better to have Invoices have a reference to both Company and Customer; or just Customer and when I want the Company I do Invoice.where(customer: company.customers) ?
[04:40:15] blackmesa: has joined #RubyOnRails
[04:42:09] tjbiddle_: has joined #RubyOnRails
[04:42:29] mbreedlove: has joined #RubyOnRails
[04:42:50] tjbiddle: Sorry for repeating - Internet cut out:
[04:42:51] tjbiddle: Design question: If I have Customers belong to a Company. Would it be better to have Invoices have a reference to both Company and Customer; or just Customer and when I want the Company I do Invoice.where(customer: company.customers) ?
[04:45:06] moses: why is my layout not working for all of my pages :/
[04:46:29] Rubie: has joined #RubyOnRails
[04:47:13] moeabdol3: has joined #RubyOnRails
[04:47:27] RegulationD: has joined #RubyOnRails
[04:47:50] kinduff: has joined #RubyOnRails
[04:53:54] bronson: has joined #RubyOnRails
[04:54:01] scrooloose: has joined #RubyOnRails
[04:54:43] toydestroyer: has joined #RubyOnRails
[04:55:01] Scient: has joined #RubyOnRails
[04:56:53] superlou: has joined #RubyOnRails
[05:00:20] chagel: has joined #RubyOnRails
[05:01:54] Eswar: has joined #RubyOnRails
[05:04:45] moses: I dont understand rendering
[05:05:03] moses: my index page renders automatically but I dont even understand how that happens
[05:07:03] renegadeandy: has joined #RubyOnRails
[05:07:22] djbkd: has joined #RubyOnRails
[05:08:26] SteenJobs: has joined #RubyOnRails
[05:08:32] renegadeandy: Hey everyone - I have a question about a form in a view. I have a deeply nested form, and in this piece, a day contains many timeslots. The data is persisted fine with the form, but when I show the form again as an edit, the field in the :start_hour is not selected depending on what field was saved on the create. This is becase the options_for_select is hard coded to select option 24. How can I make it select the persisted value, or 24 if it is a
[05:08:33] renegadeandy: new time_slot : https://gist.github.com/renegadeandy/7254e1d9d6462d82a735
[05:09:52] SteenJobs: has joined #RubyOnRails
[05:10:37] roshanavand: has joined #RubyOnRails
[05:15:52] scrooloose: has joined #RubyOnRails
[05:17:04] tsujp: has joined #RubyOnRails
[05:19:03] fedexo: has joined #RubyOnRails
[05:21:05] mines999: has joined #RubyOnRails
[05:23:01] hashtd: has joined #RubyOnRails
[05:26:08] sp1rs: has joined #RubyOnRails
[05:32:02] Eswar: has joined #RubyOnRails
[05:35:33] tsujp: has joined #RubyOnRails
[05:36:08] siaW: has joined #RubyOnRails
[05:37:05] darkxploit: has joined #RubyOnRails
[05:41:55] arup_r: has joined #RubyOnRails
[05:44:26] siaW: has joined #RubyOnRails
[05:44:31] nemohash: has joined #RubyOnRails
[05:45:07] roshanavand: has joined #RubyOnRails
[05:46:13] KensoDev: has joined #RubyOnRails
[05:46:14] quazimodo: has joined #RubyOnRails
[05:46:14] mcr-credil: has joined #RubyOnRails
[05:46:14] manveru_: has joined #RubyOnRails
[05:46:14] podman_: has joined #RubyOnRails
[05:46:14] kies: has joined #RubyOnRails
[05:46:14] atrius_: has joined #RubyOnRails
[05:47:21] baweaver: has joined #RubyOnRails
[05:47:24] blackmesa: has joined #RubyOnRails
[05:48:18] k1t: has joined #RubyOnRails
[05:50:46] Pazician: has joined #RubyOnRails
[05:51:47] shanemcd: has joined #RubyOnRails
[06:00:12] prgmmr: has joined #RubyOnRails
[06:01:57] Eswar: has joined #RubyOnRails
[06:02:14] oliver___: has joined #RubyOnRails
[06:06:17] DonOtreply: has joined #RubyOnRails
[06:06:38] sp1rs: has joined #RubyOnRails
[06:07:48] tdlm: has joined #RubyOnRails
[06:08:42] quazimodo: has joined #RubyOnRails
[06:08:42] mcr-credil: has joined #RubyOnRails
[06:08:42] manveru_: has joined #RubyOnRails
[06:08:42] podman_: has joined #RubyOnRails
[06:08:42] kies: has joined #RubyOnRails
[06:08:42] atrius_: has joined #RubyOnRails
[06:09:41] sbhatore1: has joined #RubyOnRails
[06:10:48] chagel: has joined #RubyOnRails
[06:14:41] Brando753: has joined #RubyOnRails
[06:14:44] arup_r: Why my helper method is not available in the view? https://gist.github.com/aruprakshit/dca9340ad290e4200f4e
[06:16:38] k1t: has joined #RubyOnRails
[06:18:31] ur5us: has joined #RubyOnRails
[06:20:49] chagel: has joined #RubyOnRails
[06:21:12] k1t: has joined #RubyOnRails
[06:22:47] Mia: has joined #RubyOnRails
[06:23:22] arup_r: nvm, restarting server fixed it.
[06:23:30] ebbflowgo: has joined #RubyOnRails
[06:24:21] sandstrom: has joined #RubyOnRails
[06:25:20] westoque: has joined #RubyOnRails
[06:26:36] arup_r: yeah, may be somehow it was not able to load the helper. but it shouldn't happen. In this app, we have 2 engines, and those are sometime causing some random errors, and many of those errors are getting fixed by restarting server. I'll check later what is wrong.
[06:27:06] Devalo: has joined #RubyOnRails
[06:29:05] chagel: has joined #RubyOnRails
[06:32:17] jas02: has joined #RubyOnRails
[06:32:35] trosborn: has joined #RubyOnRails
[06:33:14] SeanLazer: has joined #RubyOnRails
[06:33:44] krzkrzkrz: has joined #RubyOnRails
[06:34:57] hahuang65: has joined #RubyOnRails
[06:35:18] moeabdol3: has joined #RubyOnRails
[06:38:24] suffice: has joined #RubyOnRails
[06:38:39] sbhatore: has joined #RubyOnRails
[06:39:43] rvanlieshout: has joined #RubyOnRails
[06:40:59] Guest34101: has joined #RubyOnRails
[06:42:25] chagel: has joined #RubyOnRails
[06:45:57] tdlm: has joined #RubyOnRails
[06:47:26] chagel: has joined #RubyOnRails
[06:47:48] tdlm: Guys, what am I doing wrong here? http://pastebin.com/SaEeUL81
[06:47:49] DoubleMalt: has joined #RubyOnRails
[06:48:13] RegulationD: has joined #RubyOnRails
[06:48:34] tvw: has joined #RubyOnRails
[06:49:04] jenrzzz: has joined #RubyOnRails
[06:49:14] urkle-: has joined #RubyOnRails
[06:50:15] blackmesa: has joined #RubyOnRails
[06:50:42] arup_r: has joined #RubyOnRails
[06:51:41] tdlm: Sorry, here we go: https://gist.github.com/tdlm/607c4bb449b6783899f1 -- any idea why I'm getting the error "ActiveRecord::StatementInvalid: SQLite3::SQLException: no such column: themes.prompt_id: SELECT "themes".* FROM "themes" WHERE "themes"."prompt_id" = ? LIMIT 1" when trying to get something like @prompt.theme.title after setting the foreign key (@prompt.theme_id) to the foreign key of the newly-created @theme ?
[06:53:11] rootx: has joined #RubyOnRails
[06:53:26] arup_r: tdlm: https://gist.github.com/tdlm/607c4bb449b6783899f1#file-20160228230308_create_prompts-rb-L5 is wrong
[06:53:49] arup_r: t.integer :theme_id should be t.integer :prompt_id
[06:54:08] arup_r: rule of thumb, belongs_to model always holds Foreign key
[06:54:09] tdlm: On the Prompt table?
[06:54:22] ur5us: has joined #RubyOnRails
[06:54:24] krzkrzkrz: has joined #RubyOnRails
[06:54:35] arup_r: yes in the Prompt table
[06:54:50] tdlm: Hmm.. maybe I'm setting it up wrong then. Because a theme is essentially a taxonomy table that Prompts can point to. A prompt (writing prompt) can have one theme.
[06:55:00] arup_r: sorry in Theme table
[06:55:02] tdlm: But Prompts can share themes.
[06:55:42] tdlm: And each Theme can have many Prompts
[06:56:18] arup_r: tdlm: think about your model design, I don't know the business usecase. Just remember, model contains belongs_to line, will have foreign key
[06:56:43] arup_r: tdlm: why then you have has_one, you then need has_many
[06:57:13] arup_r: but, whatever associations you set up, rule of thumb is true for all cases as I said
[06:57:14] aganov: has joined #RubyOnRails
[06:58:23] agoldboi: has joined #RubyOnRails
[06:58:49] ur5us: has joined #RubyOnRails
[07:00:36] Chagel_: has joined #RubyOnRails
[07:03:51] ayoros: has joined #RubyOnRails
[07:04:10] lxsameer: has joined #RubyOnRails
[07:04:16] tdlm: @arup_r: https://dl.dropboxusercontent.com/s/8jj6sw2qdj0g18p/2016-03-09%20at%2011.04%20PM.png?dl=0
[07:04:20] tdlm: I'm trying to recreate this
[07:04:34] pwnd_nsfw: has joined #RubyOnRails
[07:04:51] arup_r: updating your gist :D
[07:04:59] tdlm: @arup_r: Thank you so much
[07:07:53] arup_r: tdlm: check now..
[07:08:31] arup_r: so you don't need to change migration, just change the model code as I wrote.
[07:08:43] arup_r: migration is ok as per the relationship you said
[07:12:31] quazimodo: has joined #RubyOnRails
[07:12:49] tdlm: @arup_r: ok, cool
[07:13:48] tdlm: That pesky :belongs_to
[07:14:07] Radar: !associations
[07:14:07] helpa: http://guides.rubyonrails.org/association_basics.html - Active Record Association Basics by Mike Gunderloy
[07:14:47] tdlm: IT WORKED
[07:15:30] tdlm: @arup_r: what bugs me is not understanding how to properly set up an index
[07:15:46] tdlm: I mean, don't get me wrong -- I can do it manually
[07:15:51] tdlm: I just want to do things the Rails way
[07:16:09] arup_r: but I see the index is in the migration
[07:16:09] Liothen-: has left #RubyOnRails: ()
[07:16:35] tdlm: Right, but added manually
[07:16:35] arup_r: tdlm: shortcut t.integer theme_id, index: true also works
[07:16:42] tdlm: So they are equal!
[07:16:45] tdlm: Ok, I didn't know that.
[07:16:48] tdlm: That is really helpful
[07:17:03] arup_r: tdlm: can you see my pm? :D
[07:19:10] arup_r: tdlm: there in one more one liner.. say you want to add a column to a table using index, rails g migration AddColumnNameToTable field:type:index also works.. :D
[07:19:52] arup_r: last tip: in your terminal write like rails g migration <HIT ENTER> see all cool tricks.
[07:21:03] Liothen: has joined #RubyOnRails
[07:22:51] jstransky: has joined #RubyOnRails
[07:23:11] DonOtreply: has joined #RubyOnRails
[07:23:55] arup_r: ember cli copied all rails cool trick.. hehe
[07:25:36] Palsson: has joined #RubyOnRails
[07:26:54] sandstrom: has joined #RubyOnRails
[07:27:38] Pazician: has joined #RubyOnRails
[07:34:36] tetraktys: has joined #RubyOnRails
[07:36:07] comrad: has joined #RubyOnRails
[07:36:37] bronson: has joined #RubyOnRails
[07:36:56] phredus: has joined #RubyOnRails
[07:36:57] darutoko: has joined #RubyOnRails
[07:38:17] manveru_: has left #RubyOnRails: ()
[07:38:36] quazimodo: is there a clever way to take a variable that's either a hash or nil, and merge another hash or set to this other hash in case it's nil ?
[07:39:38] quazimodo: if opts[:class].present? then opts[:class].merge other_opts else opts[:class] = other_opts
[07:40:00] quazimodo: probably not huh
[07:40:41] norc: has joined #RubyOnRails
[07:41:51] norc: Hi. I have a model LinkCable that belongs_to Facility, the column being named facility_a_id - now I want to localize this relationship with i18n but I do not know how.
[07:42:06] uglybandersnatch: has joined #RubyOnRails
[07:42:34] norc: I could simply add a translation for de.activerecord.attributes.link_cable.facility_a_id - but that seems unclean.
[07:42:35] havenwood: quazimodo: opts.fetch(:class, {}).merge other_opts
[07:42:46] weaksauce: quazimodo ternary operator perhaps?
[07:44:53] yardenbar: has joined #RubyOnRails
[07:45:39] norc: Ah nevermind, I could simply use de.activerecord.attributes.link_cable.facility_a and then refer to it with LinkCable.human_attribute_name(:facility_a) :)
[07:45:57] tjbiddle_: has joined #RubyOnRails
[07:46:35] lxsameer: hi, is `ActiveRecord::Migration[5.0]` backward compatible ?
[07:47:11] arup_r: has joined #RubyOnRails
[07:47:42] norc_: has joined #RubyOnRails
[07:48:51] futilegames: has joined #RubyOnRails
[07:49:22] Guest34101: has joined #RubyOnRails
[07:51:18] configged-: has joined #RubyOnRails
[07:51:18] configged: has joined #RubyOnRails
[07:53:12] ziyadb: has joined #RubyOnRails
[07:53:16] blackmesa: has joined #RubyOnRails
[07:55:09] chipotle: has joined #RubyOnRails
[07:56:20] scope: has joined #RubyOnRails
[08:01:24] ebbflowgo: has joined #RubyOnRails
[08:02:17] wethu: has joined #RubyOnRails
[08:02:31] agoldboi: has left #RubyOnRails: ()
[08:04:47] merida: has joined #RubyOnRails
[08:05:20] urkle: has joined #RubyOnRails
[08:06:21] sandstrom: has joined #RubyOnRails
[08:10:33] merida_: has joined #RubyOnRails
[08:11:01] ayoros: has joined #RubyOnRails
[08:11:51] ebbflowgo: has joined #RubyOnRails
[08:14:32] Pulp: has joined #RubyOnRails
[08:14:47] tenderlove: has joined #RubyOnRails
[08:18:17] alaing: has joined #RubyOnRails
[08:18:38] alaing: has joined #RubyOnRails
[08:19:33] quazimodo: has joined #RubyOnRails
[08:23:07] nocontrol: has joined #RubyOnRails
[08:23:25] moeabdol3: has joined #RubyOnRails
[08:23:30] n008f4g_: has joined #RubyOnRails
[08:23:56] nocontrol: can Ruby on Rails assets be managed by npm ? I have been using bower for a long time and I am thinking about trying something else
[08:24:53] neanderslob_: has joined #RubyOnRails
[08:27:32] adac: has joined #RubyOnRails
[08:33:18] Spami: has joined #RubyOnRails
[08:35:12] AntiSpamMeta: has joined #RubyOnRails
[08:35:31] htmldrum: has joined #RubyOnRails
[08:36:04] siaW: has joined #RubyOnRails
[08:36:12] CanTonic: has joined #RubyOnRails
[08:37:50] brandthdl: has joined #RubyOnRails
[08:39:25] sjnorth_: has joined #RubyOnRails
[08:39:28] Obi_obi: has joined #RubyOnRails
[08:39:39] ELCALOR: has joined #RubyOnRails
[08:39:45] lbotos_: has joined #RubyOnRails
[08:39:49] golgaroth: has joined #RubyOnRails
[08:40:05] c355E3B: has joined #RubyOnRails
[08:40:16] czetter: has joined #RubyOnRails
[08:40:24] BBHoss: has joined #RubyOnRails
[08:40:38] jxf: has joined #RubyOnRails
[08:40:39] alevy: has joined #RubyOnRails
[08:40:41] atian: has joined #RubyOnRails
[08:40:43] tjohnson: has joined #RubyOnRails
[08:41:12] mostlybadfly: has joined #RubyOnRails
[08:41:16] tejasmanohar: has joined #RubyOnRails
[08:41:31] pfg: has joined #RubyOnRails
[08:41:41] swift_: has joined #RubyOnRails
[08:41:42] CornishPasty: has joined #RubyOnRails
[08:41:42] RubyNewbey_____: has joined #RubyOnRails
[08:41:49] jord: has joined #RubyOnRails
[08:41:57] nyandoge: has joined #RubyOnRails
[08:42:09] swgillespie: has joined #RubyOnRails
[08:42:22] alethea: has joined #RubyOnRails
[08:42:24] jcp: has joined #RubyOnRails
[08:42:34] sjnorth: has joined #RubyOnRails
[08:42:42] jhill: has joined #RubyOnRails
[08:43:05] arup_r: has joined #RubyOnRails
[08:43:11] chancancode___: has joined #RubyOnRails
[08:43:14] ewilliam: has joined #RubyOnRails
[08:43:30] rrawlins: has joined #RubyOnRails
[08:44:06] mark2: has joined #RubyOnRails
[08:44:26] magically: has joined #RubyOnRails
[08:44:31] upgrayeddd: has joined #RubyOnRails
[08:44:31] sdn90: has joined #RubyOnRails
[08:44:36] Lloyd: has joined #RubyOnRails
[08:45:41] Meow-J: has joined #RubyOnRails
[08:45:57] ebryn: has joined #RubyOnRails
[08:48:19] sp1rs: has joined #RubyOnRails
[08:48:47] Guest4184______: has joined #RubyOnRails
[08:49:01] RegulationD: has joined #RubyOnRails
[08:49:33] Axy: has joined #RubyOnRails
[08:50:26] Hates_: has joined #RubyOnRails
[08:51:13] adre: has joined #RubyOnRails
[08:51:57] quazimodo: has joined #RubyOnRails
[08:52:35] chagel: has joined #RubyOnRails
[08:53:42] Arcaire: has joined #RubyOnRails
[08:55:01] shwoodard: has joined #RubyOnRails
[08:55:29] pawnbox: has joined #RubyOnRails
[08:55:43] alexhartley: has joined #RubyOnRails
[08:57:36] chagel: has joined #RubyOnRails
[08:57:44] iamdevnul: has joined #RubyOnRails
[08:59:12] johnflux: has joined #RubyOnRails
[08:59:28] alaing: hi whats the best way to discard the first value in an array
[09:00:12] yxejamir: has joined #RubyOnRails
[09:00:15] alaing: @My_array.shift
[09:01:07] alaing: and then if i referenced @My_array after that it would have all the values except the first one?
[09:01:17] alaing: sorry I'm still learning ruby
[09:01:23] machty_: has joined #RubyOnRails
[09:02:26] apeiros: alaing: I suggest you fire up a rails console and simply try that stuff
[09:02:55] alaing: ok thank you very much. :-)
[09:02:56] apeiros: or for plain ruby things, you can also use just pry or irb
[09:03:14] merida: has joined #RubyOnRails
[09:05:24] blackmesa: has joined #RubyOnRails
[09:05:52] jsrn: has joined #RubyOnRails
[09:06:34] drptbl: has joined #RubyOnRails
[09:06:39] defsdoor: has joined #RubyOnRails
[09:07:03] arup_r: fastest answer in this world..
[09:08:40] finnnnnnnnnnn: has joined #RubyOnRails
[09:09:23] Ergo: has joined #RubyOnRails
[09:10:42] srinidhi: has joined #RubyOnRails
[09:11:11] alaing: I've got a cucumber test that only passes when I add a sleep to it. I'm sure there must be a better way instead of using sleep
[09:11:13] alaing: https://gist.github.com/aliuk2012/865da64e96130cad2373
[09:11:56] alaing: basically it testing a select list and uses javascript to change the select list value and based on the value it shows/hides content on the page
[09:12:08] arup_r: try find(:css, "##{id}", :visible => false, wait: 0.5)
[09:12:29] Dbugger: has joined #RubyOnRails
[09:12:32] Dbugger: Hello everony
[09:12:49] arup_r: I know capybara method accepts wait: key like sleep, but forgot where I used it.. so try it alaing
[09:13:06] alaing: arup_r: ok, let me try that
[09:13:14] arup_r: dbugger: <%= debug %> :D
[09:13:18] superrorc: has joined #RubyOnRails
[09:13:33] Dbugger: I have a question. If I have 2 scopes, how can I query them together? For instance, if I have "Shoes.big" and "Shoes.medium", how could I make something like "Shoes.big.and.medium" ?
[09:13:43] Dbugger: arup_r, gotcha ;)
[09:13:54] superrorc: hi there! does rails have got some interface for mobile aps?
[09:14:11] arup_r: shoes.big.medium should do. no dbugger ?
[09:14:23] arup_r: because we can chain scopes..
[09:14:24] alaing: arup_r: i'm not sure thats the best way (if it works) because its basically looking at 6/7 elements on the page which it would wait 0.5
[09:14:56] Dbugger: arup_r, I expressed myself poorly. I do not mean to get the shoes that are BIG and MEDIUM at the same time. I mean "either one or the other"
[09:14:57] alaing: arup_r: when i say it flickers its only the first 1 or two elements that fail the rest pass
[09:15:08] Dbugger: arup_r, more like "Shoes.big.or.medium"
[09:16:31] apotry: has joined #RubyOnRails
[09:18:40] arup_r: ok,... alaing, capybara has some methods, which does it. read https://github.com/jnicklas/capybara#asynchronous-javascript-ajax-and-friends
[09:18:57] lxsameer: has joined #RubyOnRails
[09:19:03] arup_r: dbugger: what id the condition based on you will switch ?
[09:19:12] arup_r: that is needed to know to help you
[09:20:13] roshanavand: has joined #RubyOnRails
[09:20:26] arup_r: https://github.com/jnicklas/capybara#finding .. so .find also waits ( look NOTE ) .. so if it fails, just raise the capybara default timeout.. as shown in the earlier link alaing
[09:20:40] arup_r: what is**
[09:23:05] alaing: arup_r: the element is always on the page. no ajax is used. its just a case of javascript showing/hiding the elements based on the select list value
[09:23:15] tetraktys: has joined #RubyOnRails
[09:23:28] Dbugger: arup_r, you mean what the scope does?
[09:24:36] Dbugger: arup_r, I did not get your last sentence..
[09:25:02] arup_r: dbugger: show the code you have, you need tweak.. there is no scope1.or.scope2 .. Or, you can make scope3, where you will add conditions beforehand, and call scope3 always.
[09:25:46] Dbugger: Well this is "scope :big , -> { where size: "big" }", and "scope :medium , -> { where size: "medium" }". You can imagine how the scope "small" looks like :)
[09:26:24] Dbugger: I know I could make a new scope "big_and_medium", but I was wondering if there is a more syntantically pretty way, so that I do not need to build a scope for every combination...
[09:26:56] arup_r: if it is `AND` , you could use `.merge`. I don't OR is possible.
[09:26:58] matthias_: has joined #RubyOnRails
[09:27:03] arup_r: don't think.
[09:27:10] arup_r: but not 100% sure
[09:27:20] Dbugger: well, as you said, for "and", I could simply make "Shoe.big.medium"
[09:27:42] Dbugger: But apparently for "or" there is no way...
[09:27:49] jjturner: has joined #RubyOnRails
[09:28:24] arup_r: dbugger: spot on: http://stackoverflow.com/questions/3684311/rails-how-to-chain-scope-queries-with-or-instead-of-and :D
[09:28:24] enkristoffer: has joined #RubyOnRails
[09:29:39] arup_r: dbugger: rails 5 going to have `.or` then, I think you will be able http://stackoverflow.com/a/18192388/2767755
[09:29:41] blackmesa: has joined #RubyOnRails
[09:30:06] baweaver: has joined #RubyOnRails
[09:30:40] arup_r: superrorc: you meant writing APIs in rails?
[09:31:01] Dbugger: arup_r, so if I was using R5, I could, but with R4 I am stuck with building a new scope... shame
[09:31:21] arup_r: yeah.. sorry for the trouble ;)
[09:32:20] Dbugger: arup_r, no trouble! I thank you for the help, please
[09:37:09] SanguineAnomaly: has joined #RubyOnRails
[09:38:56] roshanavand: has joined #RubyOnRails
[09:39:55] lxsameer: hi, is `ActiveRecord::Migration[5.0]` backward compatible ?
[09:40:33] chagel: has joined #RubyOnRails
[09:41:01] snowy: has joined #RubyOnRails
[09:41:04] finnnnnnnnnnn: has joined #RubyOnRails
[09:42:47] pawnbox: has joined #RubyOnRails
[09:43:09] tenderlove: has joined #RubyOnRails
[09:43:22] marr: has joined #RubyOnRails
[09:44:35] norc_: has joined #RubyOnRails
[09:44:35] norc_: has joined #RubyOnRails
[09:44:41] norc_: Is there a way to specify an input field inside a form that does not get transmitted?
[09:45:03] apeiros: don't give it a name, or mark it as disabled
[09:45:13] mrbubbles: has joined #RubyOnRails
[09:45:28] Rubie: has joined #RubyOnRails
[09:45:45] neanderslob: has joined #RubyOnRails
[09:45:55] norc_: apeiros: Is that behaviour well defined in all modern browsers?
[09:46:11] Olipro_: has joined #RubyOnRails
[09:46:34] apeiros: iirc disabled is mandated by the standard to not be transmitted. no idea about the nameless input.
[09:46:58] lxsameer: i don't have rspec in my Gemfile.lock but still when i want to generate an scaffold i get a GemConflict exception saying that can't activate rspec-rails
[09:47:39] apeiros: lxsameer: probably because it's not in the Gemfile.lock, yet something wants to activate it
[09:47:52] apeiros: i.e. something failed to specify its dependencies properly
[09:48:09] drptbl: has joined #RubyOnRails
[09:48:10] lxsameer: apeiros, hmm thanks for the hint man
[09:48:21] norc_: apeiros: https://www.w3.org/TR/html401/interact/forms.html#successful-controls
[09:48:33] norc_: It looks like I can reasonably expect browsers to respect this.
[09:48:33] shanemcd: has joined #RubyOnRails
[09:48:57] norc_: "If a control doesn't have a current value when the form is submitted, user agents are not required to treat it as a successful control."
[09:48:59] apeiros: norc_: sounds like both should work
[09:50:20] mfaeh: has joined #RubyOnRails
[09:51:23] apeiros: o/ machty_
[09:51:40] apeiros: premature tab complete 0:-)
[09:52:29] Dbugger: Does anyone use the package "ERB Snippets" in Sublime Textß
[09:52:44] chipotle: has joined #RubyOnRails
[09:53:24] uglybandersnatch: has joined #RubyOnRails
[09:53:59] bob_f: Is there a less permissive version of .safe_constantize ?
[09:54:20] bob_f: I'm finding that it's masking other NameErrors not directly related to the constant lookup.
[09:55:39] roshanavand: has joined #RubyOnRails
[09:55:52] bob_f: I might just have to allow the exception to happen. Can't think of a way around it.
[09:56:08] arBmind: has joined #RubyOnRails
[09:57:02] wldcordeiro: has joined #RubyOnRails
[09:58:10] Guest34101: has joined #RubyOnRails
[10:00:13] chagel: has joined #RubyOnRails
[10:01:01] Surt_Q: has joined #RubyOnRails
[10:02:51] ferr: has joined #RubyOnRails
[10:03:10] nerium: has joined #RubyOnRails
[10:05:14] chagel: has joined #RubyOnRails
[10:07:29] norc_: bob_f: Just look at the implementation. You can cherry pick the behaviour from there.
[10:09:09] mdw: has joined #RubyOnRails
[10:09:35] bob_f: norc_: Ah, I just assumed it had a catch-all for NameError - seems it's actually a bit clunky underneath, but should be able to make a version that suits me.
[10:10:42] FooMunki: has joined #RubyOnRails
[10:11:28] moeabdol3: has joined #RubyOnRails
[10:14:30] chagel: has joined #RubyOnRails
[10:14:52] morfin: has joined #RubyOnRails
[10:15:15] drptbl: has joined #RubyOnRails
[10:15:25] morfin: anybody knows can i have multiple levels menu in ActiveAdmin
[10:15:40] morfin: or i somehow should customize that myself?
[10:16:43] Sylario: has joined #RubyOnRails
[10:16:49] Diabolik: has anyone here used ActiveAdmin to set SEO information?
[10:20:21] CanTonic: has joined #RubyOnRails
[10:21:01] dgncn: has joined #RubyOnRails
[10:26:06] arup_r: has joined #RubyOnRails
[10:27:05] CanTonic: has joined #RubyOnRails
[10:27:08] arup_r: bob_f: http://api.rubyonrails.org/classes/String.html#method-i-constantize throws error
[10:29:04] gbgdev: has joined #RubyOnRails
[10:29:12] CanTonic: has joined #RubyOnRails
[10:29:46] gbgdev: has joined #RubyOnRails
[10:30:20] gbgdev: has joined #RubyOnRails
[10:31:55] AlexJakeGreen: has joined #RubyOnRails
[10:33:59] DEA7TH: has joined #RubyOnRails
[10:35:08] chagel: has joined #RubyOnRails
[10:36:00] blackmes1: has joined #RubyOnRails
[10:37:35] sandstrom: has joined #RubyOnRails
[10:38:44] ql6wlld: has joined #RubyOnRails
[10:38:49] chipotle: has joined #RubyOnRails
[10:39:13] CanTonic: has joined #RubyOnRails
[10:39:22] morfin: oh well, i found this solution: http://stackoverflow.com/questions/15400036/is-there-anyway-to-add-another-levels-of-menus-with-active-admin?answertab=active#tab-top
[10:41:34] chagel: has joined #RubyOnRails
[10:41:42] Olipro_: has joined #RubyOnRails
[10:42:47] moeabdol3: has joined #RubyOnRails
[10:45:02] sp1rs: has joined #RubyOnRails
[10:49:12] Fernando-Basso: has joined #RubyOnRails
[10:50:24] workmad3: has joined #RubyOnRails
[10:52:35] Eswar: has joined #RubyOnRails
[10:54:05] chagel: has joined #RubyOnRails
[10:56:52] srinidhi: has joined #RubyOnRails
[10:59:13] chagel: has joined #RubyOnRails
[11:01:36] ruler_: has joined #RubyOnRails
[11:02:07] moeabdol3: has joined #RubyOnRails
[11:02:42] arup_r: has joined #RubyOnRails
[11:02:55] ruler_: has joined #RubyOnRails
[11:03:37] tsujp: has joined #RubyOnRails
[11:04:06] lxsameer: has joined #RubyOnRails
[11:04:10] ruler_: has joined #RubyOnRails
[11:04:16] chagel: has joined #RubyOnRails
[11:05:14] deur-: has anyone here tried https://www.railsspeed.com/ yet? is it worth it?
[11:06:03] deur-: it's a very steep price for "just a book"
[11:06:27] merida_: has joined #RubyOnRails
[11:08:50] adaedra: 99$ for a 350p book? Looks not so bad
[11:11:10] adaedra: Mh, my referential was flawed
[11:12:18] trinaldi: has joined #RubyOnRails
[11:12:42] workmad3: has joined #RubyOnRails
[11:12:45] defsdoor: deur-, you got speed issues ?
[11:13:44] n008f4g_: has joined #RubyOnRails
[11:13:52] adaedra: uhuh, now I remember why I don't buy books in my country: "This book talks about the last Ruby version (1.6)"
[11:14:29] deur-: defsdoor: 1 app in particular, yes. a legacy app that will need a crapload of refactoring
[11:14:29] bronson: has joined #RubyOnRails
[11:15:04] defsdoor: you done all the usual stuff - n+1 query checks etc.. ?
[11:17:51] chagel: has joined #RubyOnRails
[11:18:24] deur-: defsdoor: we just started, really. so far we've only been caching some hotspots in the views, rewriting a few manageable queries. most slow stuff seems to come from classes throughout the system building objects in iterators, which makes thing rough to refactor
[11:19:11] defsdoor: deur-, 10% of the effort can solve 90% of performance issues
[11:19:17] deur-: there are tests, but not everywhere
[11:19:28] tjbiddle: has joined #RubyOnRails
[11:19:39] EdwardIII: i would like to have enums, but mapping to strings not keys so if anyone every drops into the db stuff is more human-friendly
[11:19:49] defsdoor: the final 10% is hard and probably best solved at a different level (hardware)
[11:19:50] EdwardIII: so they're not enums
[11:20:12] EdwardIII: so ActiveRecord::Enum doens't make sense i guess. i should probably just have a constant that contains a hash?
[11:20:15] defsdoor: EdwardIII, mysql support enums natively
[11:20:32] deur-: oh yeah, it's definitely a software problem
[11:21:18] blackmes1: has joined #RubyOnRails
[11:21:20] EdwardIII: hrm i'd like to stay away from mysql-specifics at this stage
[11:21:56] gbgdev: has joined #RubyOnRails
[11:21:56] universa1: EdwardIII: have a look at the enumerize gem
[11:22:45] EdwardIII: enumerize supports i18n, that's good heh didn't think of that
[11:23:29] CanTonic: has joined #RubyOnRails
[11:24:11] shanemcd: has joined #RubyOnRails
[11:24:46] EdwardIII: looks perfect, thanks universa1
[11:27:12] defsdoor: does rails' enum validate the enum map is integers ? i.e. can you do enum :status, {active: "A", disabled: "B" } ?
[11:27:21] sp1rs: has joined #RubyOnRails
[11:27:43] defsdoor: if that doesn't work it seems like a nice feature to add - can't see it being much effort
[11:27:56] rodfersou: has joined #RubyOnRails
[11:28:27] arup_r: defsdoor: I think then it will not save..
[11:28:49] arup_r: enum :status, {active: "A", disabled: "B" } is not valid too
[11:28:58] chipotle: has joined #RubyOnRails
[11:29:13] defsdoor: arup_r, shame
[11:29:25] defsdoor: arup_r, seems a useful alternative
[11:29:47] arup_r: either enum :status, [:active, :disabled ] or { active: 0, disabled: 1 } works
[11:29:56] arup_r: column has to be an integer
[11:30:08] defsdoor: dig out where it checks and remove it! ;)
[11:30:34] arup_r: but it is HANDY ;p
[11:30:41] defsdoor: I'd quite like single char values in db for a lot of my enums
[11:32:40] baweaver: has joined #RubyOnRails
[11:34:54] EdwardIII: i like a couple of chars
[11:35:03] EdwardIII: so much easier to debug when things get weird a long way down the track
[11:35:15] EdwardIII: and you can still index them if performance is a concern
[11:35:50] EdwardIII: with the exception of roles that you want to do maths on to calculate stuff chmod-style
[11:38:25] trinaldi: has joined #RubyOnRails
[11:39:33] nocontrol: has joined #RubyOnRails
[11:40:05] lxsameer: has joined #RubyOnRails
[11:40:19] krzkrzkrz: has joined #RubyOnRails
[11:40:24] nocontrol: has joined #RubyOnRails
[11:43:23] ldnunes: has joined #RubyOnRails
[11:43:44] moses: when i set my root page rails loads the layout onto it but all my other pages it doesnt load the layout...what did i do wrong?
[11:46:45] adlerdias: has joined #RubyOnRails
[11:47:42] moses: where do tell ruby to render things?
[11:48:16] krzkrzkrz: has joined #RubyOnRails
[11:49:10] rapha: Why does the FROM not include table "translations" here? https://gist.github.com/sixtyfive/9fa217ea8fffa6f7797f
[11:50:45] voidsta: has joined #RubyOnRails
[11:52:37] Earthnail: has joined #RubyOnRails
[11:53:03] EdwardIII: hrm i just have this one simple form with some radio elements. i need just these 2 to have crazy custom markup
[11:53:27] EdwardIII: should i create a custom template? or should i just use raw, non-simpleform elements or something?
[11:53:53] EdwardIII: i've got this little beauty currently, but the markup is not at all what i need: <%= stay_request_builder.input :payment_method, :as => :radio_buttons %>
[11:54:19] chipotle: has joined #RubyOnRails
[11:54:47] Earthnail: In development mode, if I get an internal server error, I get the nice web console. Which is great when I'm debugging pages in Chrome, but not when I'm tracing the output of a JSON API call via curl. Can I change Rails' behaviour so that I get a JSON error reply when I hit a "example.com/foo.json" endpoint?
[11:57:21] tetraktys: has joined #RubyOnRails
[11:58:39] Guest34101: has joined #RubyOnRails
[11:59:02] blackmes1: has joined #RubyOnRails
[11:59:14] Tempesta: has joined #RubyOnRails
[12:01:19] chridal: Anyone use JWT for authentication in their applications?
[12:01:31] DarkStar: has joined #RubyOnRails
[12:01:55] chridal: It has message authentication listed as one of its features; but would that even be needed when you have message authentication with HMAC in HTTPS?
[12:02:40] workmad3: chridal: yes, you still need the authentication on the JWT itself
[12:02:43] srinidhi: has joined #RubyOnRails
[12:02:47] FeFeTooFresh: has joined #RubyOnRails
[12:03:20] chridal: workmad3: But how would it really differ from just generating a random token, putting it in the DB and then checking it on each subsequent request?
[12:03:27] chridal: That's what we're doing now for API security
[12:03:41] tsujp: has joined #RubyOnRails
[12:03:52] chridal: I can see the usefulness of using crypto-signed data if you don't have HTTPS available
[12:04:02] chridal: but what other things does it solve?
[12:04:20] chridal: Might be something we're overlooking in our security scheme
[12:04:35] workmad3: chridal: you'd be able to verify the signature of the JWT without db access and so know it hasn't been tampered with, and then you could use that to avoid db lookups of things like token expiry, user data, potentially even access roles if they're in the JWT
[12:04:52] chridal: That's VERY interesting.
[12:05:04] chridal: So basically you store the user_id cryptographically in the token?
[12:05:33] chridal: Wow. In that case it is going to save us a ton of requests.
[12:05:40] phredus: has joined #RubyOnRails
[12:05:43] chridal: I'm hitting the user_sessions table for every single request to the backend right now.
[12:05:56] moses: I need help with routing my static pages through my layout
[12:06:17] Agent281: has joined #RubyOnRails
[12:06:56] shanemcd: has joined #RubyOnRails
[12:07:01] workmad3: chridal: essentially, yes... you can choose if you want to go with RSA or HMAC style signatures on your JWT too... we're currently using RSA signatures on our company setup, so we have a single place which has a private key and is able to issue JWTs and then a public key can be used to verify that those were generated by us
[12:07:35] workmad3: chridal: just be careful to ensure that you never allow JWTs with `none` as their algorithm to be accepted by your endpoints though :)
[12:07:45] sandstrom: has joined #RubyOnRails
[12:08:08] tbuehlmann: workmad3, what's your reason for using JWT?
[12:08:08] chridal: workmad3: So if I understand you correctly you have deployed public keys to all your app servers and the private key is on the auth server?
[12:08:23] workmad3: chridal: yup
[12:08:27] chridal: And you retrieve information from the tokens (such as expiry etc.) through the pub key on the app servers?
[12:08:33] chridal: Omg. This is so awesome. I can't wait to deploy this.
[12:08:46] FeFeTooFresh: has joined #RubyOnRails
[12:08:56] Tempesta: has joined #RubyOnRails
[12:09:10] workmad3: tbuehlmann: mostly, we're using it to avoid a bunch of callbacks to our identity provider in some apps
[12:09:42] chridal: tbuehlmann: Since you're asking; what would be the flipside of this coin?
[12:09:57] chridal: s/would/might
[12:10:47] workmad3: chridal: we're currently only using signed JWTs rather than encrypted JWTs (there are specs for both), so the info is visible in the token to anyone who cares to decode it... but otherwise yeah... we validate the token and (once that's passed) we can then extract data directly from it without calling back to the identity provider
[12:11:38] Agent281: has joined #RubyOnRails
[12:11:47] workmad3: chridal: flip side - the tokens are quite a bit larger, more expensive to generate, and you have a bunch of key management issues to take care of as well
[12:11:51] chridal: workmad3: Any reason that you're just signing them? Is this related to the crypto cpu overhead?
[12:12:04] tbuehlmann: workmad3, so you have cross domain apps running and you can auth on them via JWT instead of having to request the identity provider?
[12:12:30] workmad3: tbuehlmann: pretty much... it cuts out a callback to the identity provider once the app server has the JWT
[12:13:06] tbuehlmann: what kind of apps do you have? how do you store the JWT?
[12:14:00] Nandan: has joined #RubyOnRails
[12:14:01] workmad3: tbuehlmann: I'd have to double-check that detail... I've not looked at the codebase of the few apps that are using JWTs so far (most of our apps aren't switched over to reading stuff out JWT yet, so just treat it as a normal oauth access token and callback to the server)
[12:14:47] workmad3: tbuehlmann: but I think they're storing it either in memory or in local storage with a JS-heavy client-side app, and have an express app that's dealing with verifying the JWT and doing stuff with it
[12:14:59] tbuehlmann: okay, I'm just interested in how you store the actual JWT. in a cookie? an identifier in a cookie and the JWT on the app server?
[12:15:11] tbuehlmann: ah, so js apps, okay
[12:15:16] umdstu: has joined #RubyOnRails
[12:16:04] tamole: has joined #RubyOnRails
[12:16:21] roshanavand: has joined #RubyOnRails
[12:16:37] umdstu: i'm having trouble deploying via capistrano because rake tasks are trying to use the local machine as the db host, instead of the hostname configured in database.yml for that environment
[12:17:04] umdstu: and by local machine, i mean the machine local to the rails app target, not the development machine
[12:17:07] workmad3: chridal: I'm not fully sure... I think it was just deemed unnecessary, especially as the ruby jwt library doesn't support JWE specs yet
[12:17:44] ferr: Hey, I have JS and PHP examples to generate signature, I'm trying to do so in ruby, however, unsuccessfully, any ideas? https://gist.github.com/Fercell/e9030c07c31abc0eab75
[12:17:59] blackmes1: has joined #RubyOnRails
[12:18:45] chridal: workmad3: Aha. So it doesn't support it.
[12:18:51] chridal: Well, I guess we could just get away with signing it
[12:18:59] chridal: I'm just very curious as to what kind of performance gains we can get from this
[12:19:12] EdwardIII: heh ok now i'm confused: https://gist.github.com/EdwardIII/2da0f3470e4e397d758c#file-confused-rb-L13
[12:19:12] tbuehlmann: chridal, I wouldn't use JWT for performance, tbh
[12:19:33] EdwardIII: why is booking_response_id=nil? self.id is 2? i don't get it heh
[12:19:36] chridal: Well, it wouldn't be just performance but also the flexibility
[12:19:46] chridal: tbuehlmann: But do you reckon it in general would lead to worse perf?
[12:20:05] tbuehlmann: chridal, I can't tell, haven't done anything with JWT so far
[12:20:09] chridal: right now I'm hitting an extra table for every single request to the backend
[12:20:25] tbuehlmann: cache it? :p
[12:20:29] EdwardIII: when an object is on the other side of a 1-to-many relationship, maybe it doesn't do what i think?
[12:20:33] workmad3: chridal: I probably wouldn't be worried about it for performance if you're in a single backend scenario
[12:20:53] chridal: tbuehlmann: Right now I am just relying on Rails to cache it
[12:20:55] workmad3: chridal: but when you're making extra network requests to validate the JWT, you're in another ballpark :)
[12:21:04] workmad3: s/JWT/access token/
[12:21:21] tbuehlmann: EdwardIII, I don't get it
[12:21:28] EdwardIII: tbuehlmann: me neither
[12:21:33] chridal: right now we're a single backend, but well be spinning our chat server into a separate TCP-server
[12:21:41] workmad3: ferr: !debug
[12:21:41] helpa: ferr: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[12:21:43] chridal: and with JWT we won't have to hit the API ben for auth
[12:22:29] chridal: oh and 'ben' is my nickname for backend. Pressing enter too hastily here it seems :-)
[12:22:31] EdwardIII: in a scenario like People and Company, where Company has many People, i'd expect, when inside Company, to be able to go people.each, fo rexample
[12:22:31] workmad3: chridal: cool, it make be helpful there then :)
[12:22:57] EdwardIII: that would have been better expressed as Person/Company but i think you probably get what i mean?
[12:23:05] umdstu: so what would make a rails app use the wrong database hostname for its environment
[12:23:25] workmad3: chridal: it would also mean that people who have already got a JWT could use it to authenticate to the chat server and not rely on your identity provider being up at that exact instant for validating the token
[12:23:50] chridal: And also we won't have to fetch the usernames from the API all the time
[12:23:58] chridal: since we also need to supply the clients with the usernames
[12:24:12] chridal: with JWT we can put it right in the token, which is great
[12:25:01] tbuehlmann: chridal, also: no auth updates (which might be bad)
[12:25:20] ferr: workmad3: what more information do I need to provide?
[12:25:20] tbuehlmann: consider revoking access and the user still has the JWT. you have to at least take care of this somehow
[12:25:49] chridal: tbuehlmann: Good point. Short expirys might be a solution, but that might lead to overhead with constantly having to generate a new token
[12:25:58] ferr: workmad3: https://gist.github.com/Fercell/e9030c07c31abc0eab75
[12:26:38] chridal: unless we do something like what public key infrastructure uses where they publish the revoked tokens
[12:26:48] chridal: What's that called? I can't recall
[12:27:04] chridal: where they publish the revoked certificates **
[12:27:08] workmad3: ferr: the gist lets you know... most specifically though: what exactly the problem is (does the code error? not produce the right output? etc.), what steps you've already done to investigate...
[12:27:24] sp1rs: has joined #RubyOnRails
[12:27:39] workmad3: chridal: we handle that with short expiration of tokens coupled with using refresh tokens
[12:27:53] chridal: Something like OCSP
[12:28:03] DonOtreply: has joined #RubyOnRails
[12:28:14] chridal: workmad3: How do you do it with the refresh tokens?
[12:28:18] tbuehlmann: chridal, revokation certs?
[12:28:43] chridal: tbuehlmann: In PKI you have the ability to revoke certificates that are issued so that if a cert goes rogue you can still protect against it.
[12:28:56] chridal: OCSP is a protocol with which you can check the ones that are expired
[12:29:00] tbuehlmann: that's what I meant
[12:29:08] chridal: Ah! Ok. I thought it was a question :-)
[12:29:24] workmad3: chridal: the JWT expires, but it contains a refresh token to allow a fresh one to be obtained... if you need to revoke access, you do so and when the token expires and a refresh is requested it can be denied or updated with new access, etc.
[12:29:54] chridal: workmad3: Cool. So does the client have the responsibility to break off a new request to fetch a refreshed token?
[12:30:09] chridal: or is it the server that does the refreshing and return a new token?
[12:30:20] workmad3: chridal: yeah... the client needs to refresh a token
[12:30:46] workmad3: chridal: that basically works exactly the same as normal refresh tokens in oauth :)
[12:31:31] chridal: I haven't used O'Auth. We decided early on that we didn't need all the features it provided so I never read up on it.
[12:32:03] chridal: Getting really excited about JWT though. Have you read any good books on it?
[12:32:15] workmad3: ah right... a bunch of the stuff I mentioned here is pretty much standard oauth
[12:32:29] arup_r: has joined #RubyOnRails
[12:33:51] workmad3: things like passing the token around, getting one from an identity provider, refresh tokens, etc. are standard oauth2 things... JWT is really just an extension to that where you make the token meaningful :)
[12:34:23] workmad3: and therefore you can do things like avoid a back-channel callback to your oauth provider to validate the token's authenticity
[12:35:04] chridal: Yea, I guess JWT has in it what I originally wanted from OAuth
[12:35:25] workmad3: chridal: it sounds like you may want to look into oauth again as a way to standardise the API authorization for your new service ;)
[12:35:45] chridal: Yea, I will pick up some books this weekend :-)
[12:36:36] chridal: I'm looking into KONG now to use for reverse proxying, and that's actually how I stumbled upon JWT
[12:36:45] workmad3: oh, that reminds me... I need to look around at oauth2 books, see if there are any worthwhile ones for my own reading (needing to dig into it even deeper atm, as we're overhauling our auth services @ work, part of which is being able to explain it well to others :) )
[12:37:07] thebastl: has joined #RubyOnRails
[12:37:15] JonasOSDever: has joined #RubyOnRails
[12:37:21] sevenseacat: has joined #RubyOnRails
[12:37:21] chridal: If you happen to come across any I'd appreciate it if you'd ping me. I love good technical books :-)
[12:37:26] ctrlrsf: has joined #RubyOnRails
[12:37:35] workmad3: I'll try to remember :)
[12:37:37] contradictioned: has joined #RubyOnRails
[12:38:05] differentreality: has joined #RubyOnRails
[12:38:23] jhass: has joined #RubyOnRails
[12:38:24] workmad3: chridal: on a completely different subject, but I've been finding the princeton bitcoin book pretty good so far: https://d28rh4a8wq0iu5.cloudfront.net/bitcointech/readings/princeton_bitcoin_book.pdf?a=1
[12:38:24] EdwardIII: for now i'll just hack it with stay_detail = StayDetail.where(booking_response_id: self.id)... but i'd like to understand what's going on better i think
[12:38:35] workmad3: chridal: in terms of 'good technical books' :)
[12:38:44] chridal: It's really hard to find really good technical books. I just two weeks ago came across Jesse Storimers books. They're really good. Mostly on UNIX concepts and Ruby.
[12:38:54] openstruct: has joined #RubyOnRails
[12:39:23] chridal: workmad3: Yea, I saw that linked on Hacker News but I didn't get around to reading it.
[12:39:37] workmad3: chridal: I've got it on my kindle and started using it as bedtime reading :)
[12:39:52] chridal: I was just about to say that I'll need to see if I can find an epub/mobi version
[12:39:58] chridal: because PDFs are just dreadful on my Kindle :-D
[12:40:15] moeabdol4: has joined #RubyOnRails
[12:40:16] workmad3: the pdf seems ok on mine
[12:40:24] phrozen77: has joined #RubyOnRails
[12:40:35] workmad3: it's mostly just text, so it renders reasonably
[12:40:36] chridal: I have the book SQL Performance Explained on my Kindle as a PDF and I just haven't been able to read it. The content is really great, but I just can't get through 200 pages of shitty fonts.
[12:40:53] Palsson: has joined #RubyOnRails
[12:40:56] chridal: It's a shame really.
[12:41:36] chridal: But this is really interesting. I'll put it on my Kindle. Thanks!
[12:42:30] workmad3: yeah... pdfs on kindle seem to be a case-by-case thing... I've come across some that are pretty shit, but plenty are readable, and some are better than the epub/mobi versions because the mobi version goes and changes page layouts in stupid ways
[12:43:22] umdstu: also I'm using Figaro, rails 4.2, and ruby 2.2
[12:45:47] tbuehlmann: umdstu, is the config/database.yml listed in your .gitignore?
[12:46:20] umdstu: tbuehlmann: no its committed. It uses Figaro.env to pull the values
[12:46:32] chridal: workmad3: Just as an aside; check out Readability. It's a browser extension that will let you send anything to your kindle from your browser. PDFs, articles etc. Also has a nice reading mode in Chrome :-)
[12:46:54] umdstu: tbuehlmann: it's using the correct database and username, just not the host
[12:47:34] tbuehlmann: and you actually provide the host via environment variable and use it via figaro?
[12:47:45] jottr: has joined #RubyOnRails
[12:48:12] ferr: workmad3: I've investigated that far that my params are fine except I'm not sure with hmac, base64 and CGI
[12:49:13] umdstu: tbuehlmann: yep. database.yml:5 'host: <%= Figaro.env.database_host %> and in application.yml under that env: 'database_host: <xyz>'
[12:49:30] arup_r: has joined #RubyOnRails
[12:49:33] sp1rs: has joined #RubyOnRails
[12:49:53] agoldboi: has joined #RubyOnRails
[12:50:06] tbuehlmann: no idea then, sorry
[12:50:22] caustic: has joined #RubyOnRails
[12:50:35] umdstu: it's odd because Figar.env.database_username is using the correct value
[12:50:47] umdstu: as is passwor
[12:51:12] umdstu: and the host value it's using doesn't even appear in the database.yml or application.yml
[12:51:37] umdstu: or in fact *anywhere* in the app aside from the capistrano :db value
[12:53:09] ebbflowgo: has joined #RubyOnRails
[12:53:41] thebastl: has joined #RubyOnRails
[12:53:57] yardenbar: has joined #RubyOnRails
[12:54:08] arBmind1: has joined #RubyOnRails
[12:54:27] EdwardIII: hrm enumerize says you should be able to "@user.sex_text # or @user.sex.text", but when i try that no _text method is ever available: *** NoMethodError Exception: undefined method `text' for #<Enumerize::Attribute:0x007f80d0a0ecb0>
[12:54:32] caustic: has joined #RubyOnRails
[12:55:14] czerasz: has joined #RubyOnRails
[12:55:17] workmad3: ferr: tbh, I saw you'd crossposted without mentioning it, so was just letting #ruby handle your issue
[12:55:39] EdwardIII: looks like it should be a Enumerize::Value, not Attribute?
[12:56:17] workmad3: umdstu: have you checked if it's being set in a DATABASE_URL environment variable by capistrano?
[12:56:28] workmad3: umdstu: DATABASE_URL takes precedence over database.yml
[12:56:41] umdstu: workmad3: yes i looked at the output of `env` and it doesn't appear there anywhere
[12:56:43] tsujp: has joined #RubyOnRails
[12:57:45] flashpoint9: has joined #RubyOnRails
[12:57:47] umdstu: workmad3: and the only place the host value appears in the project is in capistranos config for app:, db:, and :web
[12:57:56] drptbl: has joined #RubyOnRails
[12:58:04] umdstu: which are unrelated
[12:58:18] mdw: has joined #RubyOnRails
[12:58:19] shanemcd: has joined #RubyOnRails
[12:58:38] workmad3: umdstu: weird
[12:58:44] EdwardIII: actually i don't see how this could ever work, it seems impossible
[12:59:13] EdwardIII: their example says you can run user.sex = :male, but that makes no sense, because *** NoMethodError Exception: undefined method `payment_method=' for #<StayDetail::ActiveRecord_Relation:0x007f80cbeddcc8>
[12:59:19] umdstu: and the only place that *wrong* host value appears in the env variables is for HOSTNAME
[12:59:53] umdstu: workmad3: very weird
[13:00:49] workmad3: EdwardIII: it may help if you were dealing with an instance of StayDetail instead of an unexecuted query ;)
[13:00:56] shanemcd: has joined #RubyOnRails
[13:01:15] EdwardIII: workmad3: i think i've got a .where but i'm trying to use it like .find
[13:01:23] workmad3: that would do it
[13:02:41] tamole: has joined #RubyOnRails
[13:03:44] EdwardIII: excellent, sorry for the rookie error
[13:04:07] atomical: has joined #RubyOnRails
[13:04:34] rickmasta: has joined #RubyOnRails
[13:04:55] umdstu: workmad3: i even just hardcoded the value in database.yml instead of assigning it via defaults: and Figaro.env, and it still used the wrong value
[13:05:06] flip_digits: has joined #RubyOnRails
[13:05:23] umdstu: `bundle exec rake db:migrate` is where it first errors
[13:11:33] cabotto: has joined #RubyOnRails
[13:14:51] mark2: has joined #RubyOnRails
[13:16:05] finnnnnnnnnnn: has joined #RubyOnRails
[13:16:11] bronson: has joined #RubyOnRails
[13:16:25] umdstu: is there a rake tasks I can run to see what it thinks the running configuration is?
[13:19:08] scope: has joined #RubyOnRails
[13:20:06] atomical: has joined #RubyOnRails
[13:22:02] chagel: has joined #RubyOnRails
[13:22:34] bbrowning: has joined #RubyOnRails
[13:23:42] jottr: has joined #RubyOnRails
[13:24:28] gr1m_: has joined #RubyOnRails
[13:25:37] gr1m_: hi. whats generally the best practice to run ruby on rails application? what i mean is, is it better to run it inside a docker container (long deploy times) or perhaps a preinstalled server and deploy with capistrano
[13:26:22] chipotle: has joined #RubyOnRails
[13:26:22] futilegames: has joined #RubyOnRails
[13:26:40] gr1m_: docker is nice but it takes ages to deploy a new version each time as you have to rebuild the container, upload it somewhere and then start it on some docker server. capistrano is much faster but without the sexiness of a container
[13:28:17] pawnbox: has joined #RubyOnRails
[13:29:28] jjturner: has joined #RubyOnRails
[13:31:48] Eswar: has joined #RubyOnRails
[13:33:14] dionysus69: has joined #RubyOnRails
[13:33:57] adac: Why should assets in staging and production being served by a the proxy and not by rails itself?
[13:36:36] alexhart_: has joined #RubyOnRails
[13:37:14] nickjj: gr1m_, i wouldn't say it's long deploy times with docker containers
[13:37:20] adac: gr1m_, capistrano might be faster currently yes. But you should use a CI server such as jenkins for example anyways There you can build your docker container and run the tests and then upload it, all in an automated fashion.
[13:37:36] nickjj: it takes me about 30 seconds to deploy a fresh new version of a dockerized rails app, that's from git push to running in production
[13:38:51] chridal: nickjj: How do you incorporate git push into your Dockerization? Quay.io or something?
[13:39:00] adac: nickjj, well thats fast yes
[13:39:12] nickjj: chridal, it depends on the scope of the project
[13:39:22] cabotto_: has joined #RubyOnRails
[13:39:35] nickjj: for smaller projects (1 shot, non-mission critical but still important, etc.) i'll just use git hooks and build it on the box
[13:39:41] adac: nickjj, do you run some tests as well?
[13:39:44] chridal: Right now I've written a small set of rake tasks that will 1. Build the image 2. Push it to our private registry 3. SSH onto the servers 4. Execute a deploy script that will: pull, stop, rm, run new containers
[13:39:47] Kilo`byte: has joined #RubyOnRails
[13:40:01] nickjj: for larger multi-host projects i just use a private registry (i don't use quay.io but it would be similar) with web hooks
[13:40:04] SeanLazer: has joined #RubyOnRails
[13:40:22] chridal: How do you use web hooks with your private registry?
[13:40:24] nickjj: adac, yes. i removed that time from the 30s because it's something you would run in both cases
[13:40:24] rafaelfranca: has joined #RubyOnRails
[13:40:40] gr1m_: sounds good, cheers
[13:40:45] chridal: Currently I don't use git at all for the deployment process, but it might be nice if incorporated with CI
[13:41:05] nickjj: chridal, depends on where you host your registry -- for instance if you're on AWS you don't even need to worry about web hooks
[13:41:25] nickjj: but if you're using your own private registry, the official docker registry has documentation on setting it up
[13:41:49] nickjj: chridal, sure. that is a good end game goal with CI
[13:41:53] chridal: nickjj: How so with AWS? I currently have an instance on AWS running a private registry
[13:42:20] nickjj: commit code -> push code -> CI takes over and runs tests -> if tests are good -> build/tag/push docker image -> etc.
[13:42:37] nickjj: chridal, amazon ECR is amazon's private registry
[13:42:42] chridal: Yea, but what about the pulling, stopping and running?
[13:42:50] chridal: Oh! Right. That's not avaiable in EU-West yet
[13:42:51] nickjj: and then there's amazon ECS for their container mangement solution if you want
[13:43:14] lxsameer: has joined #RubyOnRails
[13:43:16] chridal: And not really using ECS. Couldn't get it to work properly and the documentation was horrid
[13:43:17] nickjj: ECS gives you things to use for the pull/stop/run process
[13:43:26] adac: nickjj, yeah that is true. May I ask what you all do when building the image? Do you have a base image that you use I the process?
[13:43:37] chridal: just running instances on EC2 now for our servers running as Docker hosts
[13:43:43] nickjj: chridal, i actually have an online course coming out next week that will go into create depth on using amazon ecs/ecr
[13:43:44] chridal: but might look into ECS again in the future
[13:43:50] nickjj: *great depth
[13:43:55] sbhatore: has joined #RubyOnRails
[13:44:02] chridal: nickjj: So many of those annoying configurations if you know what I mean
[13:44:21] chridal: so many layers of AWS-stuff on top of the technologies when the technologies work just fine on their own
[13:44:27] nickjj: adac, what do you mean? the base image for the rails app? i use ruby 2.3-slim (or whatever the newest ruby version is at the time)
[13:44:36] chridal: What's it called? Where will you be releasing it?
[13:44:39] chridal: I might want to look into it
[13:44:47] nickjj: chridal, yeah it took a while to eventually get it all wired together
[13:45:11] nickjj: it will tie in IAM, s3, rds, elasticache, esc and ecr to deploy a real world rails app with sidekiq too
[13:45:14] nickjj: load balanced as well
[13:45:40] chridal: Ah, ok. That's basically an identical stack to what we're already running on
[13:45:46] chridal: using EC2 behin ELB though
[13:45:55] nickjj: your best bet would be to follow me on twitter @nickjanetakis because i'll be announcing it there
[13:46:18] nickjj: it will be hosted on https://acloud.guru first, and then eventually it will also be on udemy a few weeks later
[13:46:21] chridal: nickjj: How much of the course is about ECR/ECS in specific and how much is on the rest of the stack?
[13:46:24] delgiudices: has joined #RubyOnRails
[13:46:27] chridal: Ah, alright.
[13:46:44] adac: nickjj, oh ok I see, thanks! Yes In my base image I currently compile my ruby for myself and do git pull and install some stuff
[13:47:15] nickjj: chridal, the first part of the course will be purely on ECS/ECR, but the rest of the course builds on knowledge you've learned on those topics and ties in the rest of the amazon services and the rails app to deploy it to production behind a load balancer
[13:47:47] nickjj: all in all it's about 6 hours long of content
[13:48:09] jjturner: has joined #RubyOnRails
[13:48:13] nickjj: adac, ah. you may want to consider looking into https://hub.docker.com/_/ruby/
[13:48:33] adac: nickjj, jupp that is cool :) thanks a lot!
[13:48:48] nickjj: they also just recently added an alpine version too which has a very small image size
[13:49:17] chridal: nickjj: Is that the official Alpine migration thing?
[13:49:23] chridal: Or was that to Busybox?
[13:49:36] nickjj: yep, eventually all or most of the official images will be moved over to alpine
[13:49:38] chridal: I remember reading something about all the "core" packages on Docker Hub to be moved to one of those
[13:49:46] chridal: Is this one of those official alpine ones?
[13:50:21] nickjj: at the top of the page it's listed as "official repository", you can also tell by the docker pull command on the right
[13:50:39] nickjj: since it has no username, you can be sure it's official
[13:50:45] flashpoint9: has joined #RubyOnRails
[13:51:15] RegulationD: has joined #RubyOnRails
[13:51:16] adac: nickjj, I'm not sure about this alpine thingy. Is it good? I read more often about it these days
[13:51:24] nickjj: adac, if you're interested you might want to look at this blog post about dockerizing a rails app https://semaphoreci.com/community/tutorials/dockerizing-a-ruby-on-rails-application
[13:51:32] nickjj: it contains a dockerfile that i typically use for all my rails app
[13:52:12] nickjj: as soon as rails 5 ships, i'll be updating the post for both rails 5 as well as docker 1.10/compose 1.6
[13:52:50] nickjj: adac, alpine has upsides and downsides to it. the biggest win is that images are MUCH smaller, we're talking 10x smaller in some cases
[13:52:52] adac: nickjj, I pretty much have done it by myself. But I'm sure I can improve my settings based on your blog post. thanks I will read trough!
[13:53:09] nickjj: the downside is some ruby gems require C extensions and with alpine you might have issues compiling them
[13:53:25] nickjj: so you'll end up having to hunt down dependencies on your own for those gems and incorporating them into your dockerfile
[13:53:44] nickjj: luckily it's only something you need to do once, but it's kind of a pain, definitely less friendly than using something like debian
[13:54:20] ferr: How would I structure my code if I need to create objects from other restful API, shall I create new module, store connection there and initialize new objects on that module?
[13:54:27] adac: nickjj, Ok I see yes. i#m pretty happy now with ubuntu or ddebian or stuff. This registry server seems to quite efficient in terms of disk space as well. i'm quite used to debian and ubuntu, but yeah never say never :)
[13:55:07] nickjj: adac, a typical rails app inside of a debian base image (which is what the ruby gem is based off of unless you use the alpine version) is around 550mb
[13:55:11] qejk: has joined #RubyOnRails
[13:55:25] nickjj: that would be for a fairly barebones app with a couple of essential gems
[13:56:09] mustmodify: ferr: tell me more about your use case.
[13:56:28] nickjj: but it's not too bad, once you push the initial image, future pushes are usually ~5mb or less for the difference
[13:56:52] ferr: mustmodify: I have model DriverApplication, and all information will be retrieved from external API in json
[13:57:23] adac: nickjj, yeah! But I see. the more tiny the faster all is happening in terms of push and pull and so one.
[13:58:12] adac: nickjj, do you already have clustered stuff with docker swarm and networking as well? Maybe we can have a private chat since this is quite OT? :) Would be awesome!
[13:58:30] ferr: So there should be some workers who will hit the API to check if there are new records and if there are, new instance of DriverApplication should be created
[13:58:34] mustmodify: ferr: And what kind of information is in this DriverApplication?
[13:58:44] nickjj: adac, i have quite a bit of experience with clustering on AWS, but not with swarm directly
[13:58:58] ferr: mustmodify: It will be text stored in jsonb at database
[13:58:58] nickjj: but i do know how networking works
[13:59:58] ferr: mustmodify: this is sample of API response https://gist.githubusercontent.com/Fercell/47f75f8a174114764344/raw/f30265baf390fd8ff54803f355fcf25842ed7063/sample
[14:01:04] pawnbox: has joined #RubyOnRails
[14:02:19] sp1rs: has joined #RubyOnRails
[14:04:18] CodaBrink: has joined #RubyOnRails
[14:04:22] ferr: mustmodify: any suggestions?
[14:06:49] IFrank00: has joined #RubyOnRails
[14:07:02] drale2k: i have a chat written in Rails 5 using ActionCable. I want when someone loses the connection and then reconnects, to load the messages he missed. I don't want to reload everything if possible. Any idea how to go about this ?
[14:08:32] DefV: you could do an API call where you pass in the last message id the user has seen, and then query the model for more recent messages and return those?
[14:09:02] ramortegui: has joined #RubyOnRails
[14:11:31] flashpoint9: has joined #RubyOnRails
[14:11:32] mustmodify: ferr: Sorry, had to go make breakfast.
[14:12:11] mustmodify: I always think it's funny when an HTTP response starts with {"status": 200,...
[14:12:23] yellow5: has joined #RubyOnRails
[14:12:40] atomical: has joined #RubyOnRails
[14:12:56] Eswar: has joined #RubyOnRails
[14:13:37] mustmodify: ferr: I would create a DriverApplicationFactory class that accepted this input and created a DriverApplication
[14:13:41] mustmodify: has left #RubyOnRails: ()
[14:15:03] arup_r: has joined #RubyOnRails
[14:15:04] tamole: has joined #RubyOnRails
[14:16:10] Guest34101: has joined #RubyOnRails
[14:18:29] tetraktys: has joined #RubyOnRails
[14:20:15] tetraktys: has joined #RubyOnRails
[14:21:10] drbayer: has joined #RubyOnRails
[14:21:39] shanemcd: has joined #RubyOnRails
[14:22:18] shanemcd: has joined #RubyOnRails
[14:22:45] merida: has joined #RubyOnRails
[14:30:51] DonOtreply: has joined #RubyOnRails
[14:31:29] roshanavand: has joined #RubyOnRails
[14:34:00] Abhijit: has joined #RubyOnRails
[14:34:15] shanemcd: has joined #RubyOnRails
[14:34:39] berk: has joined #RubyOnRails
[14:35:18] snowy: has joined #RubyOnRails
[14:36:38] agoldboi: has joined #RubyOnRails
[14:38:10] EdwardIII: ok, just one last big fat issue with turbolinks and i think life is good
[14:38:31] EdwardIII: from what i see this is a pretty common pattern for serving back a form when it's not valid: https://gist.github.com/EdwardIII/bdc67b0fc79a6cbf5d3e#file-m-rb-L11
[14:38:41] DmitryBochkarev: has joined #RubyOnRails
[14:40:01] EdwardIII: so when i do a data-remote=true submit to that and it's valid, life is good - turbolinks follows the redirect. however, if it's invalid, the server returns the page again with the invalid messages etc but turbolinks seems to ignore it
[14:40:41] cabotto: has joined #RubyOnRails
[14:41:03] EdwardIII: what's the right approach here?
[14:41:18] tbuehlmann: the server responds with the page but doesn't render? or what exactly is the problem?
[14:41:35] EdwardIII: tbuehlmann: well turbolinks doesn't render the response
[14:41:39] EdwardIII: so the page never updates
[14:42:06] Sephyros: whats the best approach to change index collection with checkbox? create two collections and change via ajax?
[14:42:07] EdwardIII: tbuehlmann: so 'yes' to your question heh
[14:42:26] tbuehlmann: EdwardIII, uh, hard to say. do you have that project online?
[14:42:41] EdwardIII: tbuehlmann: i don't, but i can gist the relevant bits?
[14:43:02] tbuehlmann: not so sure if it helps :)
[14:43:25] EdwardIII: well if you have a normal page submit, turbolinks doesn't cut-in at all
[14:43:41] EdwardIII: so i switch the form to remote: true
[14:43:46] EdwardIII: and it works great as long as the form is valid
[14:44:00] DonOtreply: has joined #RubyOnRails
[14:44:17] tbuehlmann: what version of turbolinks are you using?
[14:44:52] neohunter: has joined #RubyOnRails
[14:45:05] EdwardIII: like an absolute trailblazer
[14:45:20] tamole: has joined #RubyOnRails
[14:45:42] uglybandersnatch: has joined #RubyOnRails
[14:45:55] pawnbox: has joined #RubyOnRails
[14:46:15] merida: has joined #RubyOnRails
[14:46:23] EdwardIII: the thing is this post request might take a long time, so using ajax for it would be better
[14:46:43] tbuehlmann: sounds like a normal turbolinks request to me, so that should work, right?
[14:46:44] EdwardIII: i guess i could just manually read the response, cut the old body out, and put the new body in
[14:46:59] EdwardIII: tbuehlmann: no i don't think so, whenever you do a POST with turbolinks 5 it seems to step outta the way
[14:47:18] tbuehlmann: haven't played with turbolinks 5 so far..
[14:47:26] EdwardIII: https://github.com/turbolinks/turbolinks-classic/issues/352#issuecomment-37015963
[14:47:30] tbuehlmann: do you use data-turbolinks-permanent and just not see updates because there aren't any?
[14:47:34] EdwardIII: seems like classic does it to
[14:48:11] EdwardIII: tbuehlmann: mmm no nothing like that. also i think turbolinks 5 totally does away with the concept of partially updateable content
[14:48:13] tbuehlmann: oh, you're right
[14:48:15] pawnbox: has joined #RubyOnRails
[14:48:27] tbuehlmann: well, that's the case, partial updates are gone
[14:48:47] Eswar: has joined #RubyOnRails
[14:48:48] tbuehlmann: can you setup a minimal example with this behaviour so I can play with it?
[14:49:05] drale2k: what they did with turbolinks confuses the shit out of me. Jumped from 3. to 5, first had parital updates and now they are gone
[14:50:00] sankaber: has joined #RubyOnRails
[14:50:15] EdwardIII: tbuehlmann: yeah i'll try and pop something together
[14:50:27] EdwardIII: tbuehlmann: although i feel the right answer may simply be "update the content yourself for now"
[14:50:34] tbuehlmann: yup, that'll work
[14:52:59] Sephyros: how i can change instance variables of controller depending on checkbox status?
[14:54:30] mag42c: has joined #RubyOnRails
[14:54:38] shanemcd: has joined #RubyOnRails
[14:54:58] _bogus_: hey, do I need to require 'capistrano/rvm' and 'capistrano/passenger' if im on my local machine? (server has both but my local machine has only rvm)
[14:56:52] krz: has joined #RubyOnRails
[14:57:48] dionysus69: has joined #RubyOnRails
[14:59:39] HalcyonicStorm: has joined #RubyOnRails
[15:01:23] EdwardIII: tbuehlmann: not sure if you're interested heh but this is my fix: https://gist.github.com/EdwardIII/bdc67b0fc79a6cbf5d3e
[15:02:20] VeryBewitching: has joined #RubyOnRails
[15:02:24] mag42c: has joined #RubyOnRails
[15:03:59] adavia: has joined #RubyOnRails
[15:05:06] lxsameer: has joined #RubyOnRails
[15:06:10] sandstrom: has joined #RubyOnRails
[15:06:45] tbuehlmann: I remembered how I solved this using turbolinks 3, I think it was with an `turbolinks: true` option when rendering. but well, that's not "in the scope of turbolinks" anymore
[15:06:48] EdwardIII: i wonder what 37signals think of angular, react et al
[15:07:13] CornishPasty: who's 37signals? :P
[15:07:53] EdwardIII: tbuehlmann: i wonder if that decision is in response to all these js frameworks. i.e. "if you need partial re-rendering maybe turbolinks isn't the right tool for the job"?
[15:08:31] sandstrom: has joined #RubyOnRails
[15:08:32] CornishPasty: I thought turbolinks 5 is doing partial re-rendering?
[15:08:42] tbuehlmann: I understand the reasoning, but it worked so well for me, that's why I'm stubborn :)
[15:09:34] lxsameer: has joined #RubyOnRails
[15:09:34] merida: has joined #RubyOnRails
[15:11:23] yellow5: has joined #RubyOnRails
[15:11:45] sandstrom: has joined #RubyOnRails
[15:11:50] foxmask: has left #RubyOnRails: ()
[15:11:59] shanemcd: has joined #RubyOnRails
[15:11:59] Rubie: has joined #RubyOnRails
[15:12:41] arup_r: hi VeryBewitching :)
[15:12:54] EdwardIII: tbuehlmann: is that the reasoning then?
[15:13:04] arup_r: how are you sir? :)
[15:13:10] n008f4g_: has joined #RubyOnRails
[15:15:13] tamole: has joined #RubyOnRails
[15:16:49] arup_r: drale2k: :D
[15:17:31] arup_r: Sephyros: we need MORE context... :)
[15:18:00] flashpoint9: has joined #RubyOnRails
[15:18:16] EdwardIII: hrm in erb <% mask_classes = classes || '' %> throws 'undefined local variable or method' bit i thought usually it was just nilClass?
[15:18:59] arup_r: EdwardIII: yes, you need to define it `classes` first, did you?
[15:19:31] EdwardIII: arup_r: yes but sometimes it isn't defined
[15:19:32] arup_r: or another important part you cut from the original message..
[15:19:38] EdwardIII: that's sort of my point
[15:19:46] EdwardIII: i want it to not error if it's not defined
[15:19:53] arup_r: do you have a handy gist to show it?
[15:20:07] shinnya: has joined #RubyOnRails
[15:20:18] EdwardIII: arup_r: sure: https://gist.github.com/EdwardIII/25e397497479920864b5
[15:20:36] arup_r: sometimes defined and sometimes not.. I can trust if you rails built on JS .. hehe
[15:21:18] EdwardIII: ah, null coalesce does the job
[15:21:48] arup_r: where you defined `classes` before https://gist.github.com/EdwardIII/25e397497479920864b5#file-e-html-erb-L2 ?
[15:21:52] arup_r: you have to.
[15:21:55] EdwardIII: arup_r: i didn't
[15:22:01] arup_r: you have to
[15:22:16] arup_r: that's the whole point of the error
[15:22:31] someish: has joined #RubyOnRails
[15:22:35] morfin: how you usually customize rails?
[15:23:17] morfin: or gems customizing rails
[15:23:23] tamole: has joined #RubyOnRails
[15:24:04] arup_r: morfin: whole rails is you customize, but putting code inside the template, no?
[15:24:38] morfin: template?
[15:25:14] EdwardIII: arup_r: no i don't, i can just say <% classes ||= '' %>. the whole point is i want it to be optional in this partial so you can use it in different locations. in some you might want to add extra classes, in some you might not
[15:25:15] arup_r: yeah.. if you do rails g model User, you get a user.rb file with 2 lines of code...
[15:25:25] arup_r: after that, you fill it as you go
[15:25:27] morfin: ah you mean that
[15:25:46] morfin: i meant other thing - overriding default behaviours
[15:25:49] arup_r: my main point was your question was not clear, you have to say _more_
[15:26:09] morfin: monkeypatching stuff?
[15:26:15] arup_r: EdwardIII: that's different thing
[15:27:04] EdwardIII: that's exactly what i needed
[15:27:19] EdwardIII: although now i can't figure out how to override the form classes in simple_form_for heh
[15:28:14] arup_r: EdwardIII: while Ruby parsing this mask_classes = classes if classes line, ruby goes to check condition, and found the var `classes` is neither a local var or a method.. and it blows up
[15:28:30] arup_r: <% mask_classes = classes if classes %> != <% mask_classes !!= classes %>
[15:29:59] aaronang: has joined #RubyOnRails
[15:30:39] arup_r: morfin: we do with the help of `super`
[15:30:49] arup_r: Devise is a classic example of that..
[15:31:31] arup_r: you will override their controller.. when you have some own logic.. and then like def update; #my own logic: super ; end
[15:31:34] aaronang: Hi guys, does anyone know how I can run SimpleCov on the Rails framework? For example, I want to see the test coverage of the module actionpack.
[15:32:48] shanemcd: has joined #RubyOnRails
[15:33:38] livcd: has joined #RubyOnRails
[15:33:54] LastWhisper____: has joined #RubyOnRails
[15:34:09] baweaver: has joined #RubyOnRails
[15:34:42] umdstu: trying to build ruby on a machine, forgot to include readline with it the first time. when i use --with-readline-dir=/usr for the ./configure command, the option isn't in "Configured with..." that prints at the end
[15:35:28] pawnbox: has joined #RubyOnRails
[15:35:35] umdstu: and `ruby ext/readline/extconf.rb` is all good
[15:36:10] pawnbox: has joined #RubyOnRails
[15:36:41] morfin: Devise is some weird monster
[15:36:46] wolfravenous: has joined #RubyOnRails
[15:37:50] LastWhisper____: hey there -- I'm on rails 4 trying ot use a find_or_create_by(created_user_id: current_id), but it's telling me the method is missing for my model. Is there something I'm missing?
[15:39:34] atomical: has joined #RubyOnRails
[15:39:47] arup_r: LastWhisper____: show the code you attempted, which caused the error pls
[15:40:27] griffindy: has joined #RubyOnRails
[15:40:28] LastWhisper____: ven.availability.find_or_create_by(created_user_id: ven.id)
[15:40:30] LastWhisper____: that's what i typedin console
[15:40:32] LastWhisper____: this was the error:
[15:40:39] LastWhisper____: NoMethodError: undefined method `find_or_create_by' for #<Availability:0x007fe7b51495e8>
[15:40:40] arup_r: that is _wrong_
[15:41:20] _bogus_: can I have some help on this? https://gist.github.com/anonymous/125e9008c16ec83b826e
[15:41:23] LastWhisper____: care to enlighten me as to why arup_r ?
[15:41:31] d0nn1e: has joined #RubyOnRails
[15:41:40] arup_r: yes.. moment please
[15:43:23] zave: has joined #RubyOnRails
[15:43:53] wolfravenous: Have a relational database issue I am trying to work through. I have read through the Active Records Association section on guides.ror.org but I am still having trouble trying to set up the relationships. I have four data types, :teachers :blocks :students :topics I am basicly trying to put together a student scheduling app. Can anyone help me with the logic or link to a good tutorial that shows how to create an app sim
[15:43:54] wolfravenous: to this in Rails 4. I remember back in rails 1 there was a great tutorial online somewhere similar to this that had to do with pizza and toppings :)
[15:44:10] nfk: has joined #RubyOnRails
[15:44:45] arup_r: LastWhisper____: Try *Association extensions* http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html
[15:45:01] moeabdol: has joined #RubyOnRails
[15:45:34] LastWhisper____: awesome. reading
[15:46:07] arup_r: LastWhisper____: and report me back, I am still wondering though.. The example I linked have some other object inside block, dunno .. checking the same
[15:46:08] tetraktys: has joined #RubyOnRails
[15:46:19] B1n4r10: has joined #RubyOnRails
[15:46:21] LastWhisper____: I was actually doing this code inside of a controller as well
[15:46:29] LastWhisper____: but I guess I can extend a method
[15:46:53] arup_r: LastWhisper____: that's ok. But you need to extend the assoc inside the model first.. and then you can call it.
[15:46:56] yellow5: has joined #RubyOnRails
[15:47:06] smathy: has joined #RubyOnRails
[15:47:43] arup_r: Inside the assoc do end there is a proxy object, and I think method is then defined on that object.
[15:49:06] zave: has joined #RubyOnRails
[15:51:55] mary5030: has joined #RubyOnRails
[15:52:24] LastWhisper____: actually spoke to my lead and he suggested just doing a manual find OR create, since our model where we declare has_one :availability is bloated
[15:52:37] LastWhisper____: the joys of meeting code climate requirements in a huge codebase
[15:52:59] arup_r: wolfravenous: you draw your models first in paper. and then create a new app.. and the first create those model as you have drawn. then add routes and controller to do CRUD with them.. from there keep extending..?
[15:53:07] mary5030: has joined #RubyOnRails
[15:53:26] arup_r: LastWhisper____: good luck! :)
[15:55:47] opiates: has joined #RubyOnRails
[15:56:00] Devalo: has joined #RubyOnRails
[15:57:42] opiates: So my previous experiences developing have been mainly within the context of AngularJS w/REST APIs, or LAMP stack. With that in mind, I'm currently working on a project that uses Rails 3.2; how difficult would it be to set up Bower to manage front-end dependencies?
[15:57:51] opiates: ...and does anybody have any experience in this matter
[15:58:54] shanemcd: has joined #RubyOnRails
[16:01:37] enkristoffer: I'm getting a 'ActiveRecord::Fixture::FixtureError: table "reviews" has no column named "user"' - The table has a user_id column and the fixture is referencing a User fixture the same way I usually do: https://gist.github.com/sachse/b32fb749d6a7233866ea - any ideas what the problem is? Rails 5 beta3 (tried with master as well)
[16:02:00] LastWhisper____: well based on this: https://github.com/rails-assets/rails-assets/issues/291 opiates you can probably trust that people will continue to support rails-assets
[16:02:20] LastWhisper____: you can use the asset pipeline for most of your stuff if you're using angular
[16:02:37] opiates: Well, I just spoke with the senior dev who seems to feel that right now we're better off just sticking the minified file in the assets dir x.x
[16:02:43] LastWhisper____: (i would skim to the bottom of that link)
[16:03:06] wolfravenous: I have drawn the models on paper, and I think I have them drawn correctly, but I am confused over what “belongs to” verses “has many” I think the logic is http://pastie.org/10755067 but I am not sure, mind taking a look?
[16:03:13] opiates: I'm fairly certain that we're probably gonna end up revamping a lot of stuff, esp given we're running Rails 3 and a lot of other outdated stuf
[16:03:19] opiates: :( I miss bower. Anyways, thanks LastWhisper____ :)
[16:03:21] chipotle: has joined #RubyOnRails
[16:03:28] LastWhisper____: opiates you can get bower working with rails fyi
[16:03:33] morfin: why some guys says that RoR is slow?
[16:03:38] Sephyros: how i can change instance variables of controller depending on checkbox status?
[16:04:02] opiates: LastWhisper____: yeah I'd probably do it if it were my own personal project. I just wasn't sure that (given the current status of, well, everything) it'd be worth it in our situation
[16:04:03] morfin: is there real benchmarks somewhere for hmm big enough apps?
[16:04:06] arup_r: Sephyros: why you want to do it?
[16:05:42] LastWhisper____: @opiates it's worth it
[16:05:44] Sephyros: i have 2 variables on controller @users and @users_without_tenants, i need to get one of them based on checkbox (with or without tenants checkbox)
[16:05:49] LastWhisper____: it's as easy as "adding a gem"
[16:05:57] LastWhisper____: to your gemfile, but you get the correct syntax from rails-assets.org
[16:06:02] morfin: i think that AR could be slowest part of RoR apps but i am not pretty sure
[16:06:36] LastWhisper____: morfin rails isn't known for being fast in terms of performance, it's fast f or developers to create new features
[16:06:47] AzaToth: has joined #RubyOnRails
[16:07:21] Abhijit: has joined #RubyOnRails
[16:07:31] Abhijit: is there any better alternate than has_friendship?
[16:08:15] arup_r: wolfravenous: warm up tutorials for things you are looking for http://guides.rubyonrails.org/association_basics.html
[16:08:41] theunraveler: has joined #RubyOnRails
[16:09:45] jayp: has joined #RubyOnRails
[16:09:48] umdstu: capistrano deploy tries to create the shared directories during every deploy, even if its just an update
[16:10:30] merida_: has joined #RubyOnRails
[16:10:59] dgncn: has joined #RubyOnRails
[16:11:14] shanemcd: has joined #RubyOnRails
[16:12:28] tjohnson: has joined #RubyOnRails
[16:13:06] jjturner: has joined #RubyOnRails
[16:13:20] wolfravenous: arup_r: thanks, I actually have that page open in a tab already, it is what I used to design the logic i put into pastie… I am just not sure if everything should “belong_to” block or if I shoould use a different one of the data types as the anchor data type that all the others relate to.
[16:14:13] arup_r: has left #RubyOnRails: ()
[16:15:34] gbgdev: has joined #RubyOnRails
[16:16:50] gbgdev: has joined #RubyOnRails
[16:17:44] arup_r: has joined #RubyOnRails
[16:18:37] ruler_: has joined #RubyOnRails
[16:19:32] someish: has joined #RubyOnRails
[16:19:48] banister: has joined #RubyOnRails
[16:20:39] Rubie: has joined #RubyOnRails
[16:20:58] _bogus_: does anybody knows how can I use bitbucket with capistrano ?
[16:21:41] rubyonrails001: has joined #RubyOnRails
[16:22:26] RegulationD: has joined #RubyOnRails
[16:24:08] KensoDev: has joined #RubyOnRails
[16:24:46] gregf_: has joined #RubyOnRails
[16:27:30] Eswar: has joined #RubyOnRails
[16:27:47] sandstrom: has joined #RubyOnRails
[16:30:07] chouhoulis: has joined #RubyOnRails
[16:30:49] EdwardIII: heh hrm ok. i'm seeing "Unable to autoload constant DateTimeInput, expected /Users/edward/Projects/myproject/app/inputs/date_time_input.rb to define it" but, that file contains: https://gist.github.com/EdwardIII/8c5025739c2d4b5c0756
[16:30:55] EdwardIII: whatchatalkingaboutrails?
[16:31:52] EdwardIII: hrm, looks like i have to drop the module definition
[16:32:05] EdwardIII: ahhhh you're supposed to specify it in an initializer
[16:32:58] y2mq37: has joined #RubyOnRails
[16:35:01] jayp: has left #RubyOnRails: ("Using Circe, the loveliest of all IRC clients")
[16:39:27] disgrntld: has joined #RubyOnRails
[16:41:02] DonOtreply: has joined #RubyOnRails
[16:42:10] morfin: but what is slowest part of Rails?
[16:44:07] adaedra: code you write on top of it.
[16:44:47] arup_r: has joined #RubyOnRails
[16:47:44] norc: has joined #RubyOnRails
[16:49:27] shanemcd: has joined #RubyOnRails
[16:50:17] IFrank00: has joined #RubyOnRails
[16:50:26] smathy: has joined #RubyOnRails
[16:50:33] lxsameer: has joined #RubyOnRails
[16:51:30] codepete: has joined #RubyOnRails
[16:51:49] norc: I am using select2 to provide an elegant way of searching through select lists, but I have not been happy with the fact that it does not feel intuitive (autofocus does not work because the elements change, you have to press spacebar or enter before you can start searching).
[16:51:59] flashpoint9: has joined #RubyOnRails
[16:52:40] norc: Using an input field with select2 is also not very pretty since I am not a big fan of the "tag" look of the inserted item.
[16:52:46] norc: Are there any other gems I should take a look at?
[16:52:59] beingjohnm: has joined #RubyOnRails
[16:53:28] norc: Anything shipping with a bootstrap theme would be nice. :)
[16:53:28] beingjohnm: has joined #RubyOnRails
[16:56:05] DonOtreply: has joined #RubyOnRails
[16:58:05] tubbo: morfin: find out http://www.newrelic.com
[16:58:18] tubbo: profile your app and see just how much time you're spending in each part of it
[16:58:38] chouhoulis: has joined #RubyOnRails
[16:58:41] moeabdol1: has joined #RubyOnRails
[16:59:10] shanemcd: has joined #RubyOnRails
[16:59:33] DonOtreply: has joined #RubyOnRails
[17:00:42] EdwardIII: i don't suppose anyone knows how to create arbitrary new elements in the simple_form_bootstrap.rb initializer?
[17:00:47] [Butch]: has joined #RubyOnRails
[17:01:15] EdwardIII: i tried this, but it says icon doesn't exist: https://gist.github.com/EdwardIII/e3677ce2a8b91ca857c8#file-r-rb-L11
[17:01:22] EdwardIII: which makes sense, as i just made it up
[17:01:56] SPYGAME: has joined #RubyOnRails
[17:02:35] EdwardIII: ah, you can just keep saying .wrapper, life is good
[17:03:09] norc: Nevermind, it looks like I just want to swap out select2 for selectize.
[17:04:16] DonOtreply: has joined #RubyOnRails
[17:04:19] rubyonrails699: has joined #RubyOnRails
[17:06:17] chouhoulis: has joined #RubyOnRails
[17:06:38] htmldrum: has joined #RubyOnRails
[17:07:01] sp1rs: has joined #RubyOnRails
[17:07:19] shanemcd: has joined #RubyOnRails
[17:07:29] matthias_: has joined #RubyOnRails
[17:07:41] gbgdev: has joined #RubyOnRails
[17:08:53] thebastl: has joined #RubyOnRails
[17:10:05] rickmasta: has joined #RubyOnRails
[17:13:34] shanemcd: has joined #RubyOnRails
[17:14:54] stannard: has joined #RubyOnRails
[17:14:56] delgiudices: has joined #RubyOnRails
[17:15:19] HalcyonicStorm: has joined #RubyOnRails
[17:16:47] Bloomer: has joined #RubyOnRails
[17:17:41] finnnnnnnnnnn: has joined #RubyOnRails
[17:18:51] bronson: has joined #RubyOnRails
[17:18:56] tenderlove: has joined #RubyOnRails
[17:20:34] arup_r: has joined #RubyOnRails
[17:22:12] fedexo: has joined #RubyOnRails
[17:22:36] blackmes1: has joined #RubyOnRails
[17:24:36] sneakerhax: has joined #RubyOnRails
[17:27:31] baweaver: has joined #RubyOnRails
[17:29:48] DoctorMonocular: has joined #RubyOnRails
[17:34:42] rakm: has joined #RubyOnRails
[17:34:46] ericmeds: Any recommendations on finding old defunct specs to clean out?
[17:35:00] drale2k: hm i get chat message back in the wrong order
[17:35:23] arup_r: fix your .order drale2k :)
[17:35:40] drale2k: i am not usnig one, i thought it will just output the newest last
[17:35:53] drale2k: which works most of the time but some messages are out of order, weird
[17:35:54] smathy: ericmeds, define "defunct" ?
[17:36:02] marr: has joined #RubyOnRails
[17:36:43] ericmeds: well specificaly which code paths they’re hitting so we can tell if we even use that functionality anymore
[17:36:54] ericmeds: can rcov do this?
[17:39:14] Maletor: has joined #RubyOnRails
[17:39:21] roshanavand: has joined #RubyOnRails
[17:39:37] chipotle: has joined #RubyOnRails
[17:40:10] merida: has joined #RubyOnRails
[17:41:05] pawnbox: has joined #RubyOnRails
[17:41:16] drale2k: is it recommended to set default ordering on every model ?
[17:41:53] drale2k: i thought "id ASC" or "created_at ASC" is the default
[17:42:01] mostlybadfly: has joined #RubyOnRails
[17:42:01] arup_r: drale2k: yes
[17:42:17] arup_r: you should have your own there
[17:42:34] drale2k: i set now "id ASC" and it seems to have fixed the ordering issue
[17:42:57] drale2k: what is the Rails' default?
[17:43:02] fryguy: there is no default
[17:43:20] fryguy: you should probably only set an explicit ordering if you actually need it, as it can have adverse effects on performance
[17:43:53] drale2k: fryguy: but in which order does it list records without a default ordering?
[17:44:25] fryguy: drale2k: it lists records in the order that the database thinks will be the fastest
[17:44:39] fryguy: which will depend on the query execution plan, and most notably if it's using an index or something
[17:45:08] drale2k: ah ok thanks
[17:45:14] fryguy: typically, in my database systems, if you are doing a query that results in a full table-scan, it will return in ID order. If you hit a query that uses an index, dependent on if it's a covering index or not and if the table schema supports that, it will return in index sorted order
[17:45:23] The_Phoenix: has joined #RubyOnRails
[17:46:51] The_Phoenix: has joined #RubyOnRails
[17:47:18] drbayer: has joined #RubyOnRails
[17:48:58] drbayer: has joined #RubyOnRails
[17:49:40] smathy: ericmeds, oh, you want to clear out *code* based on what your tests don't hit?
[17:49:54] smathy: ericmeds, yes, a coverage tool will give you that info
[17:50:08] djbkd: has joined #RubyOnRails
[17:52:15] mwlang: has joined #RubyOnRails
[17:52:23] The_Phoenix1: has joined #RubyOnRails
[17:52:32] DoctorMonocular: has joined #RubyOnRails
[17:52:48] merida_: has joined #RubyOnRails
[17:53:07] workmad3: fryguy: I wouldn't depend on that btw... I've found pg returns results in very odd orders at times for example :)
[17:53:43] fryguy: workmad3: yep
[17:53:47] intrigueD: has joined #RubyOnRails
[17:53:56] fryguy: depending on the implicit ordering is gonna give you a bad time
[17:54:11] The_Phoenix2: has joined #RubyOnRails
[17:54:16] workmad3: fryguy: and more importantly, the database-decided ordering of a statement without an ORDER BY isn't necessarily stable (I've had pg return different orders on the same query executed a few seconds after each other... caused major pagination headaches :D )
[17:54:22] ftj: has joined #RubyOnRails
[17:55:01] tubbo: fryguy: +1
[17:55:11] tubbo: also applies to ruby code reloading lol
[17:55:59] smathy: drale2k, most DBs will return results in insert order.
[17:56:59] sleungcy: has joined #RubyOnRails
[17:57:57] dmz: has joined #RubyOnRails
[17:58:54] smathy: I think MySQL is a big exception to that, I think it always returns by the pkey.
[17:59:01] wolfravenous: has joined #RubyOnRails
[17:59:28] fryguy: it does no
[18:00:02] Mission-Critical: has joined #RubyOnRails
[18:00:11] Pulp: has joined #RubyOnRails
[18:03:19] stannard: has joined #RubyOnRails
[18:04:16] wldcordeiro: has joined #RubyOnRails
[18:04:18] kinduff: has joined #RubyOnRails
[18:04:48] chipotle: has joined #RubyOnRails
[18:04:59] shanemcd: has joined #RubyOnRails
[18:05:08] rlf: has joined #RubyOnRails
[18:05:18] kinduff: I have a model like this https://gist.github.com/kinduff/a63d49b302e0558588af, how can I count from the parent to all the children associated with each other?
[18:05:52] FLeiXiuS: has joined #RubyOnRails
[18:05:52] FLeiXiuS: has joined #RubyOnRails
[18:07:12] arup_r: has joined #RubyOnRails
[18:07:32] IFrank00: has joined #RubyOnRails
[18:07:43] slash_nick: kinduff: i think there's a problem(?) with doing something like @parent.kiddos.count... you'll get a count of all the kiddos, not those belonging to the parent... use @parent.kiddos.length
[18:08:02] The_Phoenix: has joined #RubyOnRails
[18:08:07] trinaldi: has joined #RubyOnRails
[18:08:18] kinduff: slash_nick, but is one kiddo has kiddo.kiddos, how can I count them too?
[18:08:18] arup_r: I thought OP is looking for a group by
[18:08:34] kinduff: yes, something like that arup_r
[18:08:47] kinduff: kinduff rusty in Rails :P
[18:09:02] manfrin: has joined #RubyOnRails
[18:09:07] arup_r: @parent.kiddos.group(:praent_id).count
[18:10:05] prgmmr: has joined #RubyOnRails
[18:13:03] CanTonic: has joined #RubyOnRails
[18:14:58] sypheren: has joined #RubyOnRails
[18:15:20] sypheren: has joined #RubyOnRails
[18:16:43] yardenbar: has joined #RubyOnRails
[18:17:08] sankaber: has joined #RubyOnRails
[18:17:23] KensoDev: has joined #RubyOnRails
[18:25:09] adre: has joined #RubyOnRails
[18:28:10] KensoDev: has joined #RubyOnRails
[18:30:38] edwinvdgraaf: has joined #RubyOnRails
[18:30:43] Jon30: Does anybody have experience with google_drive gem? I had to switch from key.p12 authentication cause suddenly it stopped working. So I switched to another method: I used client_id and client_secret to generate a refresh token (manually via user interaction). Now I added client_id, client_secret and the refresh token into my app which writes into a spreadsheet several times per day and
[18:30:43] Jon30: before each write it gets a new access token. So my question is, is there going to be a time when the refresh token would expire and I'd need to generate a new one?
[18:31:36] KensoDev: has joined #RubyOnRails
[18:33:40] shanemcd: has joined #RubyOnRails
[18:35:02] baweaver: has joined #RubyOnRails
[18:35:54] yellow5: has joined #RubyOnRails
[18:37:32] jottr: has joined #RubyOnRails
[18:39:01] RegulationD: has joined #RubyOnRails
[18:39:37] finnnnnnnnnnn: has joined #RubyOnRails
[18:39:38] mustmodify: has joined #RubyOnRails
[18:40:00] aarkerio: has joined #RubyOnRails
[18:40:03] mustmodify: WIth I18n, how do I do "19th" or "2nd" and have that also work for Spanish, if they have similar affects?
[18:40:32] blackmesa: has joined #RubyOnRails
[18:41:24] tubbo: mustmodify: if you start with this locale, it'll do it for you. https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/es.yml#L10-L105
[18:43:04] Limix: has joined #RubyOnRails
[18:44:59] aarkerio: does anybody know a how-to about how to "stream" an API with ActionCable?
[18:47:20] uglybandersnatch: has joined #RubyOnRails
[18:49:30] tubbo: aarkerio: define "stream" an API
[18:50:16] tubbo: frankly, i don't believe there's been any comprehensive documentation written for actioncable yet. too new.
[18:51:53] aarkerio: I supposed that all the idea of ActionCable was to "boost" the speed APIs on rails, but apparently I'm wrong
[18:51:55] agoldboi: has joined #RubyOnRails
[18:52:18] cpruitt: has joined #RubyOnRails
[18:53:05] tubbo: aarkerio: haha not sure how you got that idea...it's meant to send/recv messages asynchronously, in a more reliable fashion than ajax.
[18:53:24] kinduff: thank you arup_r
[18:54:14] flashpoint9: has joined #RubyOnRails
[18:54:55] aarkerio: ok, my mistake, thx tubbo!
[18:58:09] drale2k: i want to detect links posted in my chat and wrap them in <a> tags. Would you detect and save it in hte db as a link or detect it only when display it (reading from the db)
[18:58:25] e: has joined #RubyOnRails
[18:59:14] stannard: has joined #RubyOnRails
[18:59:31] arup_r: jqury-ujs will be for kids when actioncable will around us.. :D
[19:01:02] yellow5: has joined #RubyOnRails
[19:01:05] bronson: has joined #RubyOnRails
[19:02:23] sankaber: has joined #RubyOnRails
[19:02:30] stannard_: has joined #RubyOnRails
[19:02:30] yxejamir: has joined #RubyOnRails
[19:03:53] Console: has joined #RubyOnRails
[19:04:40] greenhat: drale2k: I generally prefer to save the user input unmodified and sanitize/linkify/etc at display time.
[19:06:16] greenhat: drale2k: That gives you a log more flexibility going forward. Perhaps one day you want to export the raw data, or change your linkifier, etc.
[19:06:49] hnanon: has joined #RubyOnRails
[19:07:14] htmldrum: has joined #RubyOnRails
[19:08:08] eggoez: has joined #RubyOnRails
[19:09:25] moeabdol2: has joined #RubyOnRails
[19:10:55] intrigueD: has joined #RubyOnRails
[19:10:55] dtordable: has joined #RubyOnRails
[19:11:00] _bogus_: when running rails c i get this : /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.6.3/lib/spring/server.rb:42:in `initialize': too long unix socket path (112bytes given but 108bytes max) (ArgumentError) .. any ideas on how to fix this?
[19:12:13] Cohedrin: has joined #RubyOnRails
[19:14:08] arup_r: running rails c in local dev machine ?
[19:14:57] smathy: _bogus_, how long is `pwd` for that app?
[19:14:59] dtordable: has joined #RubyOnRails
[19:15:30] baweaver: has joined #RubyOnRails
[19:16:39] rasalghul: has joined #RubyOnRails
[19:18:34] TDJACR: has left #RubyOnRails: ("WeeChat 1.4")
[19:19:29] sonofdirt: has joined #RubyOnRails
[19:21:15] jstransky: has joined #RubyOnRails
[19:23:12] B4daBing73: has joined #RubyOnRails
[19:24:07] jgpawletko: has joined #RubyOnRails
[19:25:00] boontdus`: has joined #RubyOnRails
[19:26:16] LastWhisper____: has joined #RubyOnRails
[19:28:03] mustmodify: tubbo: so based on that, I have to use strftime and then ...
[19:28:05] mustmodify: translate that?
[19:28:06] srinidhi: has joined #RubyOnRails
[19:28:18] shanemcd: has joined #RubyOnRails
[19:30:51] Coldblackice: has joined #RubyOnRails
[19:31:23] shanemcd: has joined #RubyOnRails
[19:32:03] mustmodify: because if I do I18n.locale = :en; I18n.localize( 20.hours.ago, format: 'see you on %a the 5th' )
[19:32:14] mustmodify: I get "see you on n the 5th"
[19:32:16] tubbo: mustmodify: no, you should just need to apply that es.yml locale into your project (just copy it into config/locales), and rails will figure out how to display the date for you.
[19:32:19] mustmodify: so I don't know what that n is.
[19:33:22] DonOtreply: has joined #RubyOnRails
[19:33:52] solars: has joined #RubyOnRails
[19:33:55] baweaver: has joined #RubyOnRails
[19:34:08] mustmodify: Ah... I thought that would be automatically be included.
[19:34:15] norc: _bogus_, quick googling indicates that your project might be nested so deep, that the path to the socket file is too long for the operating system.
[19:34:52] DonOtreply: has joined #RubyOnRails
[19:34:53] norc: _bogus_, also you might want to consider ditching spring entirely since it generally just adds complexity and issues.
[19:35:05] n008f4g_: has joined #RubyOnRails
[19:35:05] _bogus_: sorry guys, yeah the path is a little long, but isnt there a way to get through this ? also, the mysql.sock is located at /var/lib/mysql/mysql.conf
[19:35:39] norc: _bogus_, the issue is not mysql but where your tmp directory of your project resides in.
[19:35:45] Aherin: has joined #RubyOnRails
[19:36:04] tubbo: _bogus_: why is your path so long? also i googled 'too long unix socket path' and the first result was https://github.com/rails/spring/issues/198
[19:36:05] norc: _bogus_, though nvm, spring should actually use your system directory. mmm
[19:36:19] tubbo: interesting how you didn't find that because of course everyone googles before asking others to google for them.
[19:36:21] workmad3: has joined #RubyOnRails
[19:36:36] scope: has joined #RubyOnRails
[19:37:08] norc: tubbo, wait. People trying to assume that their own time is more precious than ours? I don't believe that this could possibly be the case in this channel.
[19:37:34] _bogus_: i found that
[19:37:34] fox_mulder_cp: me start new beta of my panel in rails5 beta3. haha
[19:37:38] _bogus_: but I cant change my path
[19:37:45] _bogus_: so I dont know what to do exactly
[19:37:53] norc: _bogus_, have you even bothered to google and look at the first link at all?
[19:37:55] norc: Honest question.
[19:37:55] theBestNunu: has joined #RubyOnRails
[19:38:02] tubbo: _bogus_: setting $SPRING_TMP_PATH doesn't work?
[19:38:21] sypheren: has joined #RubyOnRails
[19:38:21] fox_mulder_cp: so, about english - can somebody says to me defference 'way' and 'path'?
[19:38:30] _bogus_: at least if i did it right...
[19:38:32] akshat: has joined #RubyOnRails
[19:38:38] norc: fox_mulder_cp, you might want to consider #english for this instead...
[19:38:40] drale2k: greenhat: re chat links. good point
[19:38:44] mustmodify: tubbo: so if my googling is any good, which is obviously a bad assumption, it seems like either other language don't ordanilize their numbers (1st, 2nd, 3rd) or that Rails just doesn't have that incorporated into I18n... do you know which it is?
[19:38:46] SteenJobs: has joined #RubyOnRails
[19:38:59] fox_mulder_cp: norc: really? tthanks
[19:39:08] norc: fox_mulder_cp, yes.
[19:39:24] tubbo: mustmodify: definitely not ordinalizing in the same way. i made a spanish-language site recently.
[19:39:31] drbayer: has joined #RubyOnRails
[19:39:38] tubbo: mustmodify: but we use abbreviated dates mostly, not full sentences.
[19:39:38] norc: fox_mulder_cp, that isnt to say that questions about how to name attributes or classes is wrong here, but if this is about English than that is the place.
[19:40:08] _bogus_: sorry, actually i didnt tried to set $SPRING_TMP_PATH because i dont know what to set it to
[19:40:10] ziyadb: has joined #RubyOnRails
[19:40:18] smathy: _bogus_, you can't change your path on your own dev machine?
[19:40:26] _bogus_: im not in my dev machine
[19:40:30] _bogus_: im in the production server
[19:40:31] fox_mulder_cp: norc: thanks. i reaaly intrested into learn english
[19:40:57] tubbo: _bogus_: i think $SPRING_TMP_PATH can be whatever you want.
[19:41:04] tubbo: maybe try setting it to /tmp/spring
[19:41:13] tubbo: it's just the location of the .sock file
[19:41:29] bga57: has joined #RubyOnRails
[19:41:32] smathy: _bogus_, oh right, spring shouldn't even be running in production.
[19:41:36] tubbo: _bogus_: that said, you're on the production server? then you shouldn't be using spring. in fact, spring shouldn't even be running.
[19:41:52] tubbo: so make sure `gem 'spring'` is inside `group :development`
[19:42:09] smathy: ...and that you have a proper deploy process that excludes non-prod groups.
[19:42:24] smathy: ...and that your prod is actually running in production env.
[19:42:27] _bogus_: yes, i thought that for a moment (im not really sure what spring is for, sorry)
[19:42:31] tubbo: even if you don't exclude non-prod groups, they won't be required in your rails app unless you specifically do so.
[19:42:37] tubbo: like bundler won't let them get required iirc
[19:42:39] _bogus_: but i get this error running rails c production
[19:42:40] norc: _bogus_, in fact just remove spring all together.
[19:42:48] norc: _bogus_, it will save you much pain and nerves in the long run.
[19:43:01] tubbo: _bogus_: if you're not sure what spring is for, my suggestion is not tuse it right now. eventually, you'll find a use for it or whatever replaces it in the future :)
[19:43:10] tubbo: not to use*
[19:43:14] norc: _bogus_, and if you do not even know what spring is, that is another reason you should remove it completely.
[19:43:26] smathy: Whether you use it or not, it's a dev-only tool.
[19:43:31] dtordable: has joined #RubyOnRails
[19:44:05] _bogus_: ok... just removed it and its working now, thanks.. just for the case, I was getting this error when running rails c console , despite it was under group :development on my Gemfile, was I doing anything wrong ?
[19:44:06] smathy: norc, really? You should remove all gems Rails has by default if you don't know what they are?
[19:44:15] smathy: norc, I get that you don't like spring, but that advice is too far.
[19:44:25] norc: smathy, no, but there is 2 gems in particular that should be removed with that reasoning. spring and turbolinks.
[19:44:31] tubbo: _bogus_: that might mean that your "production server" is not running in production.
[19:44:32] smathy: _bogus_, probably your deploy is broken.
[19:44:34] smathy: ...as I said above.
[19:44:35] thorgi: has joined #RubyOnRails
[19:44:38] tubbo: your RAILS_ENV could be not set
[19:44:42] smathy: ...or that.
[19:44:47] tubbo: _bogus_: also, try running `rails c -e production` :)
[19:44:51] tubbo: that should fix it up for ya
[19:45:02] tubbo: i have to do that on my prod servers and it always throws me for a loop :)
[19:45:22] _bogus_: yes, actually my deploy is a mess.... Ive spent two days configuring server, and trying to deploy using capistrano
[19:45:29] smathy: norc, I have no problem with *that* advice :)
[19:45:45] _bogus_: couldnt use capistrano after all, then I cloned the git repo inside the production server's folder
[19:45:47] smathy: _bogus_, why are *you* doing this? You clearly don't know what you're doing.
[19:45:47] tubbo: _bogus_: were you the guy coming in here a while ago trying to use cpanel?
[19:45:51] _bogus_: and its "running" with a lot of error
[19:46:05] unknown__: i like heroku that is why
[19:46:17] _bogus_: i like it too but the client insisted to deploy it to his server.
[19:46:22] _bogus_: which had no support for rails.
[19:46:26] tubbo: _bogus_: then push back.
[19:46:27] _bogus_: really a mess.
[19:46:29] smathy: _bogus_, a production app is not the right place to be dicking around, just use heroku unless/until you know what you're doing.
[19:46:32] dtordable: has joined #RubyOnRails
[19:46:47] defsdoor: has joined #RubyOnRails
[19:47:05] tubbo: the client doesn't get to decide how i deploy and write my software. they only get to decide what is IN my software.
[19:47:12] smathy: _bogus_, if the client insists then explain that it's not your area of expertise, so he should find a good devops guy to assist you.
[19:47:26] unknown__: I took 4 days to set up a server in EC2.. and 2 days to fix Cap deploy.
[19:47:31] Radar: GOOD MORNING
[19:47:36] norc: smathy, hehe - I personally love turbolinks though, but then again like basecamp my rails projects are mainly just simple crud tools. ;-)
[19:47:49] smathy: norc, I love it too, and I love spring too.
[19:47:56] jottr_: has joined #RubyOnRails
[19:48:08] Limix: has joined #RubyOnRails
[19:48:11] smathy: ...but yes, both minefields for newbies.
[19:48:20] _bogus_: i wish... but its very complicated... anyway, i believe that if I can create a temporary user using rails c he'll stop bothering me for the next days so I have time to configure capistrano right
[19:48:26] stannard: has joined #RubyOnRails
[19:48:32] tubbo: Radar: get out
[19:48:36] _bogus_: then he can test the app
[19:48:57] tubbo: _bogus_: you'll get no sympathy out of me :) political problems are out of scope for this channel.
[19:49:00] smathy: _bogus_, and later the hackers can really test it for both of you.
[19:49:09] _bogus_: tubbo, no problem
[19:49:36] chouhoulis: has joined #RubyOnRails
[19:50:07] norc: smathy, does spring work with better_errors nowadays by the way? Because that was the final nail in the coffin why I ditched it back then.
[19:50:27] thorgi: has joined #RubyOnRails
[19:50:37] Aherin: has joined #RubyOnRails
[19:51:07] delgiudices: has joined #RubyOnRails
[19:51:27] tubbo: norc: better_errors is unnecessary nowadays :)
[19:51:49] tubbo: at least i don't find it necessary, now that rails' own error pages are better
[19:52:02] tubbo: only thing is you get that console but i don't really use it that often anyway
[19:52:19] mustmodify: has left #RubyOnRails: ()
[19:52:32] mustmodify: has joined #RubyOnRails
[19:53:12] mustmodify: weird. I have on: 'on' in my config/locales/en.yml file, and then fon: 'on' just for a test, right under it. I18n.translate(:on) fails, but I18n.translate(:fon) succeeds. Reserved word?
[19:53:40] adaedra: mustmodify: surely a YAML boolean value. Try `'on': 'on'`.
[19:53:53] smathy: norc, works, but I never experienced it not working.
[19:54:06] smathy: tubbo, I use the console all the time.
[19:54:16] mustmodify: adaedra: hm... boolean keys...
[19:54:31] mustmodify: adaedra: that worked, thanks.
[19:54:34] adaedra: Technically valid.
[19:54:51] tubbo: smathy: i usually reproduce what happens within a test and solve from there, easier to use imho
[19:54:59] tubbo: but my style is tests > irb
[19:55:12] flashpoint9: has joined #RubyOnRails
[19:55:49] smathy: Yeah, I'm the other way around.
[19:55:58] ericmeds: has joined #RubyOnRails
[19:56:13] norc: smathy, about a year ago it was so broken that spring wouldnt even start.
[19:56:29] n1lo: has joined #RubyOnRails
[19:56:35] smathy: norc, must have been short lived, I never noticed.
[19:56:46] smathy: norc, definitely doesn't still exist.
[19:57:42] norc: smathy, just found the issue it was from 2014 - the issue is still open but idk. It lasted at least about half a year.
[19:57:58] Palsson: has joined #RubyOnRails
[20:03:25] Guest34101: has joined #RubyOnRails
[20:03:57] delgiudices: How do you select an option with capybara acceptance test?
[20:05:17] delgiudices: select 'value' does it ..
[20:05:46] mwcmitchell: has joined #RubyOnRails
[20:07:55] Rubie: has joined #RubyOnRails
[20:08:58] Macaveli: has joined #RubyOnRails
[20:10:58] digitalcakes: has joined #RubyOnRails
[20:11:17] DoctorMonocular: has joined #RubyOnRails
[20:11:26] wldcordeiro: has joined #RubyOnRails
[20:11:31] DonOtreply_: has joined #RubyOnRails
[20:12:01] kristofferR: has joined #RubyOnRails
[20:12:46] mices: has joined #RubyOnRails
[20:13:15] LastWhisper____: has joined #RubyOnRails
[20:13:23] mices: how can i most easily compare my development environments on 2 machines where my app works on one machine but not on the other?
[20:14:36] norc: mices, make sure you use a deployment process that automates as much as possible.
[20:14:44] norc: That way you will prevent any configuration drifts.
[20:15:28] norc: mices, vagrant is the obvious ideal candidate if you want perfect reproducable development environments.
[20:15:46] mices: it's installed at the gem or os level?
[20:17:08] norc: mices, its an external software that is basically an abstraction of virtualization software, though tools like capistrano can work with this.
[20:17:28] mices: gem list returned more gems than were in the gemfile so i installed every gem from gem list output on one machine to the other, i guess that's really doing it the hard way, and it didn't even fix the problem
[20:17:53] norc: mices, make sure you invoke all rails and rake related commands with bundle execute on all machines.
[20:18:01] matthias_: has joined #RubyOnRails
[20:18:02] norc: mices, that would be my first guess as to why they behave differently.
[20:18:18] norc: But its hard to say without more details.
[20:18:18] mices: someone told me i should never have to run anything but bundle install
[20:18:25] norc: mices, they lied.
[20:18:46] mices: ok so run `bundle execute` ?
[20:18:52] norc: mices, when you start the rails server, use "bundle exec rails s". if you start the rails console, use "bundle exec rails c"
[20:19:00] norc: If you run a rake task, use "bundle exec rake db:create"
[20:19:41] norc: (Most people create a shell alias for be=bundle exec to save some time typing)
[20:21:37] tubbo: mices: the issue is that `which rake` might not point to the binstub that you think it's pointing to. this is a combo of the order of $PATH and your ruby environment.
[20:21:51] tubbo: mices: so `bundle exec` ensures that the 'rake' command is coming from $YOUR_BUNDLE/bin
[20:21:55] tubbo: rather than e.g. /usr/bin
[20:22:17] tubbo: before bundler, it was a crapshoot to know where the code was coming from! :D
[20:24:18] Davey: has joined #RubyOnRails
[20:24:18] Davey: has joined #RubyOnRails
[20:24:27] norc: tubbo, vagrant to the rescue!
[20:24:47] tubbo: i'd rather use chroot jails
[20:29:54] mices: tubbo: ty
[20:30:11] aarkerio: why not Docker?
[20:30:29] tubbo: aarkerio: heh that's a little more than a simple chroot jail, but yeah same idea.
[20:30:44] tubbo: either way, all of this shit is unnecessary if you have command over $PATH and your shell...
[20:31:03] tubbo: rails makes local dev really simple
[20:31:23] IFrank00: has joined #RubyOnRails
[20:32:18] aarkerio: ha, I just found that some people dislike docker: boycottdocker.org
[20:32:58] tubbo: i mean, there's always people who dislike something
[20:33:24] tubbo: aarkerio: doesn't work with no-www lol
[20:33:52] algernop_k: Why not rbenv or rvm?
[20:33:55] tubbo: what a terrible site and furthermore it doesn't even work
[20:34:21] aarkerio: ha, ha, it's very easy to setup the redirect
[20:34:50] aarkerio: well, I just found it but sounds this sounds like an argument: "DockerOS is not UNIX-like OS. All you default standard commands like ps, ls, find, netstat, sockstat, tail and similar are useless here. You have to learn all that bunch of yet another new commands with totally different behaviour."
[20:35:11] chipotle: has joined #RubyOnRails
[20:35:27] aarkerio: I never used Docker so, I can't say
[20:35:54] norc: aarkerio, docker solves another issue - it is not an alternative to vagrant, but it can certainly complement it
[20:36:13] norc: (Vagrant has full support for dockers for a while now)
[20:36:26] mices: running bundle exec rails s didn't fix the error
[20:36:26] baweaver: has joined #RubyOnRails
[20:36:33] norc: mices, on both servers.
[20:36:43] tubbo: mices: !dw
[20:36:43] helpa: mices: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[20:36:45] norc: mices, how about you tell us what the issue is.
[20:36:46] mices: no only on one
[20:37:06] flashpoint9: has joined #RubyOnRails
[20:37:13] norc: Congratulations. You have now demonstrated that executing different commands on different servers yields different results, while still neglecting to tell us what your issue is.
[20:37:25] mices: farraday::connectionfailed in devise connection refused connect(2) for localhost port 9200
[20:37:46] mices: oh wait i have to start elasticsearch
[20:37:51] mices: then i'll get the transport error
[20:38:05] norc: ACTION goes back doing productive things
[20:38:18] norc: Like fixing an actual Ruby bug.
[20:38:47] aarkerio: mices: do you get the same string with "md5sum Gemfile.lock" on both servers?
[20:38:56] pwnd_nsfw: has joined #RubyOnRails
[20:39:50] norc: aarkerio, you missed the part where he has yet to provide the actual error with a stack trace, or prepend his commands with bundle exec on *both* servers.
[20:39:56] norc: Let him present his error first.
[20:40:05] lemur: has joined #RubyOnRails
[20:40:42] tubbo: mices: !gist
[20:40:42] helpa: mices: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[20:41:11] mices: i'm gonna dc and rejoin on the laptop
[20:43:20] mices: aarkerio: yes, the same
[20:44:01] mices: has left #RubyOnRails: ("Leaving")
[20:46:54] andywww: has joined #RubyOnRails
[20:47:41] mices: has joined #RubyOnRails
[20:47:48] mices: https://gist.github.com/mices/f6835d6e4febab6da1ea
[20:47:59] PedramT: has joined #RubyOnRails
[20:48:42] andywww: I’m using devise to create my users but I need to apply a default account type to the users once they have been created. So far I have the following but it feels clunky. Is there a better way t do this? https://gist.github.com/anonymous/d2826941ca96e760160c
[20:48:52] norc: mices, now make sure that you have used "bundle exec" on both machines. If the behavior is still different we can continue.
[20:49:14] tubbo: mices: that has absolutely nothing to do with rails or ruby.
[20:49:32] tubbo: it's an elasticsearch error.
[20:50:23] chouhoulis: has joined #RubyOnRails
[20:50:56] norc: tubbo, I didnt expect this to do anything, but have him consider that if he notices configuration drift, that using different commands on different machines is not a great start to begin with.
[20:51:00] tubbo: probably due to a missing index.
[20:51:36] capin: has anyone run into an issue using vanilla devise along with solidus in a rails app? I came across this, https://github.com/solidusio/solidus/issues/681#issuecomment-175123447
[20:51:39] rodferso1: has joined #RubyOnRails
[20:52:36] adac: has joined #RubyOnRails
[20:53:27] ur5us: has joined #RubyOnRails
[20:54:28] arup_r: andywww: nothing wrong in the code..
[20:54:49] mary5030: has joined #RubyOnRails
[20:54:53] Xentil: has joined #RubyOnRails
[20:56:47] arup_r: only thing, you can chance return the Account object rather than the id.
[20:57:57] andywww: like this? account_type = AccountType.find_by_name("Free")
[20:58:47] arup_r: and the extract information from the object when you need
[20:59:08] B1n4r10: has joined #RubyOnRails
[20:59:20] andywww: cool, thanks
[20:59:29] aegis3121: has joined #RubyOnRails
[21:00:38] chocoelho: has joined #RubyOnRails
[21:01:09] new_bruins: has joined #RubyOnRails
[21:01:16] johnflux: has joined #RubyOnRails
[21:01:47] djbkd: has joined #RubyOnRails
[21:02:58] tubbo: they see me forkinnnnnnnnnnn
[21:03:00] tubbo: they hatinnnnnnnnnnnn
[21:05:58] algernop_k: patrollin' they tryin' to catch me violating their license
[21:06:00] zave: has joined #RubyOnRails
[21:07:03] shanemcd_: has joined #RubyOnRails
[21:07:39] hangelo: has joined #RubyOnRails
[21:09:20] mices: has joined #RubyOnRails
[21:11:03] zave: has joined #RubyOnRails
[21:12:34] mdw: has joined #RubyOnRails
[21:12:46] Maletor: has joined #RubyOnRails
[21:12:56] FernandoBasso: has joined #RubyOnRails
[21:13:13] mices: has joined #RubyOnRails
[21:13:23] enkristoffer: I'm getting an "undefined method `markdown_changed?'" error even though I'm including ActiveModel::Dirty in my model. Am I using it wrong? https://gist.github.com/sachse/d0a071e4180925a3821b
[21:14:13] tubbo: enkristoffer: yeah it's kind-of a strange api...but the idea is that method doesn't exist on the class-level, and by calling it there you are implicitly trying to call it on the class as a class method
[21:14:33] nerium: has joined #RubyOnRails
[21:14:45] tubbo: enkristoffer: so what you need to do is say if: :markdown_changed?, that passes a symbol in so rails can just do send(the_symbol_you_passed_into_if) to call the method on the callback.
[21:14:59] tubbo: e.g., where it's supposed to be called, on the instance and during the callback lifecycle.
[21:16:50] enkristoffer: Oh I see. Thanks tubbo!
[21:17:01] baweaver: has joined #RubyOnRails
[21:20:26] Palsson: has joined #RubyOnRails
[21:21:13] mices: how can i reverse the damage from running `bundle exec rake`
[21:22:21] sypheren: has joined #RubyOnRails
[21:22:28] mices: after doing that i get a gem missing error (json 1.8.3) but it wants sudo privs to install it so something's wrong
[21:22:38] mdw: has joined #RubyOnRails
[21:23:08] gr1m_: has joined #RubyOnRails
[21:24:51] shanemcd: has joined #RubyOnRails
[21:25:43] gr1m-_: has joined #RubyOnRails
[21:26:14] tubbo: mices: usually that happens because bundler can't figure out what your $GEM_HOME is set to. happens to me when i move from one rails app dir to the other
[21:26:17] tubbo: sometimes
[21:26:32] tubbo: because my shell thinks `bundle` is at $MY_OTHER_RAILS_APP/vendor/bundle/bin/rails
[21:26:49] tubbo: but i really want it to be from `$CURRENT_RAILS_APP/bin/bundle` for example
[21:27:17] mices: so a file in my app's root directory should configure bundler?
[21:27:34] mices: or my shell config file in my home directory?
[21:28:29] DoctorMonocular: has joined #RubyOnRails
[21:28:38] intrigueD: has joined #RubyOnRails
[21:30:16] rooose: has joined #RubyOnRails
[21:31:13] bedouin_: has joined #RubyOnRails
[21:32:07] tubbo: mices: no that's not what i was saying at all.
[21:32:25] yos7ph: has joined #RubyOnRails
[21:32:34] tubbo: mices: `which bundle` should be pointing to your rails app's bin/bundle.
[21:32:39] tubbo: if it's not, that's your problem
[21:34:05] DonOtreply: has joined #RubyOnRails
[21:35:57] sypheren: has joined #RubyOnRails
[21:36:03] yos7ph_: has joined #RubyOnRails
[21:37:10] n008f4g_: has joined #RubyOnRails
[21:37:29] hahuang65: has joined #RubyOnRails
[21:38:51] mustmodify: and what a problem it is.
[21:41:40] mices: tubbo: ty
[21:42:43] mices: mustmodify: https://gist.github.com/mices/f6835d6e4febab6da1ea
[21:47:03] mices: o sorry thought asked what it was
[21:48:51] new_bruins: hello everyone
[21:51:19] chouhoulis: has joined #RubyOnRails
[21:57:39] htmldrum: has joined #RubyOnRails
[21:59:43] frozenfoxx: has joined #RubyOnRails
[22:01:46] frozenfoxx: Question, I'm needing to build a Angular on Rails applicaiton that gets and receives updates over a websocket client to a websocket server I've created. Would anyone be able to point me at a tutorial or example of something like this? I'm thinking about using Rails 4 since it's stable and am new to this sort of thing, so it sounds like I need to include websocket-rails as a client in a model and have updates from it pushed to the Angular view v
[22:02:41] frozenfoxx: If I've got that heinously wrong please correct me, I just want to make sure I'm headed down the right path
[22:03:50] SteenJobs: has joined #RubyOnRails
[22:03:56] P4Titan: has joined #RubyOnRails
[22:03:58] P4Titan: has left #RubyOnRails: ()
[22:04:30] norc: frozenfoxx, if you want to rely on a gem for websockets that has not received a single commit in over 2 years, be my guest.
[22:04:56] uglybandersnatch: has joined #RubyOnRails
[22:05:16] frozenfoxx: norc: is there a better way? ActionCable looks great but I didn't think Rails 5 was stable yet
[22:05:51] norc: frozenfoxx, well Rails 5 is already used in production on basecamp 3
[22:05:57] norc: So it cant be that bad.
[22:06:28] norc: frozenfoxx, and chances are that if you start developing now, by the time you go into production rails 5 will be stable.
[22:06:43] frozenfoxx: norc: about four weeks from now?
[22:07:16] frozenfoxx: It's actually a very, very simple application, the heavy lifting is already done with the websocket server.
[22:07:43] drbayer: has joined #RubyOnRails
[22:07:55] norc: frozenfoxx, this is just an educated guess, but if you just want to do simplistic things, you should be fine with rails 5.
[22:08:34] frozenfoxx: norc: alrighty, I'll see if I can find something on standing up applications with Rails 5. The guides I'm seeing are for Heroku and this needs to be local.
[22:08:42] frozenfoxx: norc: thanks for your advice!
[22:09:26] sypheren: has joined #RubyOnRails
[22:11:09] norc: frozenfoxx, make sure you keep an eye on this: https://github.com/rails/rails/issues
[22:12:46] mices: has joined #RubyOnRails
[22:13:30] moeabdol3: has joined #RubyOnRails
[22:13:40] mices: i get this error from devise https://gist.github.com/mices/fc173d6073338e673865
[22:14:01] mices: it's nothing in my app, something in my system
[22:14:09] mices: cause it works on another machine
[22:14:45] norc: mices, did you bother to look at the error?
[22:15:16] norc: Then please tell me what conclusion you have arrived at.
[22:15:32] Radar: How do you stop your team from going "this new model I want to add is _almost_ like this other model, so I'm just going to add a flag to the original model and then some extra fields?"
[22:15:45] Radar: i.e. we have an advert model and people want to add events to that model, but events are not adverts because events have occurrences.
[22:15:52] norc: Radar, fire them?
[22:15:52] Radar: I need something more than "I have a bad feeling about this."
[22:15:57] mices: norc: connection refused
[22:16:12] norc: mices, I was taught to read.
[22:16:28] tubbo: Radar: tell them to read http://www.sandimetz.com/blog/2016/1/20/the-wrong-abstraction
[22:16:44] tubbo: it's better to not have an abstraction than to create the wrong abstraction, basically.
[22:16:44] norc: Radar, on a more serious note, don't tell them how they are wrong.
[22:17:05] Papierkorb: Radar: TL;DR "Do one thing and do it well" ?
[22:17:11] tubbo: mices: means it can't connect
[22:17:37] mices: what's supposed to running on 9200?
[22:17:45] norc: mices, you tell us.
[22:17:48] norc: mices, its your software.
[22:18:12] jenrzzz: has joined #RubyOnRails
[22:18:36] smathy: Radar, physical violence is usually best.
[22:18:57] Radar: smathy: I'm WFH this morning
[22:18:58] norc: Especially when applied to their relatives.
[22:19:06] norc: The Sopranos shows how effective that is.
[22:19:10] Radar: is mices trolling again
[22:19:13] smathy: Radar, damnit, don't have a drone by any chance do you?
[22:19:16] HalcyonicStorm: me is WFH tomorrows
[22:19:24] mustmodify: Radar: In the past I have focused on how the interfaces are different.
[22:19:24] smathy: ACTION wfh always
[22:19:24] Radar: HalcyonicStorm: omg twinsies
[22:19:32] HalcyonicStorm: ACTION does the twinsies dance
[22:19:39] norc: Radar, I take it he is a regular troll or really lazy person_
[22:19:50] smathy: Radar, SRP.
[22:20:01] mices: norc: my previos mistake was installing elasticsearch on my system, i removed it and installed the gems, i shouldn't have to run `service start elasticsearch` anymore (i don't think)
[22:20:21] HalcyonicStorm: Radar: looks a lot like this https://youtu.be/o-50GjySwew?t=44s
[22:20:22] smathy: HalcyonicStorm, weren't you twinsies with someone yesterday too? tubbo IIRC.
[22:20:34] mices: norc: i never should have in the first place
[22:20:40] smathy: "Prancercise" :)
[22:21:05] smathy: Go the camel toe.
[22:21:10] norc: mices, professional rails developers cost between 50-200EUR per hour. If you want people to basically fix your stuff for you, be ready to pay for it. That is my final word on your "issues".
[22:21:16] Radar: norc: !since mices
[22:21:21] mustmodify: Radar: In fact I tend to believe what one of my high school teachers said: "Once is an accident, twice is a coincidence, three times is a pattern."
[22:21:34] Radar: norc: I'd expect a better debugger / programmer by now
[22:22:04] mustmodify: Radar: So I typically wait for a clear pattern, something happening three times, before I'll create an abstraction or an interface.
[22:22:07] mices: been busy migrating to laptop for a month and a half
[22:22:17] Jasaka: has joined #RubyOnRails
[22:22:33] Radar: mustmodify: This is the third time. We have adverts which already have fields from "events" in it. Now we're adding something else called "services" and they want to use the adverts table too.
[22:22:39] Radar: It's breaking my brain.
[22:22:59] chipotle: has joined #RubyOnRails
[22:23:05] norc: Radar, based on experience I learned that time has nothing to do with whether someone is good at coding. Especially when they somehow manage to sell "results" to managers with ties for years.
[22:23:30] norc: I mean my rails experience is meh, but at least I dont brag about it. :S
[22:24:08] Papierkorb: Radar: Somthing in me is yelling for a document oriented solution (<3 JSONB columns). But I'm also lacking context and like 10yrs of web-dev experience :P
[22:26:38] dextertzu: has joined #RubyOnRails
[22:27:15] kinduff: has joined #RubyOnRails
[22:28:16] finnnnnnnnnnn: has joined #RubyOnRails
[22:29:50] mustmodify: has left #RubyOnRails: ()
[22:31:09] HalcyonicStorm: smathy: yeah well I come from a big family
[22:32:19] B1n4r10: has joined #RubyOnRails
[22:34:16] DoctorMonocular: has joined #RubyOnRails
[22:39:11] waldi_: has joined #RubyOnRails
[22:39:39] hoodow: has joined #RubyOnRails
[22:40:32] RegulationD: has joined #RubyOnRails
[22:51:31] Haydos: Hey guys, when I'm trying to deploy via jenkins I keep getting NoMethodError: undefined method `bytesize' for nil:NilClass when running bundle exec rake assets:precompile RAILS_ENV=staging. Any tips on how to start debugging this? It seems to get through all our images then crashes. It works locally and in development environment.
[22:52:27] fox_mulder_cp: staging env - non standart.
[22:52:36] SteenJobs: has joined #RubyOnRails
[22:52:40] fox_mulder_cp: defaults - are development and production
[22:52:49] Haydos: and we have staging that works every other day of the week.
[22:53:30] chouhoulis: has joined #RubyOnRails
[22:53:43] pawnbox: has joined #RubyOnRails
[22:55:44] pramsky: has joined #RubyOnRails
[22:56:43] sypheren: has joined #RubyOnRails
[22:57:36] mices: has joined #RubyOnRails
[22:57:45] mices: has joined #RubyOnRails
[22:57:52] mices: when i google this error i see talk about elasticsearch service not running, however on the elasticsearch-rails github page they say nothing about installing elasticsearch as a service on the host, it just says to run `gem install elasticsearch-model elasticsearch-rails`
[22:58:36] Radar: norc: re: earlier comments: is it 10 yrs experience, or the same 2 years of experience 5 times?
[22:59:13] slash_nick: or 2 years worth of experience packed into 5?
[22:59:23] uglybandersnatch: has joined #RubyOnRails
[22:59:55] moses: ok so I have 4 static ish pages and I have generated these pages using a controller, I have selected the root of my site in the routes.rb. The problem im having is im trying to route every static page to use the layout I have in views...what am i doing wrong?
[23:00:40] moses: currently the only page that uses the layout is the page i select as my root, but I want all my pages routed like that
[23:02:20] moses: can someone possibly point out a tutorial that shows how to do this?
[23:06:13] slash_nick: moses: the layout you're probably talking about is the application layout... it's the one that application controller goes for by default. how are you routing the requests for the static pages? to a controller that inherits from ApplicationController?
[23:07:38] slash_nick: care to gist the controller that's rendering your static page?
[23:07:39] moses: my static pages controller inherits from the application controller
[23:08:03] maxdoubt: has joined #RubyOnRails
[23:08:20] slash_nick: moses: and you haven't specified an alternative layout for that controller? (i'm assuming you're wanting the views to render inside the application layout)
[23:08:32] maxdoubt: anybody used typescript and angular2 in rails asset pipeline, trying to figure out how to get that all setup… would i use bower for this?
[23:09:16] slash_nick: maxdoubt: we use ember, but we deploy it separate from rails
[23:09:23] moses: I have one actually, but from what I have read in the literature it should take on the app layout if nothing is specificed. Also I did try to put a command for it into the controller but nothing happened so im not sure what exactly is going on
[23:09:26] SteenJobs: Radar: that’s why i never understand when job descriptions ask for ‘x’ number of years experience, without specifiying avg hr/day
[23:09:27] moses: https://gist.github.com/rlh1985/2d5292802d5554488028
[23:09:39] slash_nick: SteenJobs: or problems solved per hour
[23:09:51] aarkerio: has joined #RubyOnRails
[23:09:53] moses: i was trying to understand what happens in the terminal in terms of rendering but I couldnt follow
[23:10:19] SteenJobs: slash_nick: haha bingo
[23:10:33] baweaver: has joined #RubyOnRails
[23:10:36] slash_nick: moses: yeah, that should be reaching for the application layout
[23:10:44] slash_nick: can i see the application controller to confirm that?
[23:11:48] moses: https://gist.github.com/rlh1985/e554524d61bd27d805d5
[23:11:55] moses: is it ok for me to be making these tiny gists?
[23:11:59] moses: will they get mad at me?
[23:12:36] slash_nick: you can always add more files to an existing gist
[23:12:47] slash_nick: but no, no one would get mad
[23:12:58] wolfravenous: has joined #RubyOnRails
[23:14:07] slash_nick: well, moses... i've got no idea why it's not rendering within any layout. are you _sure_ it's not? compared html from both responses? (the one that works and one that doesn't)
[23:15:13] moses: i absolutely have
[23:15:24] moses: its definitely not loading the css and js
[23:15:29] moses: im so confused
[23:15:56] moses: the only thing i can tell you is that the page that i select as the root IS rendering
[23:18:03] moses: ActionController::RoutingError (No route matches [GET] "/css/business-casual.css"):
[23:18:11] moses: is that condusive to a problem
[23:18:17] moses: i found that in my terminal
[23:19:28] Jon30: Does anybody have experience with google_drive gem? I had to switch from key.p12 authentication cause suddenly it stopped working. So I switched to another method: I used client_id and client_secret to generate a refresh token (manually via user interaction). Now I added client_id, client_secret and the refresh token into my app which writes into a spreadsheet several times per day and
[23:19:28] Jon30: before each write it gets a new access token. So my question is, is there going to be a time when the refresh token would expire and I'd need to generate a new one?
[23:21:27] htmldrum: has joined #RubyOnRails
[23:21:49] weaksauce: moses gist your templates
[23:22:29] moses: should the templates matter in terms of routing though?
[23:22:33] trinaldi: has joined #RubyOnRails
[23:22:46] moses: one second please
[23:23:52] slash_nick: moses: well, that tells me there's some weird stylesheet_include_tags or <link> tags in your layout
[23:24:09] weaksauce: mainly because you have no route that matches /css/business-casual.css
[23:24:18] weaksauce: but that's not where assets go
[23:24:31] weaksauce: should be in assets/stylesheets/business-casual.css
[23:24:42] moses: https://gist.github.com/rlh1985/b5860a6ea10695ae667e
[23:24:45] slash_nick: should be looking in* as well
[23:25:07] moses: it is in style sheets
[23:25:09] weaksauce: and if you are using the asset pipeline it will concat those together.
[23:25:12] slash_nick: moses: switch your <link> tags to stylesheet_link_tags... you'll learn a bit along the way
[23:25:13] helpa: http://guides.rubyonrails.org/asset_pipeline.html - The Asset Pipeline Guide by Ryan Bigg, Richard Hulse & Mohammad Typaldos
[23:25:25] weaksauce: moses ^ worth reading to understand what's up
[23:26:23] weaksauce: moses because the stylesheets are modified and compiled and concatenated and has a cache hash it's how the system works.
[23:27:36] weaksauce: moses you can setup your nginx proxy or whatever is hosting it to serve /css/ statically if you want but it's better to use the pipeline
[23:28:12] moses: I will absolutely use the pipeline
[23:28:48] hahuang65: has joined #RubyOnRails
[23:29:11] mines999: has joined #RubyOnRails
[23:29:28] Trynemjoel: has joined #RubyOnRails
[23:30:11] nettoweb: has joined #RubyOnRails
[23:31:55] moses: let me read how this works from that link then we will discuss further
[23:33:59] mines999: has left #RubyOnRails: ()
[23:35:34] Trynemjoel: has joined #RubyOnRails
[23:35:46] blackmesa: has joined #RubyOnRails
[23:36:50] Radar: yes please read the guide that I spent valuable time writing
[23:37:07] Radar: And then others spent even more valuable time updating and fixing my mistakes
[23:37:57] snowy: has joined #RubyOnRails
[23:38:54] Jake232: has joined #RubyOnRails
[23:40:42] wolfravenous: I am trying the impossible I know, I am trying to build an app on Rails 4 using and old Rails 1.2 Tutorial (the classic Rolling with Ruby on Rials Recipe Book tutorial) and I have a snippet of code here http://pastie.org/10755555 that gives the error “Couldn't find Block with 'id'=all” Could someone help me revise that code snippet to work in Rails 4?
[23:41:26] 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
[23:41:35] Haydos: wolfravenous, why are you following a rails 1.2 tutorial?
[23:42:46] Radar: wolfravenous: You will do much better following a more up to date tutorial.
[23:43:08] wolfravenous: Haydos: It is the only tutorial that I can find that creates a web database app like the recipe book. All the new Rails 4 tutorials I have came across build stores, blogs, social net stuff
[23:43:33] Devalo: has joined #RubyOnRails
[23:43:36] Haydos: what do you mean? Stores, blogs and social networks are all web apps that use databases
[23:43:37] Radar: wolfravenous: what's your GH username?
[23:44:30] wolfravenous: I need a tut to help me build a data base app for scheduling teachers, students, blocks and topics… like the recipe book.
[23:44:40] wolfravenous: Radar: it is also wolfravenous
[23:44:55] baweaver: wolfravenous: the point of a tutorial is not to prepackage an app for you
[23:45:04] baweaver: it's to teach concepts that help you figure such things out yourself.
[23:45:37] Radar: wolfravenous: check your email and then follow instructions in https://github.com/rubysherpas/rails_4_in_action
[23:45:40] moses: is the assets path stored in a file anywhere on my project?
[23:45:46] moses: or is that in rails itself?
[23:45:51] Radar: "assets path"?
[23:46:05] moses: assets search path
[23:46:23] wolfravenous: baweaver: I understand and I have been figuring out my model logic, etc. using rails guides.org, just wanted a tutorial to help me put it all together.
[23:46:37] wolfravenous: Radar: Thanks!
[23:46:40] Radar: moses: Section 2.2.1 in the assets guides explains that.
[23:47:34] wolfravenous: Radar: was there a typo in that link it is returning me a 404 not found?
[23:47:34] news_bruin: has joined #RubyOnRails
[23:47:43] Radar: wolfravenous: You need to accept the invitation in your email first.
[23:47:58] moses: i know im reading that now, but i just wondered if there was somewhere in my app that the guide didnt say
[23:48:20] Radar: moses: If you've configured assets.paths then yes it would look somewhere else.
[23:48:28] wolfravenous: Radar: Thanks reading email now :)
[23:48:42] bricker: has joined #RubyOnRails
[23:48:50] smathy: ...something ALSO in the assets guide.
[23:49:59] wolfravenous: Radar: Thank you so much for sharing the reference!
[23:50:06] Radar: wolfravenous: no worries :)
[23:51:19] moses: Radar: actually i was talking about the actual path that rails was using currently instead of typing in the console to find it
[23:51:34] Radar: moses: app/assets, lib/assets, vendor/assets.
[23:51:56] Radar: as 2.2.1 says
[23:54:06] Ropeney: has joined #RubyOnRails
[23:54:13] moses: slash_nick: you around?
[23:54:18] chouhoulis: has joined #RubyOnRails
[23:55:04] moses: weaksauce: you around?
[23:55:31] weaksauce: moses what's up
[23:55:42] moses: so i got to the part where i think i found what was wrong
[23:55:49] moses: and slash_nick was eluding to it
[23:55:54] moses: my call tags to load the ss and js
[23:55:57] moses: are incorrect
[23:56:02] arthropododo: has joined #RubyOnRails
[23:56:19] intrigueD: has joined #RubyOnRails
[23:56:22] moses: so this asset pipeline doc has new tags to use
[23:56:31] moses: condusive to the assets i have set in my app
[23:56:38] weaksauce: you need to move your css and use a helper function to get to where rails has it
[23:56:49] tetraktys: has joined #RubyOnRails
[23:56:55] moses: correct i see that now
[23:57:09] moses: do i just use a general tag
[23:57:13] moses: for the entire asset load?
[23:57:22] moses: <%= stylesheet_link_tag "application", media: "all" %>
[23:57:27] moses: like that
[23:57:49] weaksauce: usually that's in the layout
[23:58:07] helpa: The enter key is not spacebar. Please do not abuse it.
[23:58:26] tetraktys: So I ran in to something weird in ruby 2.3.0. to_yaml results in a binary file to be prefixed with !binary, which used to be the standard, but in the most recent yaml spec http://yaml.org/spec/1.2/spec.html binary should have two bangs prepended. Now my cloud-init config won't load... Any thoughts?
[23:59:01] moses: oh you are right
[23:59:04] moses: so essentially
[23:59:10] moses: I can get rid of all those links?
[23:59:19] moses: in my templates
[23:59:32] moses: to the js and css
[23:59:34] Radar: moses: !enter
[23:59:34] helpa: moses: The enter key is not spacebar. Please do not abuse it.
[23:59:35] weaksauce: and then if you put all your css inside the application css file you will require all the different files you want added into the application.css file