« Back to channel list

#RubyOnRails - 06 June 2016

« Back 1 day Forward 1 day »
[00:01:01] roamingdog: has joined #RubyOnRails
[00:02:10] rubyonrails593pr: has joined #RubyOnRails
[00:02:35] rubyonrails593pr: somebody please asssist
[00:02:58] rubyonrails593pr: i need to integrate my bootstrap css and js files in rails project
[00:03:15] rubyonrails593pr: where to place them, how to require them
[00:04:20] macsteps: has joined #RubyOnRails
[00:04:21] rroyal: has joined #RubyOnRails
[00:06:50] macsteps: has joined #RubyOnRails
[00:09:20] prudhvi: has joined #RubyOnRails
[00:10:19] prudhvi: can somebody pleases tell me where to place bootstrap css and js files in rails app
[00:10:37] benlieb: has joined #RubyOnRails
[00:11:58] crystal77: has joined #RubyOnRails
[00:14:15] bmorrison: has joined #RubyOnRails
[00:19:08] DTZUBDUB: has joined #RubyOnRails
[00:20:00] SteenJobs: has joined #RubyOnRails
[00:21:35] rroyal: has joined #RubyOnRails
[00:24:00] smathy: has joined #RubyOnRails
[00:24:22] lightt: has joined #RubyOnRails
[00:24:55] speakingcode: has joined #RubyOnRails
[00:25:45] duncannz: has joined #RubyOnRails
[00:26:02] roamingdog: has joined #RubyOnRails
[00:26:31] sumobob: has joined #RubyOnRails
[00:27:13] N1njturt1e: has joined #RubyOnRails
[00:34:07] jerematic: has joined #RubyOnRails
[00:37:52] macsteps: has joined #RubyOnRails
[00:38:54] triptec: has joined #RubyOnRails
[00:38:55] dblessing: has joined #RubyOnRails
[00:39:54] jancel: has joined #RubyOnRails
[00:45:09] crystal77: has joined #RubyOnRails
[00:49:12] IFrank00: has joined #RubyOnRails
[00:49:13] IFrank004: has joined #RubyOnRails
[00:49:26] Macabre: has joined #RubyOnRails
[00:49:46] jstransky: has joined #RubyOnRails
[00:52:11] triptec: has joined #RubyOnRails
[00:56:31] macsteps: has joined #RubyOnRails
[00:58:19] weaksauce: has joined #RubyOnRails
[00:59:06] Ropeney: has joined #RubyOnRails
[01:00:00] rogue_koder_: has joined #RubyOnRails
[01:03:24] IFrank004: has joined #RubyOnRails
[01:03:24] IFrank00: has joined #RubyOnRails
[01:06:01] crystal77: has joined #RubyOnRails
[01:07:04] macsteps: has joined #RubyOnRails
[01:19:05] rroyal: has joined #RubyOnRails
[01:23:09] Alazoral: has joined #RubyOnRails
[01:25:20] owenjones: has joined #RubyOnRails
[01:25:27] macsteps: has joined #RubyOnRails
[01:34:40] jerematic: has joined #RubyOnRails
[01:35:53] N1njturt1e: has joined #RubyOnRails
[01:36:17] flashpoint9: has joined #RubyOnRails
[01:39:08] Rodya_: has joined #RubyOnRails
[01:45:13] arBmind: has joined #RubyOnRails
[01:45:44] allcentury: has joined #RubyOnRails
[01:47:39] roamingdog: has joined #RubyOnRails
[01:59:27] phredus: has joined #RubyOnRails
[02:04:05] rroyal: has joined #RubyOnRails
[02:05:06] dandaman: has joined #RubyOnRails
[02:05:10] N1njturt1e: has joined #RubyOnRails
[02:06:10] Rodya_: has joined #RubyOnRails
[02:12:37] Leepoff: has joined #RubyOnRails
[02:13:20] bmorrison: has joined #RubyOnRails
[02:16:13] SteenJobs: has joined #RubyOnRails
[02:18:25] lightt: has joined #RubyOnRails
[02:21:51] kgrz: has joined #RubyOnRails
[02:23:09] rubyonrailed: has joined #RubyOnRails
[02:23:20] beilabs: has joined #RubyOnRails
[02:23:59] DragonPunch: has joined #RubyOnRails
[02:24:17] rubyonrailed: Say i’m updating an attribute called `state`. I don’t want the `state` to be able to be changed when it’s currently `cancelled` or `complete`. How could I not allow this, but allow `state` to be updated otherwise?
[02:25:07] haraigo: has joined #RubyOnRails
[02:26:35] DoctorMonocular: has joined #RubyOnRails
[02:27:53] arBmind: has joined #RubyOnRails
[02:31:25] ur5us: has joined #RubyOnRails
[02:31:51] rroyal: has joined #RubyOnRails
[02:33:21] SteenJobs: has joined #RubyOnRails
[02:34:22] lightt: has joined #RubyOnRails
[02:36:34] one_zero: has joined #RubyOnRails
[02:37:43] flashpoint9: has joined #RubyOnRails
[02:38:17] sevenseacat: has joined #RubyOnRails
[02:44:18] IT-Manager: has joined #RubyOnRails
[02:47:57] allcentury: has joined #RubyOnRails
[02:48:12] roamingdog: has joined #RubyOnRails
[02:54:05] ekinmur: has joined #RubyOnRails
[02:55:37] David_H__: has joined #RubyOnRails
[02:55:58] cd83x: has joined #RubyOnRails
[02:57:38] asdfih23yeuiswf: has joined #RubyOnRails
[02:58:04] prithaj: has joined #RubyOnRails
[02:58:29] roamingdog: has joined #RubyOnRails
[02:59:41] xvikvi: has joined #RubyOnRails
[03:02:01] bmorrison: has joined #RubyOnRails
[03:07:12] Radar: rubyonrailed: if statements are good for that
[03:08:17] yellow5: has joined #RubyOnRails
[03:13:28] braincrash: has joined #RubyOnRails
[03:13:49] jancel: has joined #RubyOnRails
[03:15:59] dblessing: has joined #RubyOnRails
[03:16:34] phredus: has joined #RubyOnRails
[03:21:29] k3rn31: has joined #RubyOnRails
[03:27:26] easytune: has joined #RubyOnRails
[03:28:00] jancel: has joined #RubyOnRails
[03:30:20] dandaman: has joined #RubyOnRails
[03:35:35] N1njturt1e: has joined #RubyOnRails
[03:37:25] beilabs: has joined #RubyOnRails
[03:38:02] N1njturt1e: has joined #RubyOnRails
[03:45:59] haraigo: has joined #RubyOnRails
[03:50:59] lightt: has joined #RubyOnRails
[03:52:25] wd40s: has joined #RubyOnRails
[03:53:24] allcentury: has joined #RubyOnRails
[03:53:44] rickmasta: has joined #RubyOnRails
[03:58:11] N1njturt1e: has joined #RubyOnRails
[03:58:16] SteenJobs: has joined #RubyOnRails
[04:06:07] jancel: has joined #RubyOnRails
[04:07:31] spalenza: has joined #RubyOnRails
[04:07:31] spalenza: has left #RubyOnRails: ()
[04:10:59] owenjones: has joined #RubyOnRails
[04:13:40] Axilla: how can I access the main apps assets pipeline from a mounted engine?
[04:14:10] Axilla: i know there's a way to access helpers with something like main_app.helper_path
[04:14:18] Axilla: but i can't find it on google again and i can't remember wtf it was
[04:15:35] Axilla: nevermind i'm an idiot
[04:16:09] macsteps: has joined #RubyOnRails
[04:19:04] hahuang65: has joined #RubyOnRails
[04:25:07] hahuang61: has joined #RubyOnRails
[04:25:30] bmorrison: has joined #RubyOnRails
[04:26:32] tildes_: has joined #RubyOnRails
[04:28:08] cd83x: has joined #RubyOnRails
[04:29:07] phredus: has joined #RubyOnRails
[04:31:36] ksmutthu: has joined #RubyOnRails
[04:31:59] N1njturt1e: has joined #RubyOnRails
[04:33:25] jstransky: has joined #RubyOnRails
[04:34:24] crystal77: has joined #RubyOnRails
[04:36:59] N1njturt1e: has joined #RubyOnRails
[04:37:19] dionysus69: has joined #RubyOnRails
[04:38:20] N1njturt1e: has joined #RubyOnRails
[04:38:26] rroyal: has joined #RubyOnRails
[04:42:01] asdfih23yeuiswf: has joined #RubyOnRails
[04:42:01] DZj091231kld: has joined #RubyOnRails
[04:42:08] lxsameer: has joined #RubyOnRails
[04:50:02] Leepoff: has joined #RubyOnRails
[04:50:04] DoctorMonocular: has joined #RubyOnRails
[04:54:14] rubyonrailed: has joined #RubyOnRails
[04:54:16] allcentury: has joined #RubyOnRails
[04:57:47] N1njturt1e: has joined #RubyOnRails
[04:58:31] noodle: has joined #RubyOnRails
[05:01:41] owenjones: has joined #RubyOnRails
[05:07:07] lupine: has joined #RubyOnRails
[05:07:11] eljimmy: has joined #RubyOnRails
[05:12:30] cypher_: has joined #RubyOnRails
[05:13:48] tvw: has joined #RubyOnRails
[05:13:55] cypher_: Hi, I'm new to developing in rails and was wondering if anyone had some useful resources they have found? or maybe just a push in the right direction of what i should and shouldn't be reading on the web
[05:15:00] jancel: has joined #RubyOnRails
[05:17:01] sevenseacat: resources about what?
[05:17:18] sevenseacat: read everything you can. if its more than 6 months old, take it with a grain of salt.
[05:17:53] syndikate: hey sevenseacat
[05:18:02] syndikate: have you worked with github api?
[05:18:04] sevenseacat: syndikate: good afternoon
[05:18:13] cypher_: yeah that's what i heard but a lot of the stuff that's out there just seems like it's clickbait for views and blog hits
[05:18:13] sevenseacat: nope, but I can probably help with it - whats up?
[05:18:15] syndikate: good morning
[05:18:16] moei: has joined #RubyOnRails
[05:18:18] cypher_: cause it's not very helpful
[05:18:29] sevenseacat: if its not helpful, ignore it :P
[05:19:00] syndikate: I set up omniauth and is all working good, now I am trying to create a file in the repo, I am using net, github_api gem, but no luck, am getting 404 error, sevenseacat
[05:19:26] sevenseacat: so what does your code look like and what is the full error you're getting?
[05:20:36] syndikate: PUT <link> 404 Not Found <-that's the error
[05:21:22] sevenseacat: thats not incredibly helpful.
[05:22:27] N1njturt1e: has joined #RubyOnRails
[05:23:53] syndikate: https://gist.github.com/anonymous/0bb1288223062fb781b5de83df6d7c40
[05:24:03] syndikate: Thats the session controller and error
[05:25:29] alfiemax: has joined #RubyOnRails
[05:28:22] noodle: has joined #RubyOnRails
[05:28:25] sevenseacat: theres not a lot of information to go on
[05:29:21] sevenseacat: thats also not the code that generates that error - unless you're calling `create` on a file that already exists
[05:29:38] sevenseacat: why is a _sessions_ controller saving a file in a Github repo?
[05:30:06] syndikate: I am testingit
[05:30:07] kgrz: has joined #RubyOnRails
[05:30:09] sevenseacat: the full error would be quite helpful
[05:30:23] syndikate: I had the code in a seperate controller but it was failing
[05:30:37] syndikate: So I stacked them together to see if it was something with the token
[05:32:39] syndikate: you mean the session dump?
[05:32:49] pawnbox: has joined #RubyOnRails
[05:32:53] tildes_: has joined #RubyOnRails
[05:32:53] sevenseacat: I mean the logs of the action that show what is happening and why
[05:33:07] sevenseacat: a single line error is not useful
[05:36:48] syndikate: Github::Error::NotFound (PUT https://api.github.com/repos/name/repo/contents/hello.rb?access_token=1233970508aa2e2444ea88f26ebe4c93fecd0b5e: 404 Not Found):
[05:36:48] syndikate: app/controllers/sessions_controller.rb:25:in `create'
[05:37:07] syndikate: That is the error relating to this in the log
[05:37:25] sevenseacat: the full error for the whole action, please gist it.
[05:37:26] rvanlieshout: has joined #RubyOnRails
[05:37:27] banister: has joined #RubyOnRails
[05:38:52] syndikate: sevenseacat, https://gist.github.com/anonymous/c92624c6504117db556c9e47975f6ab4
[05:39:03] DZj091231kld: has joined #RubyOnRails
[05:39:03] asdfih23yeuiswf: has joined #RubyOnRails
[05:39:54] sevenseacat: ok, so the code you posted for your controller definitely isnt the up to date code
[05:40:01] sevenseacat: can you update the controller with the code you're using?
[05:40:27] supernov_a2: has joined #RubyOnRails
[05:40:33] artto: has joined #RubyOnRails
[05:40:41] flashpoint9: has joined #RubyOnRails
[05:40:55] lightt: has joined #RubyOnRails
[05:45:37] ranf: has joined #RubyOnRails
[05:45:47] ranf: Hey guys, seems there should be an easy way to do this, but I haven't been able to discover what that might be.
[05:45:59] ranf: I'm running a query that results in a Foo::ActiveRecord_AssociationRelation. I'll store it in a variable foo. When processing these, I need to further filter on a certain feild, say created_at, but I do not want to reach out to the database again as it is too slow. So I can do something like foo.where("create_at < ?", Date.today - 42), but doing so in rails console suggests that is running another DB
[05:46:04] sevenseacat: ranf: easy - don't refer to everyone as guys :)
[05:46:05] ranf: query. How should I be partitioning these during processing?
[05:46:15] syndikate: It is, well I have updated gist sevenseacat https://gist.github.com/anonymous/51e7c7b2a9e9b79be1bf185a9badd047
[05:46:29] pawnbox: has joined #RubyOnRails
[05:46:49] sevenseacat: syndikate: its not, because line 25 from the error message now points to a comment in the code
[05:48:14] phredus: has joined #RubyOnRails
[05:48:36] syndikate: Okay, got what you are saying, I might have missed that, ould you check the last gist I shared?
[05:49:01] allcentury: has joined #RubyOnRails
[05:49:13] sevenseacat: I did. line 25 is a comment. its not generating the error you showed.
[05:49:24] supernov_a: has joined #RubyOnRails
[05:50:51] sevenseacat: anyway. are you using a valid username and repo name?
[05:51:30] syndikate: It is line 26, the latest gist, check https://gist.github.com/anonymous/51e7c7b2a9e9b79be1bf185a9badd047
[05:51:34] syndikate: Yeah, those are valid
[05:51:37] syndikate: Am using Oauth
[05:51:46] sevenseacat: what are they?
[05:52:16] syndikate: currently it is for an id that I logged in with
[05:52:31] syndikate: I edited out it in the gist
[05:52:32] sevenseacat: no really, what are they
[05:52:50] sevenseacat: because I don't think theyre valid
[05:53:07] syndikate: No, they are, you can count me on that, whatever you see in the gist is invaid, but in the code it is
[05:53:49] sevenseacat: syndikate: if I could count on you for having everything correct, you wouldnt be here with a bug in your code
[05:53:53] sevenseacat: syndikate: !rule12
[05:53:53] helpa: syndikate: Do not PM members of the channel without first asking if that is OK.
[05:54:15] syndikate: Oh, okay. may I PM you sevenseacat ?
[05:54:47] syndikate: Alright then, I can't share the username and repo name unfortunately
[05:56:04] syndikate: I could fetch details, list rpeos etc, it's that my PUT request is not working as the error shared
[05:56:45] ranf: Hmm, seems like the console was just throwing me off. Appears I can do something like foo.select {|f| f.created_at < Date.today - 42}, and that will not result in an additional DB query. Is that right?
[05:56:50] pawnbox: has joined #RubyOnRails
[05:58:24] spyder55: has joined #RubyOnRails
[06:01:22] artto: has joined #RubyOnRails
[06:01:27] ur5us: has joined #RubyOnRails
[06:01:38] apotry: has joined #RubyOnRails
[06:02:35] ranf: nm, that unsurprisingly results in an array. Need to use methods on the results like I could when it was a Foo::ActiveRecord_AssociationRelation
[06:03:09] lessless: has joined #RubyOnRails
[06:05:45] artto_: has joined #RubyOnRails
[06:06:43] mark_66: has joined #RubyOnRails
[06:08:08] rvanlieshout: ranf: it won't trigger an additional query
[06:08:11] rvanlieshout: but it's not the right way to go
[06:08:35] rvanlieshout: you really want your db to perform any logic needed to get the right collection
[06:08:46] rvanlieshout: you don't want to fetch all, then filter in Ruby
[06:11:02] GorillaApe: has joined #RubyOnRails
[06:11:05] edwinvdgraaf: has joined #RubyOnRails
[06:11:53] agent_white: has left #RubyOnRails: ()
[06:12:42] ranf: Right, I don't think there is any way to do what I was hoping to. General idea is that I want to grab from the DB with a query somthing like created_at >= long_time_go AND created_at <= Date.today, and then chunk it up conditionally in a loop
[06:14:17] rvanlieshout: ranf: and what's the problem with that?
[06:14:40] rvanlieshout: that 'chunk it up conditionally'-part should go though
[06:14:42] spyder55: has joined #RubyOnRails
[06:14:43] rvanlieshout: have the db do that
[06:15:17] ranf: means tons of queries
[06:15:27] rvanlieshout: what conditions?
[06:15:40] rvanlieshout: what conditions?
[06:15:49] rvanlieshout: hmm. didn't ment to type that twice
[06:15:54] rvanlieshout: up + enter in wrong window :)
[06:16:31] jancel: has joined #RubyOnRails
[06:17:26] ranf: say you want data from the last week, and then you want to break it up per day, then scale that general idea up
[06:17:44] rvanlieshout: and what do you want to do with the data per day?
[06:18:16] ranf: confrubulate it
[06:18:46] N1njturt1e: has joined #RubyOnRails
[06:18:48] rvanlieshout: and that means?
[06:18:53] sevenseacat: some people just want to watch the world burn
[06:19:18] ranf: sorry, I just don't see what it matters. I want to foobar(data_for_a_given_day)
[06:19:29] lightt: has joined #RubyOnRails
[06:19:35] rvanlieshout: because the db can do a lot more then you would expect
[06:19:39] rvanlieshout: and it can do it a gazilion times faster
[06:19:48] ranf: okay, the DB can't do it
[06:19:50] ranf: I know that much
[06:20:05] rvanlieshout: well.. if you don't care, i won't either
[06:20:24] ranf: huh? not what I said, but okay
[06:20:37] rvanlieshout: but you're also not intrested in telling what you want to do with the data
[06:20:54] aganov: has joined #RubyOnRails
[06:21:48] ranf: I'm certain that that doesn't matter. I think the fact I want to foobar(the_data), which can't be done by the DB, is the right response
[06:21:53] helpa: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[06:23:12] comrad: has joined #RubyOnRails
[06:23:26] ranf: Seriously, why does that matter? Say I could point you to exactly the code that would be run, and the end result of you reading that code was "Yeah, that can't be done by the DB". How have we at any way arrived at a different point than we're at now?
[06:23:47] rvanlieshout: because it helps if i've got any clue about what you're doing
[06:26:55] universa1: because most people answering in here have a fairly broad knowledge, and might be able to give you pointers to "better" solutions, things you haven't noticed by yourself...
[06:27:02] DZj091231kld: has joined #RubyOnRails
[06:27:02] asdfih23yeuiswf: has joined #RubyOnRails
[06:28:03] universa1: and seeing your code might tell them what you're actually trying to do, and they might have another way of going on about it, but...
[06:28:27] N1njturt1e: has joined #RubyOnRails
[06:30:19] modran: has joined #RubyOnRails
[06:32:24] syndikate: well sevenseacat I fixed
[06:33:32] Dimik: has joined #RubyOnRails
[06:33:33] spyder55: has joined #RubyOnRails
[06:34:39] ranf: It really doesn't matter. I appreciate the attempts to help, but not everyone can share their source code publically. I shared the simpliest version of my problem, with that I judged to be the relevant details. In my mind, it's a case of if the answer to the question were "You want arr.each {|e| foobar(e)}", it wouldn't matter what foobar did.
[06:35:59] sevenseacat: I never remember that one.
[06:36:05] universa1: !consultant
[06:36:05] helpa: Your question, problem, and/or attitude requires more than free internet advice from an irc channel. May I suggest hiring a consultant or life coach?
[06:36:15] universa1: nah, wrong one :(
[06:36:44] helpa: NO FAKE CODE. If you're under an NDA, we cannot help you with your problem. Go hire a consultant.
[06:37:28] agit0: has joined #RubyOnRails
[06:37:36] Macaveli: has joined #RubyOnRails
[06:38:26] jerematic: has joined #RubyOnRails
[06:38:31] Radar: ranf: !rule0
[06:38:31] helpa: ranf: 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.
[06:38:54] Radar: ranf: I made that Rule #0 because we've had a lot of... disagreements here about code that only one person can see.
[06:39:59] N1njturt1e: has joined #RubyOnRails
[06:40:17] Radar: Regarding the code you posted earlier...
[06:40:20] Radar: foo.select {|f| f.created_at < Date.today - 42}
[06:40:28] Radar: foo.where("created_at < ?", 42.days.ago)
[06:41:07] ranf: Yeah, typed that out wrong
[06:46:17] gingray: has joined #RubyOnRails
[06:48:00] macsteps: has joined #RubyOnRails
[06:52:44] Spami: has joined #RubyOnRails
[06:55:23] hahuang61: has joined #RubyOnRails
[06:59:47] Radar: You'll find plenty of helpful people here if you show your code and explain your problem well.
[07:01:55] darutoko: has joined #RubyOnRails
[07:05:29] aasadaz: has joined #RubyOnRails
[07:06:39] alfiemax: i'm following this book to write an api : http://apionrails.icalialabs.com/book/chapter_two
[07:07:16] DTZUBDUB: has joined #RubyOnRails
[07:07:22] alfiemax: i'm trying to understand the difference between writing routes like these : https://gist.github.com/alfie-max/b712b62eeed6c8e766f3df8b903d6dc2
[07:07:40] alfiemax: one has `scope module: :v1 do` the other `scope :v1 do`
[07:08:01] universa1: alfiemax: did you look at the docs for scope?
[07:09:20] universa1: alfiemax: and also: just try the code, run rake routes on it.
[07:09:21] universa1: http://api.rubyonrails.org/classes/ActionDispatch/Routing/Mapper/Scoping.html#method-i-scope
[07:09:41] alfiemax: universa1, i did check the routes, and the scope docs
[07:10:10] alfiemax: it says if i want to skip the `v1` dir i have to use `scope module: :v1`
[07:10:26] alfiemax: and that is what is happening also
[07:10:52] alfiemax: so just wondering, was that just the error in the book i am following ?
[07:11:00] universa1: what error?!
[07:11:22] alfiemax: this is the example url they have shown : http://api.marketplace.dev/v1/products/1
[07:11:23] pawnbox: has joined #RubyOnRails
[07:11:37] alfiemax: using : scope module: :v1 do
[07:12:22] easytune_: has joined #RubyOnRails
[07:13:51] universa1: alfiemax: looks like they just wanted to do scope :v1 do ... in the first part... but do scope module: :v1, ... in the end.
[07:14:06] xhoy: has joined #RubyOnRails
[07:15:01] aganov: has joined #RubyOnRails
[07:16:35] alfiemax: oh, anyways. understood what both does :)
[07:16:42] pawnbox: has joined #RubyOnRails
[07:16:45] alfiemax: thanks for your time :)
[07:22:27] blockchan: has joined #RubyOnRails
[07:24:17] arup_r: has joined #RubyOnRails
[07:25:50] antgel: has joined #RubyOnRails
[07:32:01] defsdoor: has joined #RubyOnRails
[07:33:36] theod: has joined #RubyOnRails
[07:36:26] antgel: has joined #RubyOnRails
[07:37:10] Spami: is there a rebind reinstall command?
[07:38:15] sevenseacat: reinstall what?
[07:38:33] Spami: weird auto correct
[07:39:11] jerematic: has joined #RubyOnRails
[07:39:28] ur5us: has joined #RubyOnRails
[07:43:11] N1njturt1e: has joined #RubyOnRails
[07:43:26] scepticulous: has joined #RubyOnRails
[07:46:53] harfangk: has joined #RubyOnRails
[07:48:28] allcentury: has joined #RubyOnRails
[07:49:18] macsteps: has joined #RubyOnRails
[07:55:54] artto: has joined #RubyOnRails
[07:58:57] crova: has joined #RubyOnRails
[08:00:24] adre: has joined #RubyOnRails
[08:00:52] crova: greetings everyone ! I'm trying to upload a CSV file and I get NULL to all fields except the timestamps (created and updated at). If i define self.import with "puts row.inspect" for each row, I can see the correct values on my server log, but hen i trie to define it with "Object.create!" it feels the database with the correct number of rows (based
[08:00:52] crova: on the csv file) but with all fields NULL
[08:01:13] Psyko: has joined #RubyOnRails
[08:02:05] sypheren: has joined #RubyOnRails
[08:03:15] crova: greetings everyone ! I'm trying to upload a CSV file and I get NULL to all fields except the timestamps (created and updated at). If i define self.import with "puts row.inspect" for each row, I can see the correct values on my server log, but hen i trie to define it with "Object.create!" it feels the database with the correct number of rows (based
[08:03:15] crova: on the csv file) but with all fields NULL (not sure the previous message was outputted, sorry if repeated)
[08:03:29] raunicolae: has joined #RubyOnRails
[08:03:38] rvanlieshout: crova: gist some logs
[08:03:42] rvanlieshout: and what you've tried
[08:03:57] crova: one second please
[08:04:26] jancel: has joined #RubyOnRails
[08:04:41] raunicolae: has left #RubyOnRails: ()
[08:07:04] arBmind: has joined #RubyOnRails
[08:09:12] digitalfiz: has joined #RubyOnRails
[08:09:18] Obi_obi___: has joined #RubyOnRails
[08:10:27] yaymukund: has joined #RubyOnRails
[08:10:50] crova: there you go man: https://gist.github.com/anonymous/d269ce425a51aa735c5505e69b178f0b#file-gistfile2-txt
[08:11:44] rvanlieshout: you're performing a Campaign.create!
[08:11:48] rvanlieshout: without using the row
[08:12:06] rvanlieshout: shouldn't you use the data from row and pass it to Campaign.create?
[08:12:17] crova: sure thing
[08:12:42] crova: I tried with Campaign.create! how.to_hash
[08:12:53] crova: and i get an uncalled method error on to_hash
[08:13:07] arup_r: has joined #RubyOnRails
[08:13:13] rvanlieshout: what attributes dos a Campaign has?
[08:13:38] crova: all strings
[08:13:47] rvanlieshout: with the same name as the fields in the csv?
[08:14:27] crova: sure enough, I even tried changing the headers to be sure they were the same
[08:14:39] crova: also tried without headers
[08:14:50] crova: and still got fields filled with null
[08:14:55] jsrn: has joined #RubyOnRails
[08:15:03] rvanlieshout: crova: the headers doesn't have to be the same
[08:15:31] rvanlieshout: Campaign.create! name: row['CampaignName'], from_name: row['Namefrom]
[08:15:59] crova: i'll try that out
[08:16:41] Psyko: hello! new to ruby on rails here, and i just got the ruby on rails 4 essential from lynda and i think i may be stuck
[08:16:41] Psyko: here are the details:
[08:16:42] Psyko: Error page: http://prntscr.com/bcwro5
[08:16:42] Psyko: Ruby Version: http://prntscr.com/bcwrtl
[08:16:42] Psyko: Rails Version: http://prntscr.com/bcwrzd
[08:16:42] Psyko: Screenshot of Code: http://prntscr.com/bcws92
[08:16:44] Psyko: Log from Commandline: http://prntscr.com/bcwuii
[08:16:46] universa1: not sure if rails cares about case-sensitivity in the params hash... ...but since all fields are usually lowercase, it wouldn't match much
[08:16:46] Psyko: i don't know what to do i've follow the videos and tutorials and looked at the syntax samples
[08:16:48] Psyko: i believe i correctly did it yet it posted a syntax error, help! thanks again!
[08:17:00] universa1: Psyko: can you put all these links into ONE gist please?
[08:17:13] roelof: has joined #RubyOnRails
[08:17:14] universa1: *content of the link
[08:17:31] roelof: Can someone help me wih this problem.: https://gist.github.com/rwobben/1fcc790e63156b2f50aa09ee06fb7d06
[08:17:48] universa1: roelof: how many times do i have to ask you: what is this problem?
[08:17:55] roelof: on server -s everything works well and capabary do not seem to see the route
[08:17:58] universa1: please do not just post: PROBLEM -- link
[08:18:14] roelof: universa1: the error message is in the gists
[08:18:43] roelof: oke, so why does capabary do not follow the link and the route here : https://gist.github.com/rwobben/1fcc790e63156b2f50aa09ee06fb7d06
[08:18:47] sevenseacat: universa1: a few more times, apparently
[08:18:49] universa1: roelof: so instead of saying: hello, i've a problem with capybara, where it seems to be unable to find a route, ...
[08:18:58] Psyko: Hello here is my gist link: https://gist.github.com/anonymous/5ddfba827b11a3b5e4a7888d6fe183ab
[08:19:01] rvanlieshout: roelof: add a save_page and see what data it has
[08:19:23] sevenseacat: universa1: he does exactly the same thing all over reddit, dont worry
[08:19:28] universa1: roelof: you have the persons trying to help you, open some link, and then find out, ohh i don't know nothing about capybara... if i only knew...
[08:19:40] roelof: I did and when I looked at it , it do not seem to do the <%= yield %> part
[08:20:33] sevenseacat: did you delete it again
[08:20:56] roelof: sevenseacat: I did not delete anything
[08:20:58] universa1: Psyko: it is easier for us, if you don't post pictures, but copy the text into a gist.
[08:21:22] universa1: Psyko: so you seem to be having an error triggered by line 5 in your application.html
[08:21:36] crova: rvanlieshout: thanks you for your help
[08:21:38] universa1: Psyko: which is most likely your javacscript_link_tag
[08:21:41] crova: it works like a charm now
[08:22:01] universa1: Psyko: which in turn most likely means: you ahve an error in your javascript. gist your application.js please.
[08:22:08] yos7ph: has joined #RubyOnRails
[08:22:19] rvanlieshout: crova: you're welcome
[08:22:23] roelof: I get the feeling because I did js:true that capabary think the javascript will do the routing but that is not how the menu works
[08:23:10] roelof: I need the javascript because the submenu is only visible when you click on the head-menu choice
[08:23:51] harfangk: that capabary misspelling is such a minor thing but it keeps bothering me a lot lol
[08:24:34] universa1: roelof: in such cases, i like using: https://github.com/mattheworiordan/capybara-screenshot and look at the page at each step of the spec.
[08:24:45] sevenseacat: harfangk: me too. ive pointed it out several times
[08:25:18] sevenseacat: it says 'i have so little attention to detail that i cant even get the names of the tools right'
[08:26:47] roelof: universa1: thanks , I will try out that tool
[08:26:50] DaniG2k: has joined #RubyOnRails
[08:27:09] avgerinos: has joined #RubyOnRails
[08:27:46] avgerinos: hello there, what's the best practice on how to add I18n functionallity to a gem that should be use on both plain ruby, and rails applications?
[08:27:56] avgerinos: I think railities are overkill, but I'm not sure
[08:28:17] universa1: avgerinos: i think the base i18n gem is not dependent on rails
[08:28:28] universa1: Psyko: keep the conversation in the channel please.
[08:28:37] Psyko: oh okay sorry
[08:28:44] Psyko: this is my application.js https://gist.github.com/anonymous/5ddfba827b11a3b5e4a7888d6fe183ab but im currently using this manifest file https://gist.github.com/anonymous/ce27d4955f2bc569d054186499507077 where this is my application.html.erb https://gist.github.com/anonymous/47a0a2c49bcc9caaf4e4fbaeef9f3e86
[08:28:44] avgerinos: universa1: true, it's not rails dependent
[08:29:10] universa1: Psyko: !gist-usage
[08:29:10] helpa: Psyko: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[08:29:21] avgerinos: I'm just asking if I should rely on I18n.load_path for both ruby and rails apps
[08:29:46] avgerinos: or I should add a railtie for configuration when the gem is used inside a rails app
[08:30:02] bmorrison: has joined #RubyOnRails
[08:30:41] avgerinos: I've mostly seen this stuff in gems that are also Rails engines, which happens to not be my case
[08:31:07] Ropeney: has joined #RubyOnRails
[08:32:17] gingray: has joined #RubyOnRails
[08:33:08] artto: has joined #RubyOnRails
[08:33:15] norc: has joined #RubyOnRails
[08:33:21] norc: has joined #RubyOnRails
[08:33:21] norc: has joined #RubyOnRails
[08:33:39] Psyko: i apologize and thanks again here is my gist: https://gist.github.com/anonymous/8b29b4c5753bfcbd48a62a64be648e4d
[08:33:40] roelof: universa1: no luck with that tool. When I do it before the failing I see only the frontpage. After the failing I see only the error message
[08:34:26] universa1: Psyko: ok, what is in demo.js
[08:34:47] ksmutthu_: has joined #RubyOnRails
[08:34:56] universa1: roelof: is the menu open? ...
[08:35:15] roelof: universa1: but when I look at the rspec log ( https://gist.github.com/rwobben/91cebaa38284995254bb865d629957b1) it seems that the click on the submenu does not trigger a route
[08:35:23] roelof: yep, the menu is open
[08:35:48] universa1: so you see the submenu link you want to click on?
[08:35:59] marr: has joined #RubyOnRails
[08:36:05] universa1: if so: you can use click_link
[08:36:10] Psyko: demo.js https://gist.github.com/anonymous/96b1c743566a11a8d78fe44aab6b236c
[08:36:18] norc: Hi. Im developing a Rails application that uses some protected APIs. Authorization is done using OAuth2, Im now looking for something that lets me install hooks on actions that automate the OAuth flow and token management. Is there some gem around for this?
[08:36:19] roelof: then I see the same error message
[08:36:32] Psyko: it works when i do assets/public.js
[08:36:43] Psyko: instead of just "public.js"
[08:36:59] universa1: Psyko: whoa, wait what?
[08:37:11] universa1: Psyko: where do you do assets/public.js ?
[08:37:21] universa1: Psyko: specific reason you're not using application.js ?
[08:37:24] Psyko: the javascript tag
[08:37:31] roelof: and the same rspec log universa1
[08:37:37] Psyko: reason is i just followed the ror 4 essentials video
[08:37:57] Psyko: the tutor was using another manifest file instead of the default
[08:38:15] moeabdol1: has joined #RubyOnRails
[08:38:47] universa1: Psyko: you should do just javascript_include_tag "public" (no .js)
[08:39:16] Psyko: i think i did that, but let me do it again just incase brb thanks
[08:40:20] Psyko: yeah still the same
[08:40:43] universa1: Psyko: still the missing ' error?
[08:41:06] universa1: Psyko: can you try removing the //= require demo line from public.js
[08:41:28] Psyko: ok, a moment
[08:42:25] Psyko: still the same
[08:42:52] dionysus69: has joined #RubyOnRails
[08:43:05] Ergo: has joined #RubyOnRails
[08:43:42] universa1: Psyko: your public/assets folder is empty, right?
[08:45:59] benlieb: has joined #RubyOnRails
[08:46:05] universa1: Psyko: ok, if you do javascript_link_tag 'application' instead of public, does it work then?
[08:46:26] moeabdol: has joined #RubyOnRails
[08:46:32] Psyko: let me test
[08:47:06] dionysus69: has joined #RubyOnRails
[08:47:14] benlieb_: has joined #RubyOnRails
[08:47:28] Psyko: still the same
[08:47:40] universa1: Psyko: ok. what other files have you touched? ;)
[08:47:56] universa1: Psyko: it looks like you have some stray ' in one of your files.
[08:48:14] Psyko: i cant remember but ill check
[08:49:21] Psyko: mostly just in the views
[08:49:44] pawnbox: has joined #RubyOnRails
[08:51:04] universa1: Psyko: and you gisted always the real files you actually use, right? ;) you didn't leave anything out?
[08:51:38] universa1: Psyko: can also add the latest error with the full stack trace to the gist, please?
[08:52:09] Psyko: ok, a moment
[08:53:12] Psyko: here it is https://gist.github.com/anonymous/b2d6d4558c88204571d349bdc377f339
[08:54:16] universa1: Psyko: your js_include_tag has what as it's argument? application or public?
[08:54:44] universa1: this is not a yes / no question
[08:55:07] Psyko: sorry, i reverted it to public
[08:56:25] universa1: Psyko: can you change it one more time to application, reload the page and gist the full error trace again?
[08:56:56] bmorrison: has joined #RubyOnRails
[08:57:20] weckl: has joined #RubyOnRails
[08:58:22] Alazoral: has joined #RubyOnRails
[08:58:53] Psyko: here it is: https://gist.github.com/anonymous/a64f74b00322d4c5bf7971082c09c7e2
[08:59:33] bmorrison: has joined #RubyOnRails
[09:00:24] universa1: Psyko: if you remove the javascript_link_tag completely the site loads fine?
[09:00:41] Psyko: let me check
[09:02:23] universa1: Psyko: ok. add it back in: and empty out public.js completely and try again ;)
[09:02:34] ferr: has joined #RubyOnRails
[09:04:07] mdw: has joined #RubyOnRails
[09:04:56] DaniG2k: does anyone here know of a good guide that shows how I can have a completely different set of css/js assets for a namespaced controller?
[09:05:18] Circuit8: has joined #RubyOnRails
[09:05:19] DaniG2k: I have an admin/ namespace and I want that section to visually look different from the rest of the wbesite
[09:05:34] blackmesa: has joined #RubyOnRails
[09:05:45] snowy: has joined #RubyOnRails
[09:06:19] universa1: Psyko: you're sure you're editing the correct js files? you don't have any other public.js | application.js somewhere in your assets | vendor/assets folder?
[09:06:26] universa1: *any folder in your app ,)
[09:07:15] bmorrison: has joined #RubyOnRails
[09:07:16] Psyko: yep ive understood the manifest file that its where you put your actual js files
[09:07:28] Psyko: err the js filenames
[09:07:28] kgrz: has joined #RubyOnRails
[09:08:16] jas02: has joined #RubyOnRails
[09:08:44] universa1: Psyko: sorry, can you put your app in a git repo and push it to github? i'm clueless without looking at the actual code ;)
[09:09:02] blackhuey: has joined #RubyOnRails
[09:09:17] Psyko: no prob this is just some tutorial code anyway in Ruby on Rails 4 Essentials lol :D
[09:09:47] hahuang61: has joined #RubyOnRails
[09:10:01] norc: Hi. Before I dig into the middleware by hand, would anyone happen to know from the top off their head whether I can change the timestamp to millisecond resolution for the standard rails logger?
[09:12:05] universa1: norc: should be possible with a custom logger, but depending on what you do, you might want a different log format anyways.
[09:13:12] dalpo: has joined #RubyOnRails
[09:13:31] upstream: has joined #RubyOnRails
[09:14:36] norc: universa1: Fair enough. I just found the middleware, it uses Time.now.to_default_s (and thus using the default format), so there is no way around a custom logger anyway.
[09:14:51] workmad3: has joined #RubyOnRails
[09:16:24] artto: has joined #RubyOnRails
[09:16:55] Psyko: universa1
[09:16:57] Psyko: https://github.com/psyk01337/rubyonrailstutorial
[09:17:32] norc: Oh, wait I can simply plug in a log formatter!
[09:17:34] norc: That will be far easier. :)
[09:17:39] Psyko: ive tried instead of "public" i went for "assets/public"
[09:17:42] lightt: has joined #RubyOnRails
[09:18:00] noobsu: has joined #RubyOnRails
[09:18:08] Psyko: it worked idk why but the javscript functions e.g. alert() didnt function
[09:18:55] Psyko: thanks again universa1 :)
[09:19:49] workmad3: has joined #RubyOnRails
[09:20:53] artto: has joined #RubyOnRails
[09:22:43] AzaToth: has joined #RubyOnRails
[09:23:17] universa1: Psyko: okay. found the error ;)
[09:23:34] universa1: Psyko: your !!demo.coffee is the problem.
[09:23:42] Psyko: i should delete that?
[09:23:52] universa1: either that, or fix it ;)
[09:24:08] Psyko: i see, so basically ror takes in all the files
[09:24:26] Psyko: i thought itd ignore it or idk
[09:25:03] universa1: Psyko: hmm, not sure, it should usually ignore it, but it might ignore !! in front. so if you'd name it my_demo.coffee it shouldn't load it anymore
[09:25:40] Psyko: yeah thats what i was thinking, anyways let me test it over here at my end
[09:25:57] allcentury: has joined #RubyOnRails
[09:26:00] universa1: Psyko: yep, if you rename it to my_demo.coffee it isn't loaded anymore
[09:27:34] blackmesa: has joined #RubyOnRails
[09:28:23] Psyko: hafta precompile if i delete anything yes?
[09:29:10] Psyko: i mean delete the !!!demo.coffee thingy
[09:29:18] universa1: Psyko: yes.
[09:29:19] Psyko: anyways i precompiled
[09:29:32] Psyko: you are a beautiful person universa1
[09:29:34] Psyko: thanks again!
[09:29:42] Psyko: +5000 rep points
[09:30:09] universa1: Psyko: yw :-)
[09:30:48] srinidhi: has joined #RubyOnRails
[09:31:54] bmorrison: has joined #RubyOnRails
[09:32:08] scepticulous: has joined #RubyOnRails
[09:33:37] ksmutthu__: has joined #RubyOnRails
[09:33:45] scepticulous: has joined #RubyOnRails
[09:34:37] dionysus69: has joined #RubyOnRails
[09:37:24] arBmind: has joined #RubyOnRails
[09:38:47] kgrz: has joined #RubyOnRails
[09:41:18] morfin: has joined #RubyOnRails
[09:41:36] scepticulous: has joined #RubyOnRails
[09:41:49] kali3: has joined #RubyOnRails
[09:44:39] morfin: let's say i want some "widget" but i want fetch data from model(in controller) and preprocess before giving data to the view but also i want to avoid bloating of my controller whereshould i put that stuff?
[09:46:28] rvanlieshout: service, presenter, decorator
[09:47:32] dionysus69: has joined #RubyOnRails
[09:48:13] walidvb: has joined #RubyOnRails
[09:48:28] walidvb: hey friends
[09:48:30] norc: Hi. My Rails server repeatedly hangs up during my OAuth 2.0 callback phase for a few seconds, but I have no idea how to quickly debug what is causing this.
[09:48:33] walidvb: When using services, is it ok to test only the best path in the controllers, given the service tests all other cases?
[09:48:46] norc: I thought abut interrupting the server with SIGINT, but that invoked signal handlers so I dont get a stack trace.
[09:48:57] liquid-silence: has joined #RubyOnRails
[09:48:57] liquid-silence: has joined #RubyOnRails
[09:49:03] norc: So... how do I interrupt rails the hardware but still getting a stack trace?
[09:49:06] norc: *hard way.
[09:49:10] liquid-silence: has anyone here ever tried to watermark images on the fly with rails?
[09:50:15] norc: liquid-silence: Do you have a specific question or problem?
[09:51:01] hahuang61: has joined #RubyOnRails
[09:51:53] liquid-silence: norc I am just checking if someone has done this, so I dont have to do all the research :P
[09:53:08] norc: Note, I cross posted and got an answer. SIGQUIT helps.
[09:53:16] norc: liquid-silence: imagemagick is your friend I suppose.
[09:54:06] ksmutthu: has joined #RubyOnRails
[09:54:20] liquid-silence: yeah I know how we would like to do it
[09:57:22] walidvb: liquid-silence: do you use paperclip?
[09:58:01] naftilos76: has joined #RubyOnRails
[09:59:14] norc: liquid-silence: So what is your question then?
[09:59:25] naftilos76: Hi, can anybody suggest an editor for rails that has a dark bg theme, syntax highlighting, supports tabs, remembers last files opened etc?
[09:59:40] walidvb: sublime, atom ?
[09:59:42] norc: naftilos76: Editors are kind of a taboo topic..
[10:00:02] naftilos76: norc, yes it is :)
[10:00:04] walidvb: and more more more
[10:00:11] norc: naftilos76: It is the best way to start a flame war in most programming related channels. So, let's not do that?
[10:00:31] bruce_lee: has joined #RubyOnRails
[10:00:33] srinidhi: has joined #RubyOnRails
[10:00:45] norc: Like someone once said: Editors are like religion: Pick one you like and don't talk about it. ;-)
[10:01:51] walidvb: any one saw the services question? ^^
[10:02:08] workmad3: norc: it's easier to change your religion though...
[10:02:12] norc: walidvb: Your question did not make much sense to me. Can you rephrase it perhaps?
[10:02:17] walidvb: i'm moving some things out of my controllers to services, which feels quite good i must say.
[10:02:18] norc: workmad3: Hah.
[10:02:28] norc: workmad3: I think I might have quoted you in fact.
[10:02:36] naftilos76: norc, this is exageration . It is a text editor we are talking about, not some conspiracy theory ...
[10:02:46] norc: naftilos76: It is not.
[10:02:49] walidvb: I've added tests to those services, to ensure they work correctly(and allow portability)
[10:03:01] workmad3: naftilos76: it's not much of an exaggeration... people get extremely heated in 'discussing' the merits of their text editor
[10:03:13] naftilos76: norc, the flame is yours
[10:03:20] walidvb: however, in the end the user will be talking to the controllers, not the services. so, does one need to replicate the tests for the controller?
[10:03:53] naftilos76: what is so wrong about suggesting the name of an editor?
[10:03:58] workmad3: naftilos76: best suggestion - try out a few (say textmate, vim, emacs) for a week or two each, and see which one clicks easiest... it's a tool you're going to spend a huge amount of time with, you need to be comfortable with how it works
[10:04:04] rubyonrailed: has joined #RubyOnRails
[10:04:06] walidvb: or should i just test the success path to ensure that if my front-end sends the right request it does what the service does
[10:04:13] norc: walidvb: Both.
[10:04:19] lightt: does reading programming stuff at night make u awake more or sleep more
[10:04:29] norc: walidvb: It is always a good thing to test your modules separately, and have end-to-end request specs.
[10:04:40] walidvb: norc: arf.. feels like i'm testing the exact same things twice
[10:04:56] workmad3: naftilos76: and, from my experience at least, it's much more important to find a text editor you're comfortable with that lacks some nice features than to try and use an uncormfortable editor that has some snazzy thing that gets overhyped
[10:04:58] walidvb: in the end, my controller is returning the result of my service
[10:04:58] norc: walidvb: One is to guarantee every part is working as intended, while integration tests tell you whether your application behaves as expected.
[10:05:12] norc: walidvb: Controller tests are out of style
[10:05:19] walidvb: norc: what do you mean?
[10:05:49] workmad3: naftilos76: oh wait, textmate is somewhat outdated now... I meant sublime text
[10:05:57] naftilos76: workmad3, i am basically looking for a decent editor rather than an IDE that writes the code for me...
[10:06:13] blackmesa: has joined #RubyOnRails
[10:06:20] workmad3: naftilos76: I'm a vim fan personally... been using it exclusively for several years now :)
[10:06:52] harfangk: has joined #RubyOnRails
[10:06:55] norc: walidvb: It seems to be much more common to tests the other parts (say modules, views, services, decorators), and then have integration tests (which automatically include whatever your controller adds)
[10:07:06] naftilos76: 've been using it lot for one-file-editting, not sure if i feel comfortable for multiple files
[10:07:15] norc: walidvb: But Im not the right person to explain to you why or the advantages.
[10:07:17] tvw: has joined #RubyOnRails
[10:07:18] walidvb: naftilos76: i've been on sublime for a while, switched to atom for an unknown reason, and am happy with both, although atom is slower
[10:07:29] walidvb: norc: sure, but in the case of an API?
[10:07:43] norc: walidvb: Do you have controllers with huge logic?
[10:07:44] naftilos76: walidvb, will try them both, thanks a lot
[10:08:08] walidvb: norc: not now that i have services ;)
[10:08:13] norc: walidvb: ;)
[10:08:23] walidvb: that's why i'm relunctant in extensively testing each path
[10:08:29] norc: walidvb: Id say especially in case of an API, because integration tests are even easier to set up then.
[10:08:51] norc: (Means you probably dont need capybara, which makes things easier)
[10:08:56] workmad3: naftilos76: vim is pretty good for multiple files too... I tend to open a handful at a time and just switch between them with `:bn` and `:bp`. You can get things like nerdtree too, which give you a project drawer to navigate, or ctrl-p for fuzzy-file opening
[10:09:07] norc: workmad3: vim can do multiple files?
[10:09:07] walidvb: although as it's an API, would need to make sure it works when a request is made
[10:09:08] norc: Interesting!
[10:09:26] norc: workmad3: Ive been using vim for over 10 years now, and Im still busy trying to figure out how to quit...
[10:09:52] walidvb: norc: still, i'd repeat the exact same tests than in my service in the end
[10:09:53] norc: Jokes aside, shell based editors can handle multiple files through use of tmux fairly easily.
[10:09:55] workmad3: norc: such an old joke :P and it's so easy to quit... you just switch to a different terminal and do `killall vim`
[10:10:14] workmad3: norc: I've never once needed to use tmux for multiple files in vim
[10:10:37] srinidhi: has joined #RubyOnRails
[10:10:39] workmad3: norc: on the few times I've wanted to have files side by side, vim has some nice windowing features built in :)
[10:11:07] norc: workmad3: I guess I never could be bothered to learn vim specific features that I was using tmux in general for anyway.
[10:11:52] DaniG2k: has joined #RubyOnRails
[10:11:56] workmad3: norc: I like keeping it all in a single vim session... that way the ctrl-n built-in autocomplete works nicely (it autocompletes from words in all open buffers, so the more files you have open, the more effective it is)
[10:14:38] workmad3: norc: I've always found it pretty amusing that one of the most effective autocompletes for vim is the one it comes out-the-box with :)
[10:16:40] norc: So.. I need some pointers. I have an action (from omniauth) that takes a long while to complete. I have no idea how to identify which code is the problem here.
[10:17:11] norc: I have no idea how to break into it (interrupting the rails process with signals just produces stack trace on webrick)
[10:17:34] workmad3: norc: `binding.pry`?
[10:17:41] norc: workmad3: And drop it where? ;-)
[10:17:44] lightt: is this room about the jewellery transport
[10:17:51] workmad3: norc: randomly throughout ;)
[10:18:09] norc: workmad3: Yeah, I was trying to avoid the "process of elimination" game.
[10:18:14] workmad3: norc: or drop `Rails.logger.info "here 1"` etc throughout and isolate the slow spot
[10:18:31] norc: workmad3: Oh! I just realized what I want.
[10:18:33] norc: I want a profiler.
[10:18:48] workmad3: norc: that would do it too
[10:18:51] Kedare: has joined #RubyOnRails
[10:19:05] c355E3B: has joined #RubyOnRails
[10:19:26] workmad3: norc: if I'm just trying to isolate to a section of code I can examine, I tend to just drop in a bunch of logs or pry bindings in order to figure out the general area before delving in
[10:19:49] norc: workmad3: Oh yeah. The problem is just that its in the depth of omniauth rather than my own code.
[10:19:52] workmad3: norc: generally goes a bit quicker than setting up a profiler and then figuring out the results :)
[10:20:26] workmad3: norc: ah right... yeah, that can be a bit annoying
[10:20:30] norc: workmad3: Hopefully it wont take that much time. Besides getting some experience with a profiler surely cant hurt.
[10:23:54] abot_: has joined #RubyOnRails
[10:24:21] abot_: are concerns mentioned anywhere in the guides?
[10:24:35] abot_: I fail to find it
[10:25:25] walidvb: abot_: http://api.rubyonrails.org/classes/ActiveSupport/Concern.html ^^
[10:26:57] tildes: abot_: they are mentioned here, literally http://guides.rubyonrails.org/plugins.html
[10:27:19] tildes: idk if there is an actual guide for using them
[10:27:52] tildes: what I do see, is that some people advice not to use them
[10:27:54] sevenseacat: tl;dr - don't use them :P
[10:28:06] walidvb: abot_: i learned via blog posts, you'll find a fair amount of those
[10:28:21] walidvb: sevenseacat: and the long version would be..?
[10:28:40] sevenseacat: walidvb: don't use them unless you know what you're doing, and even then, i advise against it
[10:29:02] norc: sevenseacat: Do you mean mixins in general, or the rails facility ActiveSupport::Concern ?
[10:29:15] sevenseacat: the rails facility ActiveSupport::Concern
[10:30:05] alfiemax: has joined #RubyOnRails
[10:31:15] triptec: has joined #RubyOnRails
[10:38:50] abot_: thanks guys
[10:39:10] abot_: I also read that one should not use them - can anyone elaborate or point me to recent discussions/reasons?
[10:39:28] abot_: ^ sevenseacat
[10:39:37] norc: workmad3: sad thing is, setting the profiler up was a matter of inserting two lines into my Gemfile.
[10:39:43] helpa: abot_: We're not all guys here - while you probably don't meant to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
[10:39:53] norc: workmad3: But getting the flamegraph on this damn redirect seems to be really hard...
[10:40:09] abot_: sevenseacat: I'm sorry - I'm no native english speaker, I learned that guys means people
[10:40:37] m_antis: has joined #RubyOnRails
[10:40:37] norc: workmad3: Especially since I am effectively doing something that OAuth 2.0 was designed to prevent... :(
[10:41:26] jerematic: has joined #RubyOnRails
[10:42:10] abot_: sevenseacat: but anyway, do you have any more detail about why not to use concerns and what to use instead?
[10:42:20] sevenseacat: abot_: use ordinary ruby mixins
[10:42:42] sevenseacat: after all, concerns are just a messy layer on top of them
[10:42:47] abot_: sevenseacat: but I'm interested in the reasons, I thought concerns are only a shorthand for mixins
[10:43:19] roshanavand: has joined #RubyOnRails
[10:43:19] abot_: like an additional layer of abstraction
[10:43:38] sevenseacat: thats exactly what they are, an additional pointless layer of abstraction
[10:43:45] sevenseacat: for no benefit whatsoever
[10:45:18] roshanavand: has joined #RubyOnRails
[10:46:06] hahuang61: has joined #RubyOnRails
[10:46:31] Hyuk: has joined #RubyOnRails
[10:46:39] centrx: has joined #RubyOnRails
[10:47:44] Macaveli_: has joined #RubyOnRails
[10:47:58] Psyko: has joined #RubyOnRails
[10:48:02] Circuit8: has joined #RubyOnRails
[10:48:24] GodFather: has joined #RubyOnRails
[10:49:00] Psyko: Hi, i have a question, since the asset pipeline has a minification feature for javascript files, is it okay if its already minified to put it in the manifest file?
[10:50:24] srinidhi: has joined #RubyOnRails
[10:52:20] abot_: sevenseacat: I see
[10:52:23] liquid-silence: has joined #RubyOnRails
[10:52:23] liquid-silence: has joined #RubyOnRails
[10:52:52] artto: has joined #RubyOnRails
[10:53:51] abot_: sevenseacat: but it might make sense if it's easier to read or avoids repetition, doesn't it?
[10:54:06] abot_: as far as I remember that was the argumentation when I first read about it
[10:54:53] GodFather: has joined #RubyOnRails
[10:55:30] rvanlieshout: Psyko: that's ok
[10:55:42] Psyko: thanks rvalieshout
[10:55:48] Psyko: thanks rvanlieshout
[10:56:53] GodFather: has joined #RubyOnRails
[10:57:42] ksmutthu_: has joined #RubyOnRails
[10:57:59] moeabdol: has joined #RubyOnRails
[11:00:14] Circuit8: Hey guys, getting a strange error with Capybara when I try to test using selenium or capybara-webkit. I have a model that uses paperclip but when I do tests that list them I get the following error: ActionController::RoutingError: No route matches [GET] "/images/thumb/missing.png"
[11:01:23] artto: has joined #RubyOnRails
[11:02:19] kali3: has joined #RubyOnRails
[11:04:13] rodfersou: has joined #RubyOnRails
[11:04:16] adre: has joined #RubyOnRails
[11:06:16] Cervajz: has joined #RubyOnRails
[11:07:02] JakFrist: has joined #RubyOnRails
[11:09:25] blackmesa: has joined #RubyOnRails
[11:14:05] Rodya_: has joined #RubyOnRails
[11:17:10] artto: has joined #RubyOnRails
[11:17:41] artto: has joined #RubyOnRails
[11:18:32] andywww: has joined #RubyOnRails
[11:22:56] artto: has joined #RubyOnRails
[11:25:28] macsteps: has joined #RubyOnRails
[11:26:09] srinidhi: has joined #RubyOnRails
[11:27:56] benlieb: has joined #RubyOnRails
[11:28:41] tgeeky: I'm getting some bizarre behavior with an activerecord model and .first_or_initialize.
[11:28:49] blockchan1: has joined #RubyOnRails
[11:28:50] andywww: when running anyhting that involves loading the environment on my rails app, I’m struggling with really long load times.
[11:28:51] andywww: https://gist.github.com/anonymous/52ec724d0eb2e5c5c4a4cc416872987f
[11:29:11] tgeeky: Namely, it seems to behave properly if the object is already in the database, but it craps out when I need to create a new one (I get a record with all nil values)
[11:29:53] tgeeky: the style that I'm using is the template-array style, ie; ["some_id = ? and something_else = ?", a, b]
[11:30:35] andywww: its taking around 30 seconds to initialise the app for running the rspec suite and also for the most basic of rake tasks (above)
[11:31:17] artto: has joined #RubyOnRails
[11:33:13] centrx: has joined #RubyOnRails
[11:35:15] flashpoint9: has joined #RubyOnRails
[11:36:31] hahuang61: has joined #RubyOnRails
[11:39:00] King_Rex: has joined #RubyOnRails
[11:40:12] banister: has joined #RubyOnRails
[11:42:01] andywww: has left #RubyOnRails: ()
[11:42:06] jerematic: has joined #RubyOnRails
[11:42:30] ElFerna: has joined #RubyOnRails
[11:42:49] allcentury: has joined #RubyOnRails
[11:45:09] mohsenjalalian: has joined #RubyOnRails
[11:48:55] mikecmpbll: has joined #RubyOnRails
[11:49:00] quazimodo: has joined #RubyOnRails
[11:51:19] xvikvi: has joined #RubyOnRails
[11:55:27] abot_: are there any helpers that simplify generating monthly start/end ranges between startdate and enddate?
[11:55:39] norc: workmad3: Well. rack-mini-profiler/flamegraph gave me a clue - it showed that a Net::HTTP module took 5.03s to complete, which was a strong hint for a timeout of sorts (DNS being the obvious candidate because everything ended up working)
[11:57:04] norc: tgeeky: Can you provide some actual code that demonstrates what you were trying to do, expecting to get and got instead?
[11:58:15] tgeeky: norc: I actually made some progress down another route.
[11:58:23] tgeeky: norc: I'll get back if I can't move forward. thanks.
[11:59:34] godzillaenlacasa: has joined #RubyOnRails
[12:01:11] norc: Circuit8: Do you actually have that file present in your testing environment?
[12:04:22] artto: has joined #RubyOnRails
[12:05:09] rubyonrailed: has joined #RubyOnRails
[12:08:38] Circuit8: norc: I have it in my development directory, how do I check if its in my testing environment?
[12:09:02] bbrowning: has joined #RubyOnRails
[12:09:31] norc: Circuit8: gist your config/environments/test.rb please
[12:10:04] artto: has joined #RubyOnRails
[12:11:05] bbrowning_: has joined #RubyOnRails
[12:11:38] workmaster2n: has joined #RubyOnRails
[12:13:46] kknight: has joined #RubyOnRails
[12:15:18] Circuit8: norc: https://gist.github.com/Circuit8/3ed5a8ce8e6355b888d00e2df1afc8ee
[12:16:00] kknight: has joined #RubyOnRails
[12:16:01] norc: Circuit8: Can attach your Gemfile to your gist please?
[12:17:47] hahuang61: has joined #RubyOnRails
[12:18:16] eljimmy: has joined #RubyOnRails
[12:18:17] tgeeky: kali3: don't do it!
[12:19:33] Circuit8: norc: Done thanks
[12:19:45] pawnbox: has joined #RubyOnRails
[12:19:53] Pazician: has joined #RubyOnRails
[12:19:53] Pazician: has joined #RubyOnRails
[12:20:58] norc: Circuit8: btw, did you know that you can attach multiple files to a gist?
[12:21:20] WonyoungJu: has joined #RubyOnRails
[12:21:30] p8m: has joined #RubyOnRails
[12:23:07] norc: Circuit8: Can you attach the test/spec with the full error message to the gist?
[12:24:01] jschoolcraft: has joined #RubyOnRails
[12:24:06] Circuit8: norc: Ah I see thanks. Yeah let me get it
[12:24:25] mohsenjalalian: hi i use rspec to test my model . i use with_options for my validations i want to know how can i test my validations ?
[12:25:18] flashpoint9: has joined #RubyOnRails
[12:25:56] refinerysource: has joined #RubyOnRails
[12:26:32] Circuit8: mohsenjalalian: Try shoulda-matchers gem
[12:27:01] mohsenjalalian: is it possible to do that with shoulda?
[12:27:17] norc: mohsenjalalian: Specify valid/invalid subjects and then test for" expect(obj).to be_valid for example
[12:27:29] pawnbox_: has joined #RubyOnRails
[12:27:41] allcentury: has joined #RubyOnRails
[12:28:25] norc: mohsenjalalian: Make sure you wrap the logic to construct a valid object inside a factory, so you can reuse it in other specs.
[12:29:41] wd40s: has joined #RubyOnRails
[12:31:54] DaniG2k: has joined #RubyOnRails
[12:32:04] chouhoulis: has joined #RubyOnRails
[12:32:06] kali3: has joined #RubyOnRails
[12:33:34] chouhoulis: has joined #RubyOnRails
[12:33:59] mohsenjalalian: norc could you give me more explain please ? or any example
[12:34:42] Circuit8: norc: I've added the error to the gist
[12:34:46] norc: mohsenjalalian: Well, let's say you know how to specify that a model is valid. You put that into a factory
[12:35:20] Circuit8: mohsenjalalian: Yeah google the shoulda-matchers gem
[12:35:31] norc: mohsenjalalian: You can then have something like: subject { FactoryGirl.create(:user, :valid) } expect(subject).to be_valid
[12:35:41] norc: mohsenjalalian: you could then use that same factory in another spec when you want a valid user.
[12:36:08] norc: Circuit8: You forgot the spec
[12:37:01] diegoaguilar: has joined #RubyOnRails
[12:38:41] ferr: Anyone familiar with ransack?
[12:38:42] ferr: https://gist.github.com/Fercell/6bd798a7ba407e5fd7b9371e03347442
[12:39:04] Malgorath: has joined #RubyOnRails
[12:39:38] lessless: has joined #RubyOnRails
[12:39:57] Malgorath: Are there any certifications for ruby and/or RoR? My work wants me to get certs every year and I was wondering if there were any for RoR that are worth while?
[12:40:37] alfiemax: has joined #RubyOnRails
[12:40:49] norc: Malgorath: The best certification you can have is your github profile I would say.
[12:41:02] norc: For either.
[12:41:31] Malgorath: norc: true, but thats not a thing they will recognize saddly.
[12:42:23] jas02: has joined #RubyOnRails
[12:42:46] DTZUBDUB: has joined #RubyOnRails
[12:43:07] jerematic: has joined #RubyOnRails
[12:44:15] tknz: has joined #RubyOnRails
[12:47:58] artto: has joined #RubyOnRails
[12:48:08] workmad3: Malgorath: look through the stuff your work makes available and just pick stuff you're vaguely interested in
[12:48:46] workmad3: Malgorath: it's unlikely there'll be anything for RoR, and it's unlikely any certification available would be worthwhile in that area anyway
[12:48:52] Circuit8: norc: Sorry, I've added it now
[12:49:30] fmcgeough: has joined #RubyOnRails
[12:50:03] Malgorath: workmad3: I kinda figured as much, was hoping but I know development in RoR isn't a usally certifiable thing. Thanks anyways folks.
[12:50:24] chouhoul_: has joined #RubyOnRails
[12:51:10] norc: Malgorath: You could look for certification in other areas, perhaps security oriented.
[12:51:18] norc: Malgorath: Or methodology (agile methods)
[12:52:57] Malgorath: norc: I was thinking of that already but just wanted to be sure there were no options with RoR first
[12:53:06] Malgorath: norc: thanks for the idea though :D
[12:53:44] mohsenjalalian: norc my model is something like this http://www.laptopyenbai.com/questions/4963246/rspec-validation-tests-on-update
[12:53:50] norc: Malgorath: Another thing could be ITIL or PRINCE oriented. There are some folks around that *love* those certifications.
[12:54:00] mohsenjalalian: i have with_options
[12:54:07] norc: *PRINCE2 I mean ofc.
[12:55:28] pawnbox: has joined #RubyOnRails
[12:56:11] triptec: has joined #RubyOnRails
[12:56:30] DaniG2k: has joined #RubyOnRails
[12:59:04] ramortegui: has joined #RubyOnRails
[12:59:59] dcluna: has joined #RubyOnRails
[13:01:05] quazimodo: has joined #RubyOnRails
[13:03:01] benlieb: has joined #RubyOnRails
[13:07:54] FailBit: has joined #RubyOnRails
[13:08:15] hahuang61: has joined #RubyOnRails
[13:08:44] GodFather: has joined #RubyOnRails
[13:09:44] alfiemax: has joined #RubyOnRails
[13:09:53] FailBit: happening status: it's
[13:11:15] macsteps: has joined #RubyOnRails
[13:11:23] dblessing: has joined #RubyOnRails
[13:11:59] Circuit8: norc: The error seems to be getting raised on the product_edit_spec line 60. The strange thing is that if i put binding.pry before `click_link product.name` I can then call `click_link product.name` and all works as expected. However when I put the binding.pry on the line after `click_link product.name` the spec never goes into pry as it raises an error on the previous line...
[13:12:19] workmad3: norc: why would you want to inflict PRINCE2 on someone? :(
[13:12:53] FailBit: party like it's 2016
[13:12:53] kgrz: has joined #RubyOnRails
[13:13:35] aegis3121: has joined #RubyOnRails
[13:13:59] norc: workmad3: When people start caring about certifications it is really hard to avoid it. :-P
[13:14:26] wilsonc91: has joined #RubyOnRails
[13:14:29] norc: Circuit8: You sir have discovered a Heisenbug.
[13:14:42] norc: That has got to be the first I have heard about in Ruby.
[13:15:02] sebstrax: has joined #RubyOnRails
[13:15:29] Circuit8: norc: I don't know whether to feel proud or ashamed
[13:15:46] Circuit8: norc: but I'm sure the source of the problem is standing in front of the keyboard
[13:15:51] norc: Circuit8: That depends. If nobody is observing you you are both.
[13:15:57] Circuit8: norc: hahaha
[13:16:24] FailBit: bah that's schrodinger
[13:17:51] Circuit8: FailBit: Close enough
[13:18:01] apotry: has joined #RubyOnRails
[13:18:04] Circuit8: norc: Do you have any ideas for debugging this
[13:18:20] norc: Circuit8: Some.
[13:19:12] norc: Circuit8: Ruby is not prone to the same causes for Heisenbugs in C aside from one thing: Race conditions.
[13:19:43] Circuit8: Right, so its something to do with capybara running in parallel?
[13:19:54] ekinmur: has joined #RubyOnRails
[13:20:56] harfangk: we whould make real capybaras do a race
[13:22:08] Circuit8: norc: Just to confirm, its working completely as expected in my browser
[13:22:30] norc: Circuit8: Have your rspec debug print product.name and then pry into it, see if its the same.
[13:22:45] norc: Circuit8: I'm thinking that a race condition might change product.name causing the change in behaviour.
[13:23:08] Circuit8: norc: OK, I'll do that on the line before the bug
[13:24:07] artto: has joined #RubyOnRails
[13:24:27] Circuit8: norc: Just going to do a quick restart first, brb
[13:24:57] norc: Circuit8: also be sure to tail your test log while prying into rspecs
[13:25:05] Psyko: has joined #RubyOnRails
[13:26:04] Circuit8: has joined #RubyOnRails
[13:26:50] norc: Circuit8: Oh! I think we have been tracking the wrong problem.
[13:26:51] Circuit8: norc: They both printed out the same value
[13:27:19] Circuit8: norc: Whats that?
[13:27:42] norc: Circuit8: Should have paid more attention. I think the routing error is unrelated to the issue.
[13:27:53] norc: Circuit8: https://gist.github.com/Circuit8/3ed5a8ce8e6355b888d00e2df1afc8ee#file-error-rb-L38-L40
[13:28:43] Circuit8: norc: Ah OK let me see...
[13:29:12] norc: Perhaps rspec is trying to help you by finding a matching error from the server logs, and while its confusing why it would appear at all - it is completely unrelated to the problem that capybara has.
[13:29:35] norc: Or perhaps it is.
[13:29:53] norc: (Since it is possible it might be looking at an error page due to the routing herror)
[13:29:55] IFrank00: has joined #RubyOnRails
[13:30:16] IFrank004: has joined #RubyOnRails
[13:30:31] Circuit8: Ah OK I see what your saying
[13:31:09] Circuit8: Well then the weird thing is if I binding.pry on the line before that error, then execute the same command that would have caused the error. Everything works as expected, `current_url` returns the value I would have expected
[13:31:35] Circuit8: norc: So I don't know why it would end up on an error page at all
[13:33:13] David_H_Smith: has joined #RubyOnRails
[13:35:37] macsteps: has joined #RubyOnRails
[13:36:19] ldnunes: has joined #RubyOnRails
[13:36:24] tildes: Malgorath: there are database certs, which could be useful now/later, you could also check if MOOCs / other courses count as certs with your employer
[13:37:01] norc: Circuit8: Would you happen to have assets precompiled by any chance?
[13:37:18] tildes: Malgorath: something related to requirements engineering might be useful too
[13:37:38] norc: Circuit8: nevermind, that has nothing to do with it
[13:37:51] centrx: has joined #RubyOnRails
[13:38:09] tildes: Personally I would go for PRINCE2 / PMP and similar project management certs only if I wanted to work as a project manager
[13:38:36] tildes: something agile/scrum related could be useful nevertheless
[13:38:45] artto: has joined #RubyOnRails
[13:39:19] lukandel: has joined #RubyOnRails
[13:39:32] tildes: (and ITIL is dearly loved by some... for instance application management area might be something)
[13:42:10] GodFather: has joined #RubyOnRails
[13:42:28] mikecmpb_: has joined #RubyOnRails
[13:44:36] triptec: has joined #RubyOnRails
[13:44:36] dunpeal: has joined #RubyOnRails
[13:45:09] dunpeal: Hi. What's the proper way to generate a new model in Rails 4?
[13:45:44] sevenseacat: `rails g model`
[13:46:01] lukandel: Hi I'm trying to run this migration (with the mongoid gem) http://pastie.org/10866404 It fails with this error: http://pastie.org/10866406
[13:48:02] Circuit8: norc: I'm tailing the test logs and putting some info at the key points to it so I'll see if that uncovers anything
[13:48:17] jas02: has joined #RubyOnRails
[13:48:46] dunpeal: sevenseacat: thanks
[13:49:20] wilsonc91: has joined #RubyOnRails
[13:50:09] workmad3: dunpeal: or `vim app/models/whatever.rb` and add `class Whatever` to it
[13:50:17] norc: Circuit8: Perhaps someone actually knowledgeable with Rails/Capybara might be able to help better. My experience here is more limited to pure Ruby.
[13:50:25] workmad3: (feel free to replace 'vim' with your text editor of choice ;) )
[13:50:43] norc: workmad3: Real programmers use butterflies..
[13:51:06] dunpeal: workmad3: which method makes the most sense, give I already created a migration for this new model?
[13:51:24] dunpeal: also, do I have to specify foreign keys in the model or migration?
[13:51:26] norc: dunpeal: I would just create the files manually as it gives you control over what you need.
[13:51:32] norc: dunpeal: Both!
[13:51:35] soroot: Hi I'm trying to run this migration (with the mongoid gem) http://pastie.org/10866404 It fails with this error: http://pastie.org/10866406 any ideas?
[13:51:53] norc: dunpeal: The model validates and the database enforces. The last is more important for integrity, the first is just useful for pretty errors in the right places.
[13:52:03] workmad3: dunpeal: you need to add the foreign keys in the migration, so that they're in your schema... and you need to add `belongs_to :blah` in your model so you have access to the association in rails
[13:52:24] dunpeal: thanks guys, will add to both.
[13:52:41] artto: has joined #RubyOnRails
[13:53:00] DragonPunch: has joined #RubyOnRails
[13:53:15] workmad3: dunpeal: and then yeah, adding an actual foreign key constraint in your database allows the DB to enforce your data integrity
[13:53:19] kies: has joined #RubyOnRails
[13:53:59] blockchan: has joined #RubyOnRails
[13:54:56] JosephBradshaw: has joined #RubyOnRails
[13:55:09] frem_: has joined #RubyOnRails
[13:55:10] artto: has joined #RubyOnRails
[13:56:23] norc: soroot: Based on the stack trace I'd say you have another ActiveRecord::Migration that rake is choking on.
[13:56:47] norc: soroot: But I might be wrong, I have no idea how Mongoid works.
[13:57:23] moeabdol: has joined #RubyOnRails
[13:57:59] artto: has joined #RubyOnRails
[13:58:32] norc: soroot: And if it is the right migration, then you have ActiveRecord components. Either way you have a real conflict.
[13:58:32] soroot: norc: nope the db folder is empty except for that one
[13:58:59] norc: soroot: Then you did not set up your Rails application correctly (you need --skip-active-record)
[14:00:00] mohsenjalalian: has joined #RubyOnRails
[14:02:45] rubyonrailed: has joined #RubyOnRails
[14:05:39] Rodya_: has joined #RubyOnRails
[14:05:46] msyvich: has joined #RubyOnRails
[14:06:00] msyvich: is there a document somewhere which lists the default variables available to a view template?
[14:06:07] msyvich: e.g. i want to know how to access the action name
[14:07:30] chouhoulis: has joined #RubyOnRails
[14:07:56] lessless: has joined #RubyOnRails
[14:08:05] tbuehlmann: msyvich: I don't think there's such a document. also: action_name
[14:08:21] norc: msyvich: The instance variables you set up in your controller, beyond that you have *methods* that are available.
[14:09:15] dandaman: has joined #RubyOnRails
[14:09:28] lightt: has joined #RubyOnRails
[14:09:39] norc: msyvich: Why do you feel the need to have the action name in a view if you dont mind my asking?
[14:11:27] msyvich: norc: it influences a link value
[14:11:45] msyvich: tbuehlmann, thanks. getting weird behavior and i suspected that wasn't working... i'll try again
[14:13:29] openstruct: has joined #RubyOnRails
[14:14:54] kgrz: has joined #RubyOnRails
[14:20:31] agent_white: has joined #RubyOnRails
[14:26:14] damireh: has joined #RubyOnRails
[14:27:06] rickmasta: has joined #RubyOnRails
[14:28:37] Cervajz: has joined #RubyOnRails
[14:29:13] yellow5: has joined #RubyOnRails
[14:38:36] kali3: has joined #RubyOnRails
[14:41:18] spyder55: has joined #RubyOnRails
[14:42:16] damireh: has joined #RubyOnRails
[14:43:28] Malgorath: Anyone here able to help me with an engine model relationship to a host app model? I have a completed_by field in a table that should be linked to the User model from the host app, not sure how to make this link out, do I just do a belongs_to :user in the engine model?
[14:43:34] DTZUBDUB: has joined #RubyOnRails
[14:43:39] dunpeal: After I create a migration, can I just see the schema change it will effect, without actually applying it?
[14:43:48] smathy: has joined #RubyOnRails
[14:44:05] terrabl: has joined #RubyOnRails
[14:45:31] polishdub: has joined #RubyOnRails
[14:45:58] centrx: dunpeal: --dry-run
[14:47:38] jnoob22: has joined #RubyOnRails
[14:47:38] Spami: has joined #RubyOnRails
[14:47:43] dunpeal: centrx: it doesn't seem to do anything...
[14:47:50] dunpeal: rake db:migrate --dry-run
[14:48:21] terrabl: Hey guys, I am attempting to fix a bug in my ruby on rails form that will allow for a user to submit a first and last name to a database, i know this is simple but I am trying to get it to work before making it more complicated than it needs to be. At the moment I am getting a undefined local variable or method `student_params' for #<StudentsController:0x9468798> error in my code, you can find a gist of the relevant files here:
[14:48:21] terrabl: https://gist.github.com/terrabl/dd6eacea8685929e9754c5baee68cc6a
[14:49:04] sevenseacat: seems like a pretty straightforward error
[14:49:10] sevenseacat: you have not defined a student_params method
[14:49:37] centrx: dunpeal: Do you want to just see what migrations will run, or do you want to see the actual SQL that will run?
[14:49:47] dunpeal: centrx: the latter
[14:50:24] JesseH: has joined #RubyOnRails
[14:50:38] terrabl: sevemseacat: is it bad if i dont know how to do that? Could you point me to a guide in which someone creates a params method inside their controller?
[14:50:39] centrx: dunpeal: Looks like nothing native for that - http://stackoverflow.com/questions/15852872/show-sql-generated-by-pending-migrations-in-rails-without-updating-the-database
[14:50:48] dunpeal: centrx: thanks
[14:51:17] macsteps: has joined #RubyOnRails
[14:51:41] sevenseacat: terrabl: http://guides.rubyonrails.org/getting_started.html#saving-data-in-the-controller
[14:53:55] kali3: has left #RubyOnRails: ("Leaving")
[14:56:23] chipotle: has joined #RubyOnRails
[14:57:04] jancel: has joined #RubyOnRails
[14:59:17] artto: has joined #RubyOnRails
[15:00:01] kitsuneyo: has joined #RubyOnRails
[15:00:38] msyvich: has joined #RubyOnRails
[15:01:17] kitsuneyo: select2-rails still a good choice for form combo boxes?
[15:01:22] artto: has joined #RubyOnRails
[15:01:45] terrabl: Thank you sevenseacat, I was able to fix it with your help and that article.
[15:02:42] prithaj: has joined #RubyOnRails
[15:03:18] artto: has joined #RubyOnRails
[15:04:38] tjohnson: has joined #RubyOnRails
[15:05:17] artto: has joined #RubyOnRails
[15:06:28] adavia: has joined #RubyOnRails
[15:08:02] Rodya_: has joined #RubyOnRails
[15:08:36] AaronTheWhite: has joined #RubyOnRails
[15:08:38] GodFather: has joined #RubyOnRails
[15:10:14] disgrntld: has joined #RubyOnRails
[15:11:27] chouhoulis: has joined #RubyOnRails
[15:12:26] chouhoulis: has joined #RubyOnRails
[15:17:23] jimbeaudoin: has joined #RubyOnRails
[15:19:17] HalcyonicStorm: has joined #RubyOnRails
[15:22:16] hahuang61: has joined #RubyOnRails
[15:23:14] harfangk: has joined #RubyOnRails
[15:23:52] tvw: has joined #RubyOnRails
[15:25:40] kitsuneyo: hi AaronTheWhite
[15:25:53] GarethAdams: has joined #RubyOnRails
[15:27:06] xvikvi: has joined #RubyOnRails
[15:27:31] xvikvi: has left #RubyOnRails: ()
[15:28:11] xvikvi: has joined #RubyOnRails
[15:28:47] yogeshrt: has joined #RubyOnRails
[15:29:51] macsteps: has joined #RubyOnRails
[15:32:50] aegis3121: has joined #RubyOnRails
[15:34:36] Leepoff: has joined #RubyOnRails
[15:37:03] lxsameer: has joined #RubyOnRails
[15:37:23] urkle: has joined #RubyOnRails
[15:38:29] kgrz: has joined #RubyOnRails
[15:41:59] ProofTechnique: has joined #RubyOnRails
[15:42:18] jancel: has joined #RubyOnRails
[15:44:19] macsteps: has joined #RubyOnRails
[15:47:05] brendan-_: has joined #RubyOnRails
[15:49:19] harfangk: has joined #RubyOnRails
[15:51:24] diegoviola: has joined #RubyOnRails
[15:51:42] mdw: has joined #RubyOnRails
[15:54:27] davidw: has joined #RubyOnRails
[15:54:58] triptec: has joined #RubyOnRails
[15:58:15] msyvich: has joined #RubyOnRails
[16:00:45] jancel: has joined #RubyOnRails
[16:01:49] norc: has joined #RubyOnRails
[16:01:50] dblessing: has joined #RubyOnRails
[16:02:23] cd83xx: has joined #RubyOnRails
[16:04:04] hahuang61: has joined #RubyOnRails
[16:04:49] lightt: has joined #RubyOnRails
[16:07:15] whathappens: has joined #RubyOnRails
[16:08:16] artto: has joined #RubyOnRails
[16:09:08] alfiemax: has joined #RubyOnRails
[16:10:35] Cohedrin: has joined #RubyOnRails
[16:11:11] tildes_: has joined #RubyOnRails
[16:11:14] zave: has joined #RubyOnRails
[16:13:24] Mattx: has joined #RubyOnRails
[16:13:35] Mattx: Hello! I'm getting this error: Cannot load `Rails.application.database_configuration`: undefined method `adapter' for nil:NilClass
[16:14:02] Mattx: Rails is configured to used Postgresql, and this code was working just fine a few days ago
[16:14:08] agit0: has joined #RubyOnRails
[16:14:17] Mattx: what could it be? I'm not finding anything relevant on the internet
[16:14:37] norc: Mattx, gist your database.yml please
[16:15:39] norc: Mattx, also, what exact command are you invoking to provoke this error, and include the *complete* output (including stack traces) in the gist
[16:16:09] badoo: has joined #RubyOnRails
[16:18:05] mdw: has joined #RubyOnRails
[16:20:01] Mattx: norc, https://gist.github.com/anonymous/73ed7ee0332b0c67551a0a59b5dbbd62
[16:21:17] gingray: has joined #RubyOnRails
[16:21:55] Spami_: has joined #RubyOnRails
[16:23:50] Mattx: any idea?
[16:24:30] lupine: is that yaml valid? i've never been up on yaml templating
[16:24:42] lupine: I'd suggest running it through YAML.load and seeing what hash comes out
[16:25:18] GodFather: has joined #RubyOnRails
[16:25:23] Circuit8: norc: Hey just to let you know I sorted out the issue. Essentially, although the error message was confusing it was due to the lack of a default image for paperclip, the image I had was in the wrong folder so once that was switched it all got sorted
[16:25:34] Circuit8: norc: Thanks very much for your help in debugging
[16:25:51] norc: Circuit8, oh bugger.
[16:26:04] norc: Circuit8, well glad you found it.
[16:26:06] Mattx: lupine, it is of course, I've used this file for months. it's just now that it's throwing an error for whatever reason
[16:26:11] Mattx: but the syntax is ok
[16:26:25] Circuit8: norc: thanks :)
[16:27:44] lupine: yeah, it parses fine
[16:27:47] norc: Mattx, add your config/application.rb then
[16:28:03] norc: Mattx, and your config/environments/whatever_you_are_running_in.rb
[16:28:36] Mattx: ok, one sec
[16:32:32] sneakerh_: has joined #RubyOnRails
[16:33:02] norc: ACTION totally expects a: "Im getting the following error: No such file or Directory: config/environments/whatever_you_are_running_in.rb" 
[16:33:06] Dimik: has joined #RubyOnRails
[16:34:09] Mattx: Nope, that's not the problem. I was running bundle install just in case
[16:34:38] tubbo: Mattx: what changed? did you upgrade ruby?
[16:34:47] norc: Mattx, also. You are using git right?
[16:35:15] norc: If so and it was a code change, use git-bisect.
[16:35:39] Mattx: Yes, I'm using git. I never used that command, let me check
[16:36:06] Mattx: I think nothing changed, I can't remember any relevant change
[16:36:17] norc: If nothing changed then the bug has always been there.
[16:36:28] norc: Or you manually patched some gems..
[16:37:22] norc: But let git-bisect be the judge of that.
[16:38:08] [Butch]: has joined #RubyOnRails
[16:38:59] lxsameer: has joined #RubyOnRails
[16:41:07] dcluna: has joined #RubyOnRails
[16:42:23] Mattx: well, never mind. I'll create a new rails app and compare all files or use bisect for that. thanks guys
[16:42:26] triptec: has joined #RubyOnRails
[16:42:33] terrabl: What is the best way of submitting checkboxes to mysql in rails, would I just have as many different columns as I have checkboxes?
[16:43:10] smathy: terrabl, sounds like you really need to work through a Rails tutorial maybe.
[16:43:13] djbkd: has joined #RubyOnRails
[16:43:23] norc: Mattx, or you know.. you could use git-bisect. But why do I care whether you know about your tools or not.
[16:44:03] terrabl: I'm pretty new and basically learning as I'm going through, I just am having trouble in how to set up this post request that uses check boxes.
[16:44:39] centrx: has joined #RubyOnRails
[16:45:04] smathy: terrabl, reason I suggested a tutorial was because your question communicates a fundamental lack of understanding that won't be helped by just solving this one problem for you.
[16:45:34] DTZUBDUB: has joined #RubyOnRails
[16:46:21] terrabl: Hmm, what do you mean?
[16:46:38] sk0r: has joined #RubyOnRails
[16:46:59] manfrin: has joined #RubyOnRails
[16:47:33] shinnya: has joined #RubyOnRails
[16:47:36] mwlang: has joined #RubyOnRails
[16:48:37] Mattx: norc, I've never used git bisect, I'll give it a try. thanks
[16:48:52] moeabdol: has joined #RubyOnRails
[16:49:33] roqo: has joined #RubyOnRails
[16:51:36] moeabdol1: has joined #RubyOnRails
[16:51:36] macsteps: has joined #RubyOnRails
[16:53:04] N1njturt1e: has joined #RubyOnRails
[16:55:58] choke: has joined #RubyOnRails
[16:59:08] hahuang61: has joined #RubyOnRails
[17:02:11] aegis3121: has joined #RubyOnRails
[17:06:51] tubbo: terrabl: you might find that you learn things faster when someone is guiding you through each step. a tutorial will do that for you, but you'll learn much slower if you just keep asking questions here or browse SO all the time.
[17:07:03] DTZUBDUB: has joined #RubyOnRails
[17:07:56] aegis3121: has joined #RubyOnRails
[17:08:45] weaksauce: has joined #RubyOnRails
[17:08:52] HalcyonicStorm: has left #RubyOnRails: ()
[17:09:13] sk0r: has joined #RubyOnRails
[17:09:17] mdw7: has joined #RubyOnRails
[17:09:42] soroot: has joined #RubyOnRails
[17:09:44] darkxploit: has joined #RubyOnRails
[17:12:18] Coldblackice: has joined #RubyOnRails
[17:15:55] rakm: has joined #RubyOnRails
[17:16:11] yellow5: has joined #RubyOnRails
[17:16:50] kdough: has joined #RubyOnRails
[17:17:08] qejk: has joined #RubyOnRails
[17:17:57] soroot: has joined #RubyOnRails
[17:18:02] blockchan: has joined #RubyOnRails
[17:21:04] crystal77: has joined #RubyOnRails
[17:21:21] Wolland: has joined #RubyOnRails
[17:23:05] DragonPunch: has joined #RubyOnRails
[17:23:15] DoctorMonocular: has joined #RubyOnRails
[17:24:22] centrx: has joined #RubyOnRails
[17:24:32] sypheren: has joined #RubyOnRails
[17:25:50] rogue_koder: has joined #RubyOnRails
[17:26:49] scrnndd: has joined #RubyOnRails
[17:27:23] blockchan: has joined #RubyOnRails
[17:27:27] moeabdol2: has joined #RubyOnRails
[17:29:28] scrnndd: Hey there. If I have a relatively simple UI, with no realtime updates and just a few ajax stuff going on, is there any reason to go with a SPA?
[17:29:34] IFrank004: has joined #RubyOnRails
[17:29:35] IFrank00: has joined #RubyOnRails
[17:29:40] scrnndd: It seems to be the standard for a lot of people these days.
[17:30:00] chouhoul_: has joined #RubyOnRails
[17:31:44] chouhoul_: has joined #RubyOnRails
[17:32:34] Zarathu: has joined #RubyOnRails
[17:33:03] Zarathu: ACTION stretches
[17:34:21] adre: has joined #RubyOnRails
[17:35:26] dblessing: has joined #RubyOnRails
[17:35:36] Leepoff: has joined #RubyOnRails
[17:36:08] DragonPunch: has joined #RubyOnRails
[17:36:09] lxsameer: has joined #RubyOnRails
[17:38:53] tubbo: scrnndd: i suppose if you can't see the use case for building a complex SPA, then you probably don't need to do it.
[17:41:19] dblessing: has joined #RubyOnRails
[17:41:53] meoblast001: has joined #RubyOnRails
[17:44:17] yogeshrt: has joined #RubyOnRails
[17:44:38] Moeh: has joined #RubyOnRails
[17:45:54] Quintasan: has joined #RubyOnRails
[17:47:26] SteenJobs: has joined #RubyOnRails
[17:48:02] scrnndd: tubbo: thanks!
[17:48:31] SteenJobs: anyone have cap 3 set up with separate prod and staging deploy files that they can gist to me? the previous developer just kept swapping out the server IP in the global deploy.rb file, which makes keeping a production branch on git a miserable task
[17:48:48] SteenJobs: and just wanna make sure i set up the separate staging env configs properly
[17:49:08] clandry94: has joined #RubyOnRails
[17:49:17] tubbo: scrnndd: no problem. personally i've been using a SPA because i want to eventually build it as a native app for multiple platforms.
[17:49:53] jayc0b0: has joined #RubyOnRails
[17:50:21] tubbo: SteenJobs: https://gist.github.com/tubbo/6f34d7c6ab179087cef71052faf2f8df is what i us
[17:51:12] smathy: SteenJobs, or just follow the docs: http://capistranorb.com/documentation/getting-started/preparing-your-application/
[17:51:26] smathy: Multi-env is the default now really.
[17:51:42] SteenJobs: smathy: if i wanted to hear a reasonable response, i would’ve asked you directly
[17:51:54] SteenJobs: tubbo: sweeeet, thanks.
[17:51:58] SteenJobs: right so here’s the q
[17:52:16] SteenJobs: seems you just define global values in deploy.rb, and env specific in the env specific deploy files - BUT
[17:52:31] SteenJobs: if i define a value in both, which overrides which?
[17:52:41] IFrank004: has joined #RubyOnRails
[17:52:41] IFrank00: has joined #RubyOnRails
[17:52:42] j3r0: has joined #RubyOnRails
[17:53:40] tubbo: SteenJobs: well if you define a value in deploy.rb, and then you make a config/deploy/staging.rb, and you set your stage to 'staging' (by doing `cap staging deploy`), then the deploy/staging.rb config will override deploy.rb
[17:54:52] SteenJobs: tubbo: perfect. right now deploy/staging.rb and deploy/production.rb are empty, yet cap still forced me to run cap production deploy, so i presume it just deployed by defaulting to config/deploy.rb
[17:55:01] SteenJobs: tubbo: if the above is true, then i can leave deploy.rb untouched bec it works now
[17:55:08] blackjid: has joined #RubyOnRails
[17:55:18] SteenJobs: and just add my overrides for staging/production to the individual deploy files
[17:55:23] JakFrist: has joined #RubyOnRails
[17:55:32] tubbo: SteenJobs: capistrano requires stages now, which kinda make sense. basically if you follow the 12-factor app philosophy, those files should essentially just tell capistrano what IP to deploy to.
[17:55:40] tubbo: everything else should be the same between staging and production
[17:56:07] smathy: Sometimes we have a separate DB host in prod.
[17:57:03] SteenJobs: tubbo: right - the other dev who did this setup was just changing the global deploy.rb, which is making things a git nightmare every time i need to switch which server i want to deploy to. there are three values that differe between the two: 1) server IP; 2) :user; 3) :honeybadger_env
[17:57:19] smathy: Can you stop calling that fool a dev please.
[17:57:26] SteenJobs: so i’m hoping i can leave config/deploy.rb the way it is and just add specific values for those 3 things to each of the config/deploy/* files
[17:57:39] smathy: The docs really do cover this nicely.
[17:57:56] tubbo: smathy: rails reads $DATABASE_URL
[17:58:23] SteenJobs: he’s actually the man honestly, and until he came along i was the only dev, and given that my bosses are the most technically inept people, this guy was a godsend. also he always had my back since i have yet to learn how to protect myself in the working world haha
[17:58:26] smathy: Hmm, we moved from cap 2 to cap 3, maybe we missed that option for the deploy.
[17:58:33] yellow5: has joined #RubyOnRails
[17:58:40] SteenJobs: my guess is he was planning on fixing this but quit before he got the chance
[17:58:51] SteenJobs: since he has a great day job, he could afford to quit...
[17:59:29] SteenJobs: and since this is my first gig really (well over a year at this point), i’m dependent on my current bosses for references if i were to switch jobs, which is a bit of a catch 22 re quitting
[17:59:47] SteenJobs: but he told me he’s got me if i need a reference and wrote me the best reference on linkedin!! woohoo
[18:00:01] SteenJobs: smathy: aright cool - i’ll hit the docs
[18:00:14] SteenJobs: since i’m new to server config, i figured i’d verify with you guys before making any mistakes
[18:00:22] centrx: has joined #RubyOnRails
[18:01:06] jayc0b0: Hello, I have a somewhat complex question. I'm a bit new to Rails, so if there is some easy way to do this, please forgive me. Basically, I'm making a form for people to request a quote for some model number of a machine, with a certain features/options they pick from a list. Basically, there is a button for each model of the product, which, when clicked renders a partial that is basically a table
[18:01:08] jayc0b0: listing the feature, featre id, and price. Below, I have a form for contact information, which is passed to a mailer and sent to my client, essentially saying "Hey, you have a new quote request from Person X, for Model Number Y, with features A, B, and C." What I would like to do is iterate over the table, grabbing the feature id's for the table rows that have a checked checkbox in them, and pass them to
[18:01:09] jayc0b0: an array (which goes into a serialized field in my model for quote requests) when the submit button for the form below (which is for quote requests) is clicked. After that, I will process the selected options when the email is made and sent. I just need to grab those id's to access the information. What would be the best way to do this? I am sorry that this is really long and/or if this is really simple.
[18:01:44] jayc0b0: I can put the relevant code in a gist, if that would help.
[18:01:49] SteenJobs: smathy: they didn’t specify which (global/not-global) takes priority, so that was helpful to know
[18:01:52] antgel: has joined #RubyOnRails
[18:01:54] SteenJobs: jayc0b0: gisting rarely hurts!
[18:02:24] jayc0b0: Alright. I'll put the relevant view and partials in there. Any other code that would help?
[18:03:19] djbkd: has joined #RubyOnRails
[18:07:14] srinidhi: has joined #RubyOnRails
[18:07:45] flashpoint9: has joined #RubyOnRails
[18:09:04] smathy: SteenJobs, sorry, I missed that you were confused by that.
[18:10:53] antgel: has joined #RubyOnRails
[18:11:08] whathappens: has joined #RubyOnRails
[18:11:59] IFrank00: has joined #RubyOnRails
[18:12:09] IFrank004: has joined #RubyOnRails
[18:12:53] jayc0b0: Alright, I made the gist
[18:12:56] jayc0b0: https://gist.github.com/jayc0b0/29b66ebed25ba8c10581d8e1986d71f9
[18:13:08] jayc0b0: Going over my code again, I think I might have figured something out, though
[18:13:19] jayc0b0: When I make the checkbox, I use the option number
[18:13:35] jayc0b0: Would I be able to easily extract that when I iterate over my table?
[18:13:44] arBmind: has joined #RubyOnRails
[18:15:48] jayc0b0: I guess my main question here has become a matter of how to call a javascript function that finds and extracts info from my checked checkboxes when that submit button is pressed.
[18:17:27] SteenJobs: tubbo, smathy: what about staging/production specific values in application.yml (for example stripe test vs live api keys)? im gonna swap it out for some good env vars configuration…but since this needs to be deployed in less than an hour, gonna do it later.
[18:17:34] k3rn31: has joined #RubyOnRails
[18:19:41] dcluna: has joined #RubyOnRails
[18:20:14] SteenJobs: jayc0b0: what are you trying to do exactly - i’ll take a look at the gist in a few, but sounds like you’re trying to generate checkboxes for various pre-seeded options, and commit which options the user selected?
[18:20:26] [Butch]: has joined #RubyOnRails
[18:20:50] triptec: has joined #RubyOnRails
[18:20:53] jayc0b0: I could provide a screenshot, if that would clarify things.
[18:21:33] jayc0b0: I'll annotate it to clarify functionality
[18:22:35] SteenJobs: jayc0b0: i’ve done something similar before - so lemme know what you’re doing and i’ll take a look at the gist - just gimme a few, gotta finish up what i’m working on - have a deadline in 38 minutes.
[18:22:56] jayc0b0: Ah. Alright.
[18:23:22] IFrank00: has joined #RubyOnRails
[18:23:22] IFrank004: has joined #RubyOnRails
[18:23:27] SteenJobs: jayc0b0: hopefully will be done quickly
[18:23:54] smathy: SteenJobs, things like keys should be only on your server, in your env vars.
[18:23:58] djbkd: has joined #RubyOnRails
[18:24:04] smathy: ...not in any deploy file in the repo.
[18:24:25] browndawg: has joined #RubyOnRails
[18:24:53] jayc0b0: Basically, I'm trying to figure out a good way to call a javascript or other function that goes through the generated table partial, grabbing option id's from the rows with a checked checkbox, and putting them into the options params for a quote request as an array, which I will use to generate a list of options the customer wants.
[18:24:56] SteenJobs: smathy: ya ya i know - hence the going to move everything over to env vars. right now it’s a private repo, so as soon as i get this deployed, i’m gonna switch over to env vars and scrub the repo
[18:25:06] browndawg: I'm diving into Rails 5 api only mode. Could someone tell me how I should go about testing it?
[18:25:09] jayc0b0: I'll provide that screenshot to clarify a bit.
[18:25:39] choke: has joined #RubyOnRails
[18:27:16] SteenJobs: jayc0b0: sounds good
[18:27:28] whathapp_: has joined #RubyOnRails
[18:27:37] soroot: has joined #RubyOnRails
[18:28:20] nikger: has joined #RubyOnRails
[18:28:35] nikger: what is the best vimrc config for rails dev?
[18:28:42] whathappens: has joined #RubyOnRails
[18:28:59] cschneid: has joined #RubyOnRails
[18:29:57] tildes_: has joined #RubyOnRails
[18:30:24] nikger: has left #RubyOnRails: ()
[18:30:38] nikger: has joined #RubyOnRails
[18:30:52] jayc0b0: Alright SteenJobs, here's the screenshot. Hopefully it clears up what I'm trying to do.
[18:30:55] jayc0b0: http://imgur.com/WDyxhg6
[18:33:46] centrx: has joined #RubyOnRails
[18:34:35] chouhoulis: has joined #RubyOnRails
[18:35:44] crova: has joined #RubyOnRails
[18:37:10] IFrank00: has joined #RubyOnRails
[18:37:11] IFrank004: has joined #RubyOnRails
[18:37:30] k3rn31: has joined #RubyOnRails
[18:37:41] sumobob: has joined #RubyOnRails
[18:38:11] choke: has joined #RubyOnRails
[18:38:53] crova: Hello everyone. I'm trying to sort my object based on a date (dd/mm/YYYY) using DESC. It sorts correctly but the resulting output is not quite what I imagined. I want to order DESC based first on month and day after, any thoughts without spreading the date on 3 different fields?
[18:39:01] jerematic: has joined #RubyOnRails
[18:39:15] nikger: that sounds like a css problem
[18:39:30] crova: its raw code, no css at all
[18:39:37] smathy: crova, you want to ignore the year?
[18:40:08] macsteps: has joined #RubyOnRails
[18:40:09] crova: smathy, not really, it would be the third argument on the hierarchy though
[18:40:27] crova: because year will only come into play in 2017 (since my series begins in 2016)
[18:40:32] smathy: crova, there's no way other than splitting the different parts out.
[18:40:54] crova: that's a shame but not the end of the word
[18:40:58] crova: thank you for your input tho
[18:41:19] nurey: has joined #RubyOnRails
[18:43:53] N1njturt1e: has joined #RubyOnRails
[18:45:22] jancel: has joined #RubyOnRails
[18:49:33] watersoul: has joined #RubyOnRails
[18:52:00] jayc0b0: SteenJobs: Just ping me when you get a chance. I'm going to move over to another workspace. I'll get a notification if you address me.
[18:52:47] SteenJobs: jayc0b0: perfect, works for me
[18:53:08] jstransky: has joined #RubyOnRails
[18:54:07] mikecmpbll: has joined #RubyOnRails
[18:54:42] dcluna: has joined #RubyOnRails
[18:55:01] terrabl: smathy: I founda tutorial that walked me through creating an array fo checkboxes that works well with a database. Thanks!
[18:56:16] Talltree: i have this http://pastie.org/10866693# function here to handle some things with record creation, i think i didnt understand the hash layout correcty. if i want to print the character_hash after the each, what would be the best method to do that?
[18:56:17] jayc0b0: terrabl: Could I take a look at that?
[18:56:24] Talltree: i have no idea of the layout of that hash...
[18:56:33] tubbo: SteenJobs: yeah i use config/secrets.yml to read credentials into my app, and use env settings to insert configuration into secrets
[18:56:33] terrabl: of course, let me link you the youtube video
[18:57:23] terrabl: jayce0b0: https://www.youtube.com/watch?v=NTLnDCx9wL0 It doesnt have any sound and you should skip to 11:23 because he messes up the first part.
[18:57:32] norc: has joined #RubyOnRails
[18:57:46] SteenJobs: tubbo: ok cool - sicne i’m using figaro it’s simply a different file i presume, although i’ve only used figaro with heroku. will the env be added if i simply create a “staging.rb” file, and add the db config for it?
[18:57:57] terrabl: He uses scaffold so its a little noob friendly but I was able to use model pretty easily as well.
[18:57:59] jayc0b0: terrabl: Thanks. I'll take a look in a minute and see if it helps me.
[18:58:41] tycoon177: has joined #RubyOnRails
[18:59:10] terrabl: taking a look at what you have, it looks like it should fix your problem, but the thing is it stores it in the database as a concatinated string if there is more than one, so if someone had all of the "fax machines" then it would be a concat string of all of those.
[18:59:53] tubbo: SteenJobs: yeah you're good then
[19:00:04] smathy: Talltree, you can't print it after the each, it's a local variable.
[19:00:44] Talltree: kinda hoped there was something like that time stop clock smathy
[19:00:48] SteenJobs: tubbo: cool. another nightmare, for some reason database.yml is not in shared/ on the server, yet it’s in the .gitignore…so gotta remove from .gitignore, add the staging config, deploy, and then go back and do it the right way by symlinking it with cap
[19:00:59] yellow5: has joined #RubyOnRails
[19:01:37] smathy: Talltree, I don't know what that is, the only place you can print the hash is within the each.
[19:02:06] Talltree: how can i do that then? to the console?
[19:02:45] Talltree: snathy, you know, the simpsons episode with the stopwatch that breaks? :D
[19:02:54] Talltree: *smaty sorry
[19:03:11] Talltree: ACTION returns to his corner
[19:05:01] tubbo: SteenJobs: i would argue that it should be checked in, yeah
[19:05:06] tubbo: unless it's being configured with $DATABASE_URL
[19:05:18] SteenJobs: tubbo: you DO check in your database.yml?
[19:05:21] tubbo: to me it's pointless because you can always do password: <%= ENV['DATABASE_PASSWORD'] %>
[19:05:30] SteenJobs: makes sense
[19:05:54] snowy: has joined #RubyOnRails
[19:06:05] AaronTheWhite: Has anyone done a rails app that needs to have multiple instances deployed with different databases but (mostly) the same codebase? Sorry if this is too general.
[19:06:23] SteenJobs: tubbo: assuming there’s even a password on the db…which i never understood its purpose, well i guess in my case. the db and app are hosted on the same server, so if anyone were to gain access to the server, having a db password wouldn’t do much since they have access to the files with the password
[19:06:41] haraigo: has joined #RubyOnRails
[19:07:03] jancel: has joined #RubyOnRails
[19:07:47] tubbo: AaronTheWhite: yes. the concept is called "multi-tenancy", and there's a gem called apartment which can help you make it work.
[19:09:46] AaronTheWhite: Thank you so much.
[19:09:47] blackmesa: has joined #RubyOnRails
[19:10:07] agent_white: has joined #RubyOnRails
[19:10:26] russt: has joined #RubyOnRails
[19:11:01] Junaos: has joined #RubyOnRails
[19:12:05] Wolland_: has joined #RubyOnRails
[19:12:41] AntiSpamMeta: has joined #RubyOnRails
[19:12:42] N1njturt1e: has joined #RubyOnRails
[19:13:44] jayc0b0: terrabl: That's pretty much spot on.
[19:13:52] jayc0b0: I'll try and get that working in my app.
[19:14:06] smathy: Talltree, just print it inside the each.
[19:14:15] jayc0b0: SteenJobs: If you don't mind, I'd be curious as to what your solution was, just in case.
[19:14:24] smathy: Talltree, put an `exit` after that if you really want to short-circuit your processing.
[19:14:32] smathy: Talltree, or use byebug
[19:15:42] Talltree: i used pry_byebug now, so if http://pastie.org/10866712 is the character_hash, to select name i need :"name" right?
[19:15:52] Talltree: because :name doesnt work
[19:16:20] jancel: has joined #RubyOnRails
[19:16:52] smathy: Talltree, assuming it's a Hash, yes. If it comes in from Rails then it might be a HashWithIndifferentAccess in which case you can use either.
[19:16:57] rikkipitt: has joined #RubyOnRails
[19:21:45] tildes_: has joined #RubyOnRails
[19:22:02] jenrzzz: has joined #RubyOnRails
[19:22:55] eve: has joined #RubyOnRails
[19:23:27] Talltree: reallly weird
[19:23:42] Talltree: i stopped the function after the each
[19:23:50] Talltree: let me screen the console for you ^^
[19:25:04] Talltree: https://i.imgur.com/ovgXxos.png
[19:25:36] kiki_lamb: has joined #RubyOnRails
[19:26:01] tubbo: what happens when you do character_hash['name']?
[19:26:14] context: string != symbol
[19:26:36] Talltree: yeah, that works
[19:27:21] Talltree: that was a stupid mistake i guess
[19:27:25] jancel: has joined #RubyOnRails
[19:27:37] Talltree: i thought that was a symbol automaticly Oo
[19:27:55] FailBit: :'this is a symbol'
[19:28:27] FailBit: if you want to use symbols, activesupport has Hash#symbolize_keys
[19:28:32] Talltree: my old code worked with symbols, but i guess that wasnt a hash
[19:28:45] tubbo: it can be confusing because rails has HashWithIndifferentAccess
[19:29:07] Talltree: yeah i'm kinda confused right now, but i guess i learned something, just gotta remember it :D
[19:29:13] manfrin: has joined #RubyOnRails
[19:32:05] jancel: has joined #RubyOnRails
[19:32:10] cnk: has joined #RubyOnRails
[19:32:43] jhass: yeah you learned why HWIA is a stupid idea :P
[19:34:19] norc: HWIA is nice.
[19:34:25] norc: Ill let you know when I come up with a use case./
[19:34:52] tubbo: use case: not having to call symbolize_keys on params.
[19:34:58] jhass: norc: well, it solves "confuse everybody about symbols" pretty damn well
[19:35:27] tubbo: apparently rails does a lot of converting strings to symbols and back again, and removing a large percentage of that code caused significant performance improvements.
[19:35:28] dionysus70: has joined #RubyOnRails
[19:35:40] Talltree: glad i'm not the only person being confused about this
[19:35:45] ekinmur: has joined #RubyOnRails
[19:36:04] jhass: yeah because HWIA doesn't convert symbols to strings all the time...
[19:36:13] antgel: has joined #RubyOnRails
[19:36:23] jhass: oh wait, it does
[19:36:59] jhass: so yes, maybe it did that, I'm sure HWIA wasn't part of the solution though
[19:38:06] tubbo: yeah actually now that i recall it might've been around prior to that discovery
[19:42:57] cd83x: has joined #RubyOnRails
[19:44:42] netzfisch: has joined #RubyOnRails
[19:44:47] centrx: has joined #RubyOnRails
[19:46:52] djbkd: has joined #RubyOnRails
[19:48:31] Pumukel: has joined #RubyOnRails
[19:51:01] terrabl: Does anyone know of a gem that is a number picker but allows for mouse wheel scrolling to make the number go up and down, I have looked around but for some reason I'm creating horrible google search queries or it doesnt exist
[19:51:03] Doddlin: has joined #RubyOnRails
[19:51:23] FailBit: that's bad UX from the start
[19:51:39] terrabl: A number picker is bad UX?
[19:52:15] FailBit: use the default html number input
[19:53:00] terrabl: But that doesnt allow for scrollable inputs?
[19:53:25] Doddlin: Hi all! Have tried to find a simple solution to this one: I have an if-condition that first checks if an object is present
[19:53:26] emachnic: has joined #RubyOnRails
[19:53:53] Doddlin: then, I want to check if the object is clean, and I want that to be case in-sensitive so I want to check for both ”Clean” and ”clean”
[19:54:01] FailBit: terrabl: that's the point
[19:54:05] boboc: has joined #RubyOnRails
[19:54:23] terrabl: Is having a scrollable number picker bad UX design?
[19:54:30] norc: Doddlin, use a regular expression?
[19:54:34] Doddlin: but: if (@object.present?) && (@object.currstatus == "Clean") || (@object.currstatus == "clean") does not give the desired result..
[19:54:40] FailBit: some user agents will support it, some will not, but not doing that users expect on scroll is a very bad idea
[19:54:46] FailBit: s/that/what
[19:55:01] Doddlin: norc, Hmm, never tried that - any guide to recommend?
[19:55:04] lxsameer: has joined #RubyOnRails
[19:55:17] norc: Doddlin, actually strike that. We should help you figure this out.
[19:55:27] norc: Instead of avoiding the problem, fixing it will help you more.
[19:55:28] FailBit: it is up to the user agent to make it scrollable
[19:55:30] terrabl: Hmmm.. interesting, i didnt think it was a solved problem but I guess I wont worry about finding one in rails.
[19:55:48] norc: Doddlin, what is the desired result, and under what conditions are you not getting the desired result?
[19:55:53] boboc: Hi, i have a question, if i have 2 tables 1 for users and 1 let's say for facebook users, if the user will have posts but he can be logged in either with the email account or with facebook and we assume the other could not exist at a time, what's the best approach to create the association? user to posts and also facebook_users to posts seems wrong
[19:56:09] cnk: Doddlin: @object.currstatus.downcase == 'clean'
[19:56:16] FailBit: something in particular that I _really_ hate is websites that add their own scrollbar
[19:56:28] Doddlin: cnk, that is one neat solution!
[19:56:31] FailBit: it annoys me to no end
[19:56:33] Doddlin: Haha, did not think of that one!
[19:57:06] choke: has joined #RubyOnRails
[19:57:26] norc: Doddlin, note that one part of your problem is that && does not have lower precedence than ||, so a && b || c is computed as (a && b) || c
[19:57:28] norc: Doddlin, https://eval.in/584222
[19:57:41] chouhoul_: has joined #RubyOnRails
[19:57:47] SteenJobs: tubbo: do you have set :use_sudo set to true? my deploy user doesn’t have the required permissions to generate some required directories
[19:57:49] Doddlin: norc, thanks! I’ll check that out :)
[19:58:30] tubbo: SteenJobs: no, the webapp deploy user doesn't have sudo access. can you give your deploy user permission to create in those dirs?
[19:59:08] Fuzai: has joined #RubyOnRails
[19:59:14] SteenJobs: tubbo: ugh setting use_sudo to true didn’t work anyway - yea i can, but it means sshing into the server and going folder by folder to change permissions - i don’t even know which dirs it is, so i’d have to keep running deploy and seeing where it fails
[19:59:22] SteenJobs: so if there was some sort of global fix that’d save me a lot of pain in the ass
[20:00:00] bruce_lee: has joined #RubyOnRails
[20:00:00] bruce_lee: has joined #RubyOnRails
[20:00:05] norc: SteenJobs, your deploy user needs the permission one way or another. Either he gets sudo privileges (which is not desirable unless you take the work to really limit in what he can do), or you just give him a directory he can work with (desirable)
[20:00:08] Fuzai: Hi, if I do a db migration on a development box, and then do a commit and push upstream, when I pull that down to staging, will rails know that the commits haven't happened for the local database copy?
[20:00:17] terrabl: Failbit: can you give me an example
[20:00:59] SteenJobs: norc: the thing is, the directories are being created…it’s the dirs for the app and current version. how can i edit permissions for a non existent dir?
[20:01:13] norc: Fuzai, if you run rake db:migrate rake will look inside your db/migrate folder and execute all migrations in the environments that havent been run yet.
[20:01:27] terrabl: Failbit: you're right that just looks wrong
[20:01:27] nickenchuggets: has joined #RubyOnRails
[20:01:35] norc: Fuzai, so if your staging uses a different branch (or tags) it will only apply those migration files that are present from there.
[20:01:53] Fuzai: norc: Does that mean that ActiveRecord keeps a status table to keep track of where it's at in the migration chain?
[20:01:58] norc: Fuzai, yes!
[20:02:03] Fuzai: Thank you sir, have a great day!
[20:02:07] SteenJobs: norc: i think i figured out the issue
[20:02:12] SteenJobs: i’ll tell you what it was in a sec
[20:02:16] SteenJobs: i knew something didn’t make sense
[20:02:18] norc: Fuzai, you are welcome. Good day to you too. :)
[20:02:25] Fuzai: has left #RubyOnRails: ()
[20:03:59] art-solopov: has joined #RubyOnRails
[20:06:23] N1njturt1e: has joined #RubyOnRails
[20:06:59] edmundo: has joined #RubyOnRails
[20:07:12] norc: edmundo, there simply are no gems around that transparently solve oauth2 for you in rails.
[20:07:22] jayc0b0: Alright, I tried the technique from that video.
[20:07:45] norc: edmundo, which means apart from the initial flow you have to completely manage tokens, identity, refresh tokens (which involes manual oauth2 again) all within the context of rails, so you need knowledge where and how to do this elegantly.
[20:08:12] norc: So yeah. OAuth2 is quite doable, but requires manual work.
[20:08:16] jayc0b0: https://www.youtube.com/watch?v=NTLnDCx9wL0
[20:08:22] jayc0b0: I'm having an issue with it though.
[20:08:24] edmundo: i tried checked lots of documentation, and i saw it could be tricky
[20:08:28] edmundo: to accomplish that
[20:08:30] eserror: has joined #RubyOnRails
[20:08:32] jayc0b0: Basically, in the vidoe, they're using one model.
[20:08:33] norc: edmundo, the problem is - there is no documentation to start with.
[20:09:00] norc: edmundo, and all the examples are just very crude example that do not show how to implement it properly with token management.
[20:09:30] edmundo: well i need a simple solution atm
[20:09:40] edmundo: its just an academic example
[20:09:43] norc: edmundo, simple and oauth2 do not fit into the same sentence.
[20:09:45] jayc0b0: I have two models in my implementation. One is for all the options, for the sake of rendering the partial. The other is for quote requests. I need to take the id's from the table partial rows with a checked checkbox and put them into an array in my quote requests table's options field.
[20:10:19] edmundo: well you are right
[20:10:43] norc: edmundo, it might work if you were also writing an oauth2 provider, because then you could make things easier (like generating a permanent token)
[20:11:28] jayc0b0: Hmm. I have an idea. Would it be very hard to make a javascript function that appends an option id into a comma seperated list in a hidden field in my quote form when the checkbox is filled and removed it when it is unchecked?
[20:11:34] jayc0b0: Or is there a better way to go about this?
[20:11:34] diegoviola: has joined #RubyOnRails
[20:11:41] edmundo: so it gonna take me lots of work, to simple insert an event in google calendars, just the create part
[20:11:51] norc: edmundo, yes.
[20:11:52] diegoviola: has joined #RubyOnRails
[20:12:21] norc: edmundo, it basically requires you to implement a refresh mechanism to work properly.
[20:12:23] jayc0b0: I'll repost my earlier gist and screenshot for the sake of clarity.
[20:12:42] norc: edmundo, dont get me wrong, it can be done - but nothing you can hack together in 2 hours.
[20:12:45] jayc0b0: Here's the gist. https://gist.github.com/jayc0b0/29b66ebed25ba8c10581d8e1986d71f9
[20:13:02] jayc0b0: And here's my screenshot
[20:13:04] jayc0b0: https://imgur.com/WDyxhg6
[20:13:25] jayc0b0: Basically the table comes from an options table. And the form below is a form_for my quotes model.
[20:14:45] jayc0b0: I feel like I'm somewhat close to a breakthrough on this. But I feel lke my limited experience is preventing me from getting quite there and I want to avoid any bad solutions.
[20:15:27] norc: edmundo, it is one of those few things that websites often need, but has no elegant solution in rails as of yet. Sadly.
[20:15:58] edmundo: i have 3 days to do that
[20:16:07] alfiemax: has joined #RubyOnRails
[20:16:07] manfrin_: has joined #RubyOnRails
[20:16:29] norc: 3 days is enough.
[20:16:33] edmundo: i think the rails mechanism its to complicated
[20:16:48] norc: edmundo, its not rails that is complicated, its oauth2 ;-)
[20:16:50] elomatreb: has joined #RubyOnRails
[20:17:22] norc: edmundo, omniauth-oauth2 gives you the entire web server flow until you get an access token and a refresh token. The issue is that you have to assume access tokens to be.. really short lived, possibly one time tokens too.
[20:17:53] edmundo: well i can use any options
[20:18:02] Doddlin: norc, speaking of regexp, is there a way to use that with symbols?
[20:18:05] ftj: has joined #RubyOnRails
[20:18:08] edmundo: oauth2 was 1 of them i saw on google
[20:18:49] Doddlin: I have comp1, comp2, comp3… and I want to loop through them as params with [:comp/\d/] but that was undefined..
[20:19:31] edmundo: so the best gem atm is that: 'omniauth-google-oauth2' ?
[20:19:54] jayc0b0: Doddlin: Are there strings you can use?
[20:20:08] Doddlin: jayc0b0, how do you mean?
[20:20:24] sumobob: has joined #RubyOnRails
[20:20:43] jayc0b0: Oh, I misread that a bit.
[20:20:53] jayc0b0: My initial reaction is a bit off then.
[20:20:59] cnk: Doddlin: I think you will need to loop through all params and just skip / continue if the param name does not match comp#
[20:21:02] Doddlin: haha ok, no worries
[20:21:05] norc: edmundo, yeah.
[20:21:06] macsteps: has joined #RubyOnRails
[20:21:23] Doddlin: cnk, OK - I’ll try that one :)
[20:21:28] tubbo: if they're actual http url params, you can set them as ?comp[]=comp1value&comp[]=comp2value&...
[20:21:31] tubbo: endlessly
[20:21:35] tubbo: :comp could be an array
[20:21:57] norc: edmundo, give me a minute. I had a website earlier that went into explaining what you need to do to handle refresh tokens
[20:22:17] edmundo: ok thank you a lot
[20:22:40] jayc0b0: SteenJobs: Are you still around? That video didn't really help. I'm thinking your solution might be of help here.
[20:22:48] Doddlin: tubbo, they are actual url-params
[20:22:57] SteenJobs: jayc0b0: yea i didn’t forget about you - about to be done, just trying to debug one final thing
[20:23:14] jhack: has joined #RubyOnRails
[20:23:18] macsteps: has joined #RubyOnRails
[20:23:26] mdw: has joined #RubyOnRails
[20:23:35] jayc0b0: Alright. Take your time. Don't mean to rush you. And thanks for taking the time to help out a noobie.
[20:24:16] mdw: has joined #RubyOnRails
[20:24:38] norc: edmundo, https://github.com/intridea/omniauth-oauth2/issues/40
[20:24:50] norc: edmundo, there is some discussion, but that is not the site I meant.
[20:26:02] srinidhi: has joined #RubyOnRails
[20:26:27] Leepoff: has joined #RubyOnRails
[20:27:09] edmundo: all these configurations needed makes my head a mess
[20:27:26] SteenJobs: any idea why if i’m serving static assets from the public folder, everything is fine on staging, but when i deploy to production, the old not-in-public-folder views are rendered? (except for the root page, that one is correct)
[20:27:33] SteenJobs: using nginx + puma + cap on DO
[20:27:35] jhack: has joined #RubyOnRails
[20:28:19] norc: edmundo, it is quite simple once you figure it all out. But the fact that you also have Rails to figure out makes this harder.
[20:28:33] norc: edmundo, https://www.twilio.com/blog/2014/09/gmail-api-oauth-rails.html
[20:28:46] norc: That is the website I was referring to.
[20:29:37] lalalaaa: has joined #RubyOnRails
[20:29:42] reduce: has joined #RubyOnRails
[20:30:25] SteenJobs: i’m guessing it’s an issue with nginx…although with rails i set my routes to redirect to /public/my_static_asset_html_view
[20:31:47] N1njturt1e: has joined #RubyOnRails
[20:31:52] diegoviola: has joined #RubyOnRails
[20:33:12] reduce: what extra impedements might i encounter by running rails on windows over a linux vm?
[20:33:28] reduce: (excluding standard os differences)
[20:33:46] lalalaaa: I found rack-livereload and guard-livereload today :)
[20:33:56] tubbo: you're essentially doing all your work over NFS.
[20:34:02] tubbo: reduce: ^
[20:34:44] jayc0b0: Don't certain gems also have some issues on rails?
[20:34:49] jayc0b0: *on windows
[20:34:55] ur5us: has joined #RubyOnRails
[20:35:04] lalalaaa: rack-livereload and guard-livereload is a good thing right?
[20:35:05] tubbo: (shrug) i haven't used windows at all in years
[20:35:08] reduce: ive come across some claims about rails being more difficult to use on windows
[20:35:21] jayc0b0: Ruby is harder to use on windows as is.
[20:35:38] reduce: what sorts of issues does it cause?
[20:35:43] djbkd: has joined #RubyOnRails
[20:35:45] jstransky: has joined #RubyOnRails
[20:36:02] adaedra: compilation issues, mainly, for some gems
[20:36:10] tubbo: reduce: well if you are running rails inside a linux VM, by definition you're not running ruby on windows :)
[20:36:19] FailBit: just run it on ganoo linix like a Normal Person™
[20:36:26] FailBit: or BSD if you're a masochist
[20:36:30] kgrz: has joined #RubyOnRails
[20:36:39] jayc0b0: Bit old, but a good answer: https://stackoverflow.com/questions/11648866/use-windows-or-linux-to-start-work-with-ruby-on-rails
[20:36:42] reduce: tubbo: i meant the vm as the alternative
[20:36:56] FailBit: remember, virtualization exists
[20:37:17] adaedra: I'd place Windows higher than BSD on the masochist scale but whatever
[20:37:19] tubbo: reduce: oh, you didn't indicate that.
[20:37:51] tubbo: but yeah using a linux vm is probably a better approach than trying to use ruby on windows
[20:38:34] tubbo: i always felt like ruby _itself_ was hard to compile on windows, and there are some compilation issues but it should be at least possible to run rails on windows. it's just not widely supported. we're definitely going to tell you to look for help elsewhere if you deliberately try to run your rails app in windows..
[20:38:54] jayc0b0: ^ basically this
[20:39:12] jayc0b0: VM > Windows, if you have to do it on a Windows box
[20:39:53] universa1: hmm... how many of you have tried ruby / rails on windows recently? and not in the 1.x rails days? ;)
[20:40:32] adaedra: I did with a 4.0.4
[20:40:49] adaedra: I ended with JRuby, was working better
[20:40:58] tubbo: oh that's not a bad idea, using jruby instead
[20:41:09] adaedra: In my experience, it works a bit better
[20:41:10] universa1: because compilation, etc... isn't really bad anymore... ...i personally still prefer using *unix, but it is definately good enough for learning the basics of rails.
[20:41:18] adaedra: But JVM starting times
[20:41:22] tubbo: universa1: that's a relief.
[20:41:29] adaedra: Yeah, for the basics, but some gems are going to be a big pain
[20:41:30] tubbo: does spring work with jruby?
[20:41:43] adaedra: And what is rails without the gem galaxy? :)
[20:42:12] adavia: is this maybe a bug with carrierwave and rails 5 when using nested attributes i always get an empty value like "post"=>{images_attributes"=>{"file"=>["", "image.jpg"]}}
[20:42:14] universa1: adaedra: which gem exactly? ;) the popular ones either work by itself, or have a windows version.
[20:42:28] adaedra: iirc, less was being problematic
[20:42:34] moeabdol2: has joined #RubyOnRails
[20:42:58] adaedra: that was some time ago, and I let someone else handle the windows problem, tbh
[20:43:16] jayc0b0: As stated in my link, rmagick, unicorn, paperclip, and thin, but that answer is a bit old, so those might not be entirely accurate now.
[20:43:40] jayc0b0: Anyone know if they work well or not now?
[20:43:40] chipotle: has joined #RubyOnRails
[20:43:53] universa1: who uses less? *chuckle* ;) anyways... ...i would also recommend using at least a *unix variant in a vm for rails development, helps you understand your target environment better anyways.
[20:44:09] lalalaaa: i love using windows 10 + virtualbox + openbsd + ruby on rails ;)
[20:44:10] universa1: just the blind bashing was a bit off imho ;)
[20:44:11] tubbo: i actually develop in a windows vm on OS/2
[20:45:00] adaedra: who uses windows for rails? *chuckle* — Two can play this game. But yeah, our CSS framework was in less, and we needed it.
[20:45:14] universa1: for rmagick: http://www.redmine.org/projects/redmine/wiki/HowTo_install_rmagick_gem_on_Windows -- which is also the most likely culprit for paperclip not working
[20:45:26] macsteps: has joined #RubyOnRails
[20:45:41] cnk: OS/2 still exists?
[20:45:43] universa1: adaedra: people who like rails, but are "forced" to use windows ;) there are sometimes requirements you can not understand
[20:45:54] universa1: don't feed the troll ;)
[20:46:10] universa1: anyhow... ...off to bed ;) have a nice day
[20:46:29] jayc0b0: Seeya universa1
[20:46:41] adaedra: Well, I just said developing rails on Windows was harder than on *nix counterparts, which is by my experience verified. Did not said impossible though.
[20:46:52] art-solopov: Would Cygwin work for Rails on Windows?
[20:47:13] chouhoulis: has joined #RubyOnRails
[20:47:47] chouhoulis: has joined #RubyOnRails
[20:48:09] cnk: art-solopov: the last time I checked there was a pretty good ruby/rails installer for Windows. The issue comes when you need a gem that requires compiling
[20:48:23] cnk: so it really comes down to what you mean by "work"
[20:48:30] art-solopov: cnk: I see...
[20:49:10] IFrank004: has joined #RubyOnRails
[20:49:11] cnk: Is your Windows box powerful enough to run a VM?
[20:49:11] IFrank00: has joined #RubyOnRails
[20:50:47] diegoaguilar: has joined #RubyOnRails
[20:52:27] cnk: http://railsinstaller.org/en
[20:54:02] Cohedrin_: has joined #RubyOnRails
[20:54:22] kdough1: has joined #RubyOnRails
[20:54:40] whathappens: has joined #RubyOnRails
[20:54:41] GarethAdams: has joined #RubyOnRails
[20:56:11] Darmani: has joined #RubyOnRails
[20:56:14] whathapp_: has joined #RubyOnRails
[20:56:54] djbkd: has joined #RubyOnRails
[20:57:49] ekinmur: has joined #RubyOnRails
[20:58:44] jancel: has joined #RubyOnRails
[20:59:25] claytonzaugg: has joined #RubyOnRails
[21:02:26] soroot: has joined #RubyOnRails
[21:04:32] djbkd: has joined #RubyOnRails
[21:05:15] lxsameer: has joined #RubyOnRails
[21:05:15] lxsameer: has joined #RubyOnRails
[21:06:16] bruce_lee: has joined #RubyOnRails
[21:06:16] bruce_lee: has joined #RubyOnRails
[21:07:00] hahuang65: has joined #RubyOnRails
[21:09:58] maxz: has joined #RubyOnRails
[21:10:34] n1lo: has joined #RubyOnRails
[21:10:35] edwinvdgraaf: has joined #RubyOnRails
[21:10:52] dcluna: has joined #RubyOnRails
[21:11:24] adavia: is this maybe a bug with carrierwave and rails 5 but when using nested attributes i always get an empty array value like "post"=>{images_attributes"=>{"file"=>["", "image.jpg"]}}
[21:12:55] Rodya_: has joined #RubyOnRails
[21:15:07] moeabdol2: has joined #RubyOnRails
[21:16:37] Darmani: Hey guys, quick question.
[21:17:06] Darmani: How would I create a messaging system within Rails? Would I use a gem for that? Or would it be as simple as creating a new model?
[21:18:02] jayc0b0: A quick google brings up this: https://github.com/mailboxer/mailboxer
[21:18:10] jayc0b0: Would that work for your use case?
[21:18:30] Wolland: has joined #RubyOnRails
[21:18:49] context: darmani: i imagine that all depends on your needs....
[21:19:26] Darmani: jayc0b0: I'll look into that ^^
[21:20:06] Darmani: context: It's just for practice. I built a Rails app that's a bit like a forum and I wanted a feature where users could message one another.
[21:20:16] Darmani: kinda like Reddit.
[21:21:48] wmoxam: Darmani: if it's for practice why use a gem?
[21:22:18] pawnbox: has joined #RubyOnRails
[21:22:20] jayc0b0: I could see doing it with a messages model.
[21:22:52] Darmani: wmoxam: Well I suppose implementing a gem into the system I created would be another type of practice...
[21:22:57] dblessing: has joined #RubyOnRails
[21:23:26] jayc0b0: ^ Also true
[21:23:28] wmoxam: Darmani: why not both? :)
[21:23:36] Darmani: I'm not too sure what that model would look like though. I guess it wouldn't be that much different from the "Comment" model I created right?
[21:23:38] norc: Darmani, it really depends on what you are trying to do.
[21:23:41] slash_nick: ACTION votes for both
[21:23:46] wmoxam: try it one way, then try it another way :D
[21:23:59] soroot: has joined #RubyOnRails
[21:24:04] Darmani: norc: I'm not trying to do anything lol
[21:24:05] norc: Darmani, depending on your goal something like redis might be a good fit for a part of the solution.
[21:24:14] jayc0b0: You could make a message model with a message, to, and from field.
[21:24:33] Darmani: jayc0b0: =o
[21:24:43] Darmani: I guess it really is that simple huh?
[21:25:12] Darmani: wait wait but let me give you a situation
[21:25:24] jancel: has joined #RubyOnRails
[21:25:38] Darmani: Lets say a user deleted his account? How would keep the history of the conversation on the users profile?
[21:25:54] norc: Darmani, mark the user as "deleted" instead of actually deleting it.
[21:26:03] norc: Darmani, or delete it and allow for NULL foreign keys
[21:26:21] jayc0b0: You could do what reddit does and change their name to [deleted] and keep the message content.
[21:26:34] Darmani: jayc0b0: how2dothat.jpg
[21:26:45] Darmani: norc: that's true. I could do that.
[21:26:48] norc: Darmani, the real approach here is to define your goals, and then solve them.
[21:26:49] Darmani: lots of options I suppose.
[21:26:57] norc: As opposed to "what can I do if I started a XXX"
[21:27:15] Darmani: norc: you da real mvp
[21:27:40] Darmani: thanks guys ^^
[21:28:18] jayc0b0: Glad I could help out a bit. I'm still kinda new to this whole thing, but I guess I know a bit more than I thought.
[21:28:18] FailBit: o boi check out my mixtape bra
[21:29:16] Darmani: jayc0b0: same here(:
[21:29:54] Trynemjoel: has joined #RubyOnRails
[21:30:08] soroot: has joined #RubyOnRails
[21:31:51] SteenJobs: would anyone know why nginx isn’t generating an access log?
[21:31:53] SteenJobs: when it has in the past?
[21:32:03] FailBit: did you add a command to write one?
[21:32:37] soroot: has joined #RubyOnRails
[21:32:53] FailBit: access_log /var/log/nginx/access.log
[21:33:44] L1ght3000: has joined #RubyOnRails
[21:34:10] SteenJobs: FailBit: lemme check, one sec - i inhertied this server config and it has worked in the past
[21:36:12] SteenJobs: FailBit: yea, so it’s a bit odd - there are two files, config/nginx.conf which seems to have the staging setup, and bin/nginx_config which has the production setup. in the production setup, it has “access_log /home/deploy/apps/my_app/current/log/nginx.access.log;"
[21:36:16] SteenJobs: but that file is nowhere to be found
[21:37:10] tubbo: nginx might need write permission for that dir
[21:37:11] jayc0b0: SteenJobs: Does making the file help anything?
[21:37:31] tubbo: people tend to have nginx running on a different user than their deploy user, i think it has to be run as root so you can expose :80
[21:37:34] jstransky: has joined #RubyOnRails
[21:37:35] jayc0b0: ^ Was about to mention that too. I'm not too familiar with nginx, but I know apache can throw a fit on that.
[21:37:50] jayc0b0: The permissions, that is.
[21:37:55] Cervajz: has joined #RubyOnRails
[21:37:58] SteenJobs: well i did a good ol sudo su, and even as root i can’t run service nginx reload…it fails
[21:38:14] FailBit: >not sudo -s
[21:38:28] SteenJobs: i literally just said sudo su....
[21:38:30] jayc0b0: Anything in the logs that might point somewhere?
[21:38:32] sloggerkhan: has joined #RubyOnRails
[21:38:35] SteenJobs: there are no logs!
[21:38:40] SteenJobs: that’s part of the issue
[21:38:45] SteenJobs: they’re not being generated
[21:38:49] SteenJobs: although where do you tell nginx the path for the config file?
[21:39:01] mikecmpbll: has joined #RubyOnRails
[21:39:03] yfeldblum: has joined #RubyOnRails
[21:39:03] SteenJobs: i’m a bit suspicious of the fact that the production nginx config is an executable in bin/
[21:39:15] SteenJobs: maybe he was switching them in and out for each other when deploying?
[21:39:15] jayc0b0: That does seem a bit odd.
[21:39:22] FailBit: pretty sure the main one is always /etc/nginx/nginx.conf
[21:39:28] FailBit: which can include other files from elsewhere
[21:39:29] SteenJobs: not an executable
[21:39:38] SteenJobs: FailBit: yea but it has no file type
[21:39:43] SteenJobs: it’s just called nginx_config ha
[21:40:01] SteenJobs: unless a textfile is sufficient for nginx
[21:40:30] tubbo: everything is a text file on unix, the file extension is just a convenience
[21:40:43] FailBit: I'm pretty sure it has to be nginx.conf
[21:40:44] jayc0b0: The issue you're having is that the production config isn't working, correct?
[21:40:58] soroot: has joined #RubyOnRails
[21:42:26] jayc0b0: For the log issue, have you tried doing a touch on the file?
[21:42:33] jayc0b0: Did you get it?
[21:42:40] soroot: has joined #RubyOnRails
[21:42:56] SteenJobs: jayc0b0: not yet. and i could, but that’s a temporary fix. gotta figure out why the logs aren’t working. i’ll find out in a sec if the config in bin/ is being recognized
[21:43:02] yfeldblum: has joined #RubyOnRails
[21:47:01] AntiSpamMeta: has joined #RubyOnRails
[21:47:24] SteenJobs: no go - i’m trying to make changes to the nginx config so i can direct to static pages in public/ by adding location blocks…but the changes aren’t being recognized presumably because nginx needs to reload the conf file…but running service nginx reload fails
[21:47:26] jancel: has joined #RubyOnRails
[21:49:20] jayc0b0: What tells nginx where to look for the config file?
[21:50:36] soroot: has joined #RubyOnRails
[21:51:35] FailBit: https://pbs.twimg.com/media/CkLRpGZUoAALo1Y.jpg:large
[21:51:54] SteenJobs: jayc0b0: that’s what im wondering, because based on the logs in var/log/nginx, it seems that nginx is looking in config/nginx.conf
[21:52:25] SteenJobs: which is the wrong one, which i’m guessing is the source of all of this - reloading throws an error because it can’t find the log file…because the dir path for the logfile is coming from nginx.conf instead of bin/nginx_config
[21:53:21] jayc0b0: Maybe make a symlink there?
[21:53:46] jayc0b0: I mean, it's kinda hacky, but it would let you know if it's an issue with finding the file or if the file itself is to blame.
[21:55:46] lalalaaa: man guard-livereload is awesome !!!
[21:56:22] art-solopov: Has anyone here tried Trailblazer? What are your impressions on it?
[21:57:26] Talltree: oh cool, wondered where that functionality is in ruby, js has plenty of programs to do that, thanks lalalaaa
[21:57:27] mdw: has joined #RubyOnRails
[21:57:39] jayc0b0: art-solopov: I haven't heard of it, but I'll definitely have to take a look. Looks like it could be interesting.
[21:58:12] art-solopov: jayc0b0: Mmhmm... I'll probably incorporate Cells in my current project, unsure of everything else though.
[21:58:35] jayc0b0: Woah, that /is/ super neat lalalaaa. I'll definitely need to grab that in my next project.
[21:58:41] jancel: has joined #RubyOnRails
[22:01:23] NeoHamled: has joined #RubyOnRails
[22:01:51] pawnbox: has joined #RubyOnRails
[22:02:18] klekot: has joined #RubyOnRails
[22:04:06] choke: https://gist.github.com/jblac/3d3384c2538cf33d263e55377937f577 any tips on making a method available to request specs to set a subdomain like I do in feature specs?
[22:04:41] NeoHamled: I’m trying to remove a specific validation callback from my ActiveModel class, that was inherited by using Devise’ “validatable” mixin… I’ve come up with this incredibly hacky code, but I’m wondering if there’s a better way: https://gist.github.com/Hamled/574a499df7247b86b42e1cb56086e719
[22:05:57] SteenJobs: how/where does rails point to config/nginx.conf? that’s not the default nginx.conf location so where is it stated?
[22:06:19] lalalaaa: Talltree: indeed man, fascinating stuff
[22:06:26] lalalaaa: just made live ridiculously easier :D
[22:06:37] lalalaaa: thumbs up for guard-livereload everybody !!
[22:07:21] cnk: SteenJobs: Nginx should point to rails, not the reverse
[22:07:39] SteenJobs: that’s what i mean
[22:07:45] Xentil: has joined #RubyOnRails
[22:07:50] SteenJobs: cnk: so where does nginx point to rails?
[22:08:32] cnk: Nginx is presumably loading passenger - which when it sees a .ru file loads the rack app which is rails
[22:08:56] cnk: That is unless you are just using Nginx as a proxy to some other app server
[22:08:56] SteenJobs: nginx + puma + cap
[22:09:23] cnk: OK nginx's conf file is probably proxying to puma
[22:09:32] SteenJobs: cnk: by doing some digging, i’ve noticed that /etc/sites-enabled/nginx.conf has the same contents as config/nginx.conf
[22:09:48] SteenJobs: the thing is, there’s this file from the previous dev in bin/ called nginx_config, and it seems to have the correct config
[22:09:53] SteenJobs: but i have no idea how he was pointing to it
[22:10:01] cnk: there is probably a symlink
[22:10:09] cnk: ls -al /etc/sites-enabled/
[22:10:19] choke: SteenJobs, it'll be in the sites-enabled folder and look something similar to: https://gist.github.com/jblac/75cf54f3bc68376c3f6f8ca083e0d389
[22:10:23] cnk: do you see a symbolic link from nginix.conf
[22:11:12] Jasaka: has joined #RubyOnRails
[22:11:23] cnk: Naming question - I need a model to record notices and a child model that records if specific users have seen particular notices. What would you call those 2
[22:12:10] choke: notice, that has a has_many relationship to users on the key "read_by"
[22:12:31] SteenJobs: cnk: well yea, that’s what i’m looking at…in /etc/sites-enabled/ theres’s a file that has the same contents as my rails apps’ config/nginx.conf
[22:12:56] SteenJobs: cnk: but i don’t know 1) how it got into sites-enabled, and 2) how i can change the nginx.conf being referenced
[22:13:05] cnk: Ideally you should replace that with a symbolic link so you don't have 2 copies that could diverge
[22:13:41] SteenJobs: right, and i will
[22:13:49] SteenJobs: but right now i need to get the server up and running
[22:13:52] SteenJobs: because our site is donw
[22:13:54] AmiMoench: has joined #RubyOnRails
[22:14:06] cnk: In general you have a sites-available directory and then the sites-enabled directory contains symbolic links to files in sites-available
[22:14:20] cnk: OK so what is the error message nginx is giving?
[22:14:39] cnk: if no errors there, what are the puma log errors? and the rails logs
[22:17:42] SteenJobs: cnk: it’s looking for nginx.access.log when i try to start it, but the file path is wrong because i need it to switch files
[22:17:43] srinidhi: has joined #RubyOnRails
[22:19:19] Wolland: has joined #RubyOnRails
[22:21:40] lightt: has joined #RubyOnRails
[22:24:08] rattatmatt: has joined #RubyOnRails
[22:25:11] myntcake: has joined #RubyOnRails
[22:25:46] crova: https://gist.github.com/anonymous/36861b4ced9feb39cc643ae8ea51eefa => I'm trying to get the Open and Click by doing simple math with other values. Totals I'm getting right, but rates I don't manage to, I either get 99% or 1%
[22:29:01] phredus: has joined #RubyOnRails
[22:31:55] xvikvi: has joined #RubyOnRails
[22:33:25] mikecmpbll: has joined #RubyOnRails
[22:35:05] haraigoshi: has joined #RubyOnRails
[22:35:40] dblessing: has joined #RubyOnRails
[22:37:03] SteenJobs: cnk: fixed it by copying over the code from bin/nginx_config into config/nginx.conf, and magically sites-available had the new nginx.conf contents
[22:37:16] SteenJobs: cnk: but still no idea how in the world he swapped configs, unless he literally just copy and pasted
[22:39:29] cnk: SteenJobs: Do you know what a symbolic link is
[22:39:42] SteenJobs: i’m not asking how can IIIIII do it
[22:39:43] soroot: has joined #RubyOnRails
[22:39:47] SteenJobs: i’m asking how HEEEEEE had done it
[22:39:52] SteenJobs: there’s no symlink that i can find
[22:39:57] SteenJobs: which is what’s so puzzling
[22:39:59] jayc0b0: That is so weird
[22:40:02] cnk: You said something about cap
[22:40:06] cnk: is that capistrano?
[22:40:19] SteenJobs: but he doesn’t have cap configured with nginx related tasks
[22:40:22] cnk: it's fairly common to have a task in the cap deploy that copies config files
[22:40:29] cnk: OK so not that
[22:40:38] SteenJobs: maybe he added a custom task, i’ll check
[22:40:45] cnk: do you have other configuration management running? Ansible, or chef?
[22:41:06] SteenJobs: but wherever the code is, it’s copying the contents of config/nginx.conf into sites-available
[22:41:13] FailBit: puppet is da best
[22:41:24] benlieb: has joined #RubyOnRails
[22:42:00] cnk: Never tried it. Hated chef - too brittle
[22:42:04] ensyde__: has joined #RubyOnRails
[22:42:25] mdw: has joined #RubyOnRails
[22:43:34] mwlang: ansible is da best
[22:45:43] triangles3: has joined #RubyOnRails
[22:45:47] SteenJobs: although now that i think about it, since nginx_config was in bin/….maybe he just ran that executable on the server whenever he was starting nginx
[22:45:52] SteenJobs: so bin/nginx_config
[22:49:54] soroot: has joined #RubyOnRails
[22:51:06] chouhoul_: has joined #RubyOnRails
[22:51:42] soroot: has joined #RubyOnRails
[22:52:11] yfeldblum: has joined #RubyOnRails
[22:52:46] benlieb_: has joined #RubyOnRails
[22:55:32] mikecmpbll: has joined #RubyOnRails
[22:56:20] jstransky: has joined #RubyOnRails
[22:58:48] jayc0b0: SteenJobs: Good news: I think I managed to figure out my issue with a javascript function.
[22:59:02] jayc0b0: Oh wait, he left, didn't he?
[22:59:14] jancel: has joined #RubyOnRails
[23:00:32] tildes_: has joined #RubyOnRails
[23:10:30] GarethAdams: has joined #RubyOnRails
[23:10:47] benlieb: has joined #RubyOnRails
[23:12:53] soroot: has joined #RubyOnRails
[23:14:55] wd40s: has joined #RubyOnRails
[23:15:28] lalalaaa: How come Rails installs gems I have in my Gemfile's :development block?
[23:16:08] soroot: has joined #RubyOnRails
[23:16:27] whathappens: has joined #RubyOnRails
[23:16:46] jenrzzz: has joined #RubyOnRails
[23:16:46] jenrzzz: has joined #RubyOnRails
[23:16:51] superlou: has joined #RubyOnRails
[23:16:53] hahuang65: has joined #RubyOnRails
[23:17:18] Darmani: Can you generate forms (using Simple_Form gem) without having a corresponding attribute in the model?
[23:17:56] soroot: has joined #RubyOnRails
[23:18:29] soroot: has joined #RubyOnRails
[23:19:49] triptec: has joined #RubyOnRails
[23:20:18] Darmani: https://gist.github.com/mfifth/5f39e4673abeac118ad442d382ad2f11
[23:21:07] dblessing: has joined #RubyOnRails
[23:21:09] Darmani: gahh I have to go. bbl.
[23:21:25] Wolland: has joined #RubyOnRails
[23:24:05] benlieb: has joined #RubyOnRails
[23:26:20] flashpoint9: has joined #RubyOnRails
[23:34:27] phredus: has joined #RubyOnRails
[23:34:58] cnk: lalalaaa: because development is the default env
[23:34:59] dblessing: has joined #RubyOnRails
[23:36:34] FailBit: what's the simple_form gem do
[23:36:36] FailBit: ACTION googles
[23:37:41] dionysus69: has joined #RubyOnRails
[23:39:15] darkmug: has joined #RubyOnRails
[23:41:04] lightt: has joined #RubyOnRails
[23:41:29] lightt: has joined #RubyOnRails
[23:42:33] lalalaaa: cnk: But I'm running Puma in production
[23:42:53] lalalaaa: Doesn't Rails know that?
[23:43:14] allcentury: has joined #RubyOnRails
[23:43:21] cnk: Sorry I didn't catch enough of what you had said to know
[23:43:34] cnk: what installed your dev stuff?
[23:44:15] dalbuschat: has joined #RubyOnRails
[23:47:21] tildes_: has joined #RubyOnRails
[23:49:12] macsteps: has joined #RubyOnRails
[23:50:51] jenrzzz: has joined #RubyOnRails
[23:53:41] dandaman1: has joined #RubyOnRails