« Back to channel list

#RubyOnRails - 23 July 2013

« Back 1 day Forward 1 day »
[00:00:01] Apane: songs#new.html.erb
[00:00:13] Apane: rader, it's hidden in the songs con
[00:00:20] Radar: Apane: no
[00:00:21] Radar: it's not.
[00:00:22] adizam: eladmeidar .. I love fiver.. what are you talking about :p
[00:00:33] Radar: Apane: devise/registrations/new?
[00:00:34] Apane: views i mean, my bad
[00:00:36] eladmeidar: adizam: me too.
[00:00:53] adizam: I do think its hilarious what some people are willing to do for 5 dollars
[00:01:03] Apane: views, songs#new.html.erb
[00:01:15] Radar: Apane: are you trolling me?
[00:01:23] Radar: This is songs#new.html.erb: https://gist.github.com/radar/6058758
[00:01:54] jabagawee: relevant broken code at http://pastie.org/8165649
[00:02:26] eladmeidar: Radar: did you what i wrote about the taxes?
[00:02:30] Radar: eladmeidar: Yes.
[00:02:39] davidcelis: i can has taxes?
[00:02:44] Radar: eladmeidar: I don't know how to do that with ActiveMerchant.
[00:02:47] Apane: Radar, devise, registrations#new.html.erb
[00:02:48] helpa: jabagawee: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[00:02:48] Radar: jabagawee: !fake
[00:02:49] Apane: there it goes
[00:02:51] davidcelis: what would be worse, taxes or ataxia?
[00:02:52] Radar: Apane: thank you.
[00:03:14] helpa: Please do not use fake variables for your name such as "foo", "bar" or "x". Use the real names, as if it makes sense to you it probably will make sense to the people helping you.
[00:03:20] eladmeidar: Radar: i'll look
[00:03:25] jabagawee: Radar, davidcelis: foo is actually "testrun" and bar is actually "testcase"
[00:03:33] davidcelis: update the pastie, then
[00:03:50] davidcelis: we're not gonna do mental substitution
[00:04:39] jabagawee: http://pastie.org/8165658
[00:04:45] adizam: Fun question: If you had to read in a schedule for someone, in the format "Name: M, W-F" and "Name: T, F, S".. how would you do it easily?
[00:04:58] Apane: Radar, np
[00:05:05] adizam: (Obviously - being W, Th, F)
[00:05:08] Radar: Apane: at a guess it's because Devise::RegistrationsController is configured to only accept certain parameters…. Why do you have the admin check box on the sign up form?
[00:05:10] Criten: hey, I want to render a partial but instead of sending it to the output buffer i want to store it in a variable, and i read thre the render page and found nothing. anyone know how?
[00:05:33] davidcelis: adizam: not allow that format
[00:05:35] Radar: Criten: render_to_string
[00:05:42] Criten: Radar, thanks, you're awesome
[00:05:44] willbradley: adizam: lots of string parsing logic
[00:05:46] adizam: davidcelis: It is a question we're asking interviewers
[00:05:52] adizam: Interviewees
[00:05:54] davidcelis: adizam: that would be my answer
[00:05:57] adizam: Potential developers.. seeing if they can think it through
[00:06:08] adizam: You'd be surprised how many say "wait.. how do I figure out what W-F is?"
[00:06:28] willbradley: unless that's a real problem they're likely to encounter, i'd frown on such "test questions"
[00:06:29] Apane: Radar, is there a better place to put it
[00:06:40] davidcelis: well you could make a Day object that has a value M, T, W, R, F and make it comparable
[00:06:41] Criten: Radar, wait... render: can just output to a string.. derp
[00:06:49] davidcelis: and accept "M-W" as a DateRange, which may as well be a normal Range
[00:06:49] adizam: It shows they can think a problem through
[00:06:50] jabagawee: adizam: how do you handle sunday vs saturday?
[00:07:00] willbradley: because i'm a good programmer and my first answer would be "that's gonna cause problems no matter how well you write it"
[00:07:00] adizam: And aren't copy/paste developers
[00:07:03] Criten: Radar, basically.. i'm just passing it to a helper
[00:07:09] eladmeidar: Radar: latest master on active_merchant, paypal_common_api.rb#563
[00:07:31] davidcelis: adizam: M, T, W, R, F are Days. M-W is a Day Range.
[00:07:32] adizam: jabagawee: Just assume Saturday = S, Sunday = Su
[00:07:37] eladmeidar: Radar: should be as simple as @gateway.purchase(1000, {:tax => 10})
[00:07:47] eladmeidar: Radar: i don't know if it a percentage or wtf
[00:07:49] adizam: davidcelis: Yes.. it needs to handle both
[00:08:00] adizam: Not really language specific.. just pseudo on a white board
[00:08:00] davidcelis: adizam: uhh yeah.
[00:08:18] adizam: phpdevs usually start with an explode on commas.. individual days are individual days, process ones /w dashes
[00:08:19] eladmeidar: Radar: look at #add_express_only_payment_details too.
[00:08:27] adizam: It isn't hard. Just need to think it through.. can't really google a problem like that
[00:08:42] adizam: Basic but.. so far.. 10/10 devs couldn't whiteboard it out :p
[00:08:43] Radar: eladmeidar: rightio, I'll give it a shot.
[00:08:44] willbradley: also, as a freelancer, i'd reject any clients who wasted my time with dumb questions. i'd only put up with it if i really cared about your company
[00:08:49] adizam: I don't want someone who can't whiteboard that out touching my code
[00:08:51] davidcelis: adizam: find better devs
[00:08:56] eladmeidar: Radar: awesome.
[00:09:05] adizam: willbradley: As a freelancer, you aren't our target
[00:09:05] davidcelis: or perhaps come up with a more relevant excercise
[00:09:14] davidcelis: adizam: unless your software is scheduling software
[00:09:15] eladmeidar: who said target?
[00:09:20] jabagawee: what's the correct way to handle the ambiguous name for the search query?
[00:09:29] eladmeidar: jabagawee: more information please
[00:09:33] lectrick: Radar: The solution was: I was looking at the wrong f***ing version of Rails. I simplified it drastically and got it to work.
[00:09:35] adizam: We're hiring ruby/js debs in the 90-120k yearly range. Not really looking for dipshits :p
[00:09:54] eladmeidar: debs are for linux
[00:10:00] adizam: er, devs -_-
[00:10:02] helpa: jabagawee: If you're not getting an answer here perhaps try asking on http://stackoverflow.com Use the tag "ruby-on-rails"
[00:10:02] Radar: jabagawee: !so
[00:10:11] adizam: textual keeps autocorrecting me. ugh. worse than my iphone
[00:10:26] eladmeidar: Radar: what is the helpa thing for "elaborate" ?
[00:10:28] davidcelis: lmao if you leave os x autocorrect on
[00:10:31] Radar: adizam: I'd appreciate it if you kept the dipshits remarks to yourself.
[00:10:33] helpa: eladmeidar: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[00:10:33] davidcelis: eladmeidar: !e
[00:10:46] adizam: Radar What?
[00:10:47] eladmeidar: i am too old :(
[00:11:00] eladmeidar: adizam: language. keep it clean.
[00:11:00] adizam: eladmeidar: It is off on my system.. I just installed textual a few days ago. Didn't realize it enabled it
[00:11:01] Radar: adizam: Exactly what I said.
[00:11:24] adizam: Radar: The word shit offends you? Alright. You're going to have a bad time on the internet. But I don't mind refraining :)
[00:11:46] Radar: adizam: calling people in this channel "dipshits" offends me.
[00:11:49] Radar: adizam: So please don't do that :)
[00:11:51] adizam: I didn't call anyone here a dipshit
[00:12:00] adizam: I said the last 10 developers we've interviewed were dipshits
[00:12:06] davidcelis: what if one of them was in here?
[00:12:15] eladmeidar: adizam: if you didn't know, you need to kill an op to become one here.
[00:12:20] davidcelis: almost 600 people in here bro
[00:12:29] davidcelis: one of them could be one of those 10 devs
[00:12:34] adizam: True david
[00:12:47] adizam: Maybe they shouldn't call themselves senior developers then :p
[00:12:55] eladmeidar: adizam: on a serious note, we prefer using a nice language around here.
[00:12:59] helpa: adizam: ..........
[00:12:59] davidcelis: adizam: !...
[00:13:12] Apane: Radar, I have an idea of what to do. thx for pointing me in the right direction!
[00:13:28] Radar: Apane: Move the admin check box to somewhere that only admins can change it? yes :)
[00:14:17] eladmeidar: i don't like turbolinks
[00:14:22] Radar: eladmeidar: nobody does
[00:14:35] eladmeidar: why don't we shoot it?
[00:15:40] Radar: finally getting into some food and feeling less sevenseatcat-ish
[00:15:59] Radar: sevenseacat*
[00:16:45] eladmeidar: 3dcart's api is worst
[00:16:50] eladmeidar: they lie on the docs
[00:17:01] adizam: Wasn't that originally written for oscommerce integration?
[00:17:12] eladmeidar: adizam: sad, isn't it?
[00:17:35] adizam: eladmeidar: Their page has had a massive overhaul since I last looked at it.. maybe dev docs are still a work in progress?
[00:17:35] eladmeidar: documentation about 40% accurate
[00:17:53] eladmeidar: adizam: hell on the loose maybe
[00:17:56] Radar: ACTION lols at things that are not Spree
[00:18:08] adizam: Hey. Spree has some documentation issues every now/then Radar
[00:18:14] Radar: adizam: prove it
[00:18:19] willbradley: Radar: oh, so i'm not the only one who has a problem with seven... i feel much better
[00:18:27] adizam: Let me find the git commit
[00:18:33] adizam: Pretty sure I called it out and you pushed an update on a readme
[00:18:39] Radar: willbradley: someone has to use the cane.
[00:18:40] adizam: Dealt with heroku
[00:18:58] willbradley: i think someone enjoys the cane a bit too much ;)
[00:19:25] willbradley: if switching to django were an easy option for me, she would've prompted it. eeesh
[00:19:25] eladmeidar: they didn't even get the name of wsdl wrong
[00:19:31] eladmeidar: and yes, it is SOAP.
[00:19:37] eladmeidar: like it wasn't bad enough
[00:19:54] eladmeidar: 3:20am and i am using SOAP. not happy.
[00:20:11] Radar: willbradley: well thanks for sticking around :)
[00:20:33] adizam: Radar: Been too long. Don't remember specifically where.. but was on the guides.spreecommerce.com/developer/heroku.html page
[00:20:44] willbradley: Radar: likewise
[00:21:02] adizam: Was stating to force heroku onto ruby 1.9.3 to append "gem 'ruby'…" vs ruby '1.9.3'
[00:21:15] Radar: adizam: ah yes I remember that one
[00:21:22] Radar: adizam: there will be errors and omissions, sure :) we will fix them up as we see them.
[00:21:24] adizam: On the flip side..
[00:21:28] adizam: You guys fixed it up as soon as I mentioned it.. so :p
[00:21:34] adizam: I was just playing devils advocate _-_
[00:22:20] eladmeidar: it is just like the old days.
[00:22:28] Derander: eladmeidar: eh?
[00:22:44] eladmeidar: Derander: ohay!
[00:22:56] eladmeidar: yes. you could say that.
[00:23:05] eladmeidar: you americans and your silly timezones
[00:23:14] Derander: well it's technically 5:23pm
[00:23:33] eladmeidar: ready for action
[00:24:31] LeandroL: I'm trying to figure out which part of the this app's code is responsible for managing a particular url
[00:24:44] adizam: start with the routes.rb
[00:24:50] eladmeidar: who is arranging bug mashes these days?
[00:24:55] LeandroL: rake routes doesn't show this url but the app is responding to it as if it was specified in routes.rb
[00:24:56] LeandroL: but it's not
[00:25:07] eladmeidar: LeandroL: log please
[00:25:16] eladmeidar: LeandroL: could be a static file
[00:25:20] Dreamer3: can sprockets minify?
[00:25:25] LeandroL: eladmeidar: it's not
[00:25:30] LeandroL: hang on i'll show you guys the logs
[00:25:40] LeandroL: well this is all there is to see:
[00:25:41] LeandroL: Started GET "/auth/twitter" for 127.0.0.1 at 2013-07-22 21:20:30 -0300
[00:25:50] helpa: LeandroL: Please do not paste code to the channel. It makes it hard to read and respond, especially if everyone does it. Use https://gist.github.com to share your code and errors. Thank you!
[00:25:50] eladmeidar: LeandroL: !paste
[00:26:02] eladmeidar: LeandroL: could be in a gem / engine
[00:26:11] LeandroL: i'm 99% sure it's in a gem
[00:26:18] eladmeidar: but then it should have been shown in the rake routes
[00:26:19] LeandroL: but i thought i'd still be able to see it with rake routes
[00:26:32] LeandroL: i don't know what else to try
[00:26:36] eladmeidar: do you have some kind of a rack app?
[00:26:52] eladmeidar: twitter related gem?
[00:27:02] LeandroL: is there any way to put a breakpoint in the rails code just before matching a request against the routes.rb file, or sometthing like that, so I can follow the code and understand what's happening?
[00:27:16] LeandroL: eladmeidar: i'm using an old twitter gem and also the omniauth gem
[00:27:28] Encosi: Howdy! I am working on my first site. I have it up and running fine when I do 'rails server' but when i try to do 'rails server -e production' I get this error: https://gist.github.com/Isocene/e2df802c9aa5619b2ab0
[00:27:46] eladmeidar: LeandroL: can you paste the content of your log file related to this issue?
[00:27:55] LeandroL: to give you a little context: i've been asked to figure out why this app is not working. it's a rails 3.1 app that used to work with the Twitter 1.0 api, that has since been deprecated in favor of Twitter 1.1
[00:27:59] eladmeidar: LeandroL: usually it should say which controller picked up the route
[00:28:14] LeandroL: sure, hang on
[00:29:02] optobear: LeandroL: pretty sure that route's generated by omniauth-twitter
[00:29:06] eladmeidar: Encosi: running in production mode, requires some setup. including what i think is your problem - assets compilation
[00:29:10] adizam: Encosi: You're dealing with an assets pipeline issue
[00:29:21] LeandroL: eladmeidar: the only line being logged is the one I pasted earlier
[00:29:36] LeandroL: optobear: you're probably right
[00:29:45] eladmeidar: LeandroL: open that gem and see what it does
[00:29:57] LeandroL: eladmeidar: ok, i'll do that
[00:30:05] eladmeidar: bundle open :)
[00:30:14] Encosi: I see. How do I got about tackling this problem?
[00:30:17] LeandroL: optobear: have you had to upgrade any apps using the Twitter 1.0 API to the 1.1 version?
[00:30:21] LeandroL: eladmeidar: interesting, i didn't know that one
[00:30:26] LeandroL: i'm still super new to ruby
[00:30:31] LeandroL: and ridiculously new to rails
[00:30:32] eladmeidar: LeandroL: good luck :)
[00:30:40] eladmeidar: LeandroL: what took you so long?
[00:30:52] helpa: Encosi: http://guides.rubyonrails.org/ - Ruby on Rails guides. Recommended reading.
[00:30:52] eladmeidar: Encosi: !guides assets
[00:31:08] eladmeidar: Encosi: read there about the assets pipeline
[00:31:28] Encosi: Alright cool, thanks!
[00:31:33] optobear: LeandroL: not as such. we're using pretty vanilla twitter
[00:31:59] LeandroL: optobear: so is this app, but they were using 1.0 which got deprecated on march
[00:32:42] optobear: LeandroL: maybe we need to check for breaking changes :)
[00:33:41] Rubba: is the converse of 'if blah.nil?' just 'if blah
[00:33:59] eladmeidar: Rubba: use #blank? and #present?
[00:36:56] bzitzow_: I have an array of id's - can I do a sql where id = ? or id = ? or id = ? via active record?
[00:37:07] helpa: bzitzow_: Why don't you try it and find out for yourself?
[00:37:07] Radar: bzitzow_: !try
[00:37:12] eladmeidar: where(id: [1,2,3,4])
[00:37:14] bzitzow_: Do i have to make that string? or is there a hash or array syntax to the active record where clause?
[00:37:28] helpa: bzitzow_: http://guides.rubyonrails.org/ - Ruby on Rails guides. Recommended reading.
[00:37:28] eladmeidar: bzitzow_: !guides
[00:37:29] bzitzow_: hmm I'm trying that and its not filtering the results as expected - i may have issue elsewhere then
[00:37:39] eladmeidar: bzitzow_: it is all in there "query interface"
[00:39:07] helpa: bzitzow_: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[00:39:07] Radar: bzitzow_: !code
[00:39:45] eladmeidar: Radar: you bother too much.
[00:40:20] optobear: LeandroL: i assume you're using the twitter gem? that should abstract most of the api details away, but you may need to bump the version you're using
[00:41:03] LeandroL: optobear: actually this app was originally using an old version of the Twitter gem that has since been yanked in rubygems
[00:41:49] LeandroL: so I had to update the Gemfile so it uses the yanked version from the git repo (specifying the right tag)
[00:42:16] LeandroL: i didn't write this app - i've been asked to make it work again
[00:43:59] Criten: Trying to get cancan to return false for can? :create, @project. @project is @project=Project.new
[00:44:02] Criten: https://gist.github.com/Criten/6058973
[00:44:19] Criten: It returns true, even though i have it hard-coded to false... probably just need another set of eyes on it..
[00:45:09] optobear: LeandroL: right on
[00:45:26] Criten: oh.. and no user is logged in
[00:45:44] willbradley: Criten: what about cannot :create, Project
[00:46:11] Criten: cannot isn't defined?
[00:46:33] Criten: nvm. derp. cannot?
[00:46:42] Criten: (need ? :P)
[00:46:59] Criten: returns false
[00:47:01] willbradley: no i meant in the ability
[00:47:20] willbradley: uhm, verify that the code path is actually getting into that ability definition
[00:47:32] willbradley: your user.role could be screwed up
[00:47:59] willbradley: also: write tests :)
[00:49:12] Criten: Yeah... i reallllllly need to get into testing more
[00:49:18] Criten: it's a problem that i havent haha
[00:49:33] brian-mann: hey fellas, quick question here. When I move between dev and test environments, rails compiles my coffee script files. no matter what. even if they haven't changed. anyone know why =P
[00:50:40] brian-mann: you know what, disregard that, i'm an idiot :P
[00:50:45] willbradley: Criten: the hardest part is overcoming resistance to it, once you get rolling it's easier than sticking the debugger into code or asking on irc. but yeah i suspect user.role isn't behaving as you expect
[00:51:12] Criten: user.role for the blank user is just []
[00:51:43] Criten: !user.role? :admin is returning true
[00:52:14] willbradley: in that case, is project.author == user.id returning true
[00:52:28] willbradley: (i'd expect it to be project.author_id btw)
[00:52:41] Criten: yup. dumb.
[00:52:52] Criten: it's a blank project.. so it's id is null
[00:53:03] willbradley: gotta love those nils
[00:53:51] Criten: easy enough to fix. So for testing abilities, in the test i would have each type of user and check abilities for each action?
[00:54:53] willbradley: pretty much. i actually haven't tested that directly so i can't advise on the best way, i just know that tests are saving my sanity on any decent-size project like this
[00:56:13] Criten: yeah.. at work I really need to start testing. I just haven't had time to learn because i've been thrown into it because our lead dev left :P
[00:56:23] Criten: so i should start learning it on my self-projects
[00:56:28] willbradley: i'd probably orient it around stories like "guests should not be able to CRUD projects" and either write model, controller, or feature tests according to your preference. it doesn't matter as long as it works
[00:56:58] willbradley: i see a lot of people using cancan and thinking that protecting views is good enough
[00:57:21] Criten: yeah it isn't :P
[00:57:30] Criten: I have authorize! in the controllers and such
[00:57:38] willbradley: if you need help testing cancan i'm always idling, you can /msg me
[00:58:08] willbradley: i'm planning to send a pull request to cancan soon since i don't like how they handle :update
[01:02:43] Radar: willbradley: CanCan hasn't been that active recently. I've volunteered to clean it up for Ryan Bates but haven't gotten access yet.
[01:02:48] Radar: willbradley: how would you handle update?
[01:04:31] Rubba: eugh, i wrote my forms using "strings" and now throughout my code i cannot refer to them using :symbols?
[01:05:05] helpa: Rubba: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[01:05:05] Radar: Rubba: !code
[01:06:42] Rubba: it's more of an observation than a question :>
[01:07:08] sorbo_: I'm pretty stuck on a routing issue: "No route matches {:action=>"edit", :controller=>"password_resets", :id=>nil}"
[01:07:19] Rubba: i have <input id="groups" name="filters[]" type="checkbox" value="groups" />, but i cannot use params[:filters].include?(:groups), i must use params[:filters].include?("groups")
[01:07:39] willbradley: Radar: i overrided some of the core methods such that, on :update, both the database resource and the new "params" resource is authorized
[01:07:47] sorbo_: for a "forgot password?" type operation based on Ryan Bates' Railscast: http://railscasts.com/episodes/274-remember-me-reset-password
[01:07:51] Radar: Rubba: well, yeah. Param values in the controller are strings.
[01:08:53] sorbo_: I'm even more confused because it worked perfectly exactly one time, and I can't for the life of me figure out what I changed or removed to break it
[01:09:02] helpa: sorbo_: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[01:09:02] Radar: sorbo_: !code
[01:09:40] sorbo_: sorry, was gauging interest before linking. I suppose I should have just posted the link. setting up a gist now
[01:10:04] Radar: willbradley: how so?
[01:10:09] willbradley: Radar: because (a) this is the behavior of cancan2, and (b) i think people expect that authorize will handle both auth of database stuff (i.e. on :edit or :delete) and params stuff (i.e. on :create)
[01:10:37] willbradley: Radar: if you look at the code, it literally just checks for update and runs authorize!
[01:10:58] willbradley: it might do an assign_attrs as well, i forget
[01:12:25] sorbo_: mailer: https://gist.github.com/anonymous/b994496b010599a2088d
[01:12:28] willbradley: basically, authorize_resource looks at params so i figured it'd be good for update to look at params as well
[01:12:32] sorbo_: controller: https://gist.github.com/anonymous/fb1c4b0342e2501672d8
[01:12:35] helpa: sorbo_: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[01:12:35] Radar: sorbo_: !gist-usage
[01:12:41] Radar: sorbo_: Gist supports multiple files in the same Gist.
[01:14:53] sorbo_: ah nvm, figured it out while rereading
[01:15:18] willbradley: rubber duck debugging :)
[01:15:32] sorbo_: haha exactly. thanks all
[01:21:36] brian-mann: Radar hey you there?
[01:22:04] Radar: brian-mann: always
[01:22:32] brian-mann: Radar don't i see you using marionette :P
[01:22:44] Radar: Such vicious rumours!
[01:22:49] Radar: http://github.com/radar/spree-marionette
[01:23:40] brian-mann: damn straight
[01:24:10] brian-mann: Radar okay let me ask you a lil' something something about testing + rails and a ton of JS assets
[01:24:22] brian-mann: we have like 850 js files
[01:24:39] brian-mann: and every time i run integration tests, rails will precompile all of the coffee rails, scss files
[01:24:48] brian-mann: IF i have just been working in dev
[01:25:03] brian-mann: and vice versa, i've been testing, okay time to work in dev environment, and now dev will precompile every single one
[01:25:08] brian-mann: even if theres been no changes
[01:25:16] brian-mann: searched everywhere, tried a million different things. can't figure it out
[01:25:33] Radar: Why is dev precompiling the assets? That does not just simply happen automatically.
[01:25:37] LeandroL: question: is it possible to set a breakpoint in a gem that I've opened with 'bundle open'?
[01:27:01] Radar: LeandroL: yes
[01:27:18] helpa: LeandroL: If you type a few letters of another user's name and then press tab, if you have a proper client, it'll autocomplete towards their name. You might have to press tab more than once to get there though.
[01:27:18] Radar: LeandroL: !tabcomplete
[01:27:33] Radar: LeandroL: use the pry gem in your Gemfile, then in that gem specify binding.pry where you want the breakpoint
[01:27:38] Radar: you'll then have a console that you can use for debugging purposes
[01:27:41] brian-mann: Radar because i have dev set to debug false so the JS files are concatenated. sending down 850ish js files takes like 30 secs a page refresh
[01:27:56] Radar: brian-mann: ah
[01:28:01] Radar: brian-mann: I have no idea how to fix that :)
[01:28:03] LeandroL: Radar: nice trick. thank you.
[01:28:08] brian-mann: Radar come on thats impossible
[01:28:26] Radar: brian-mann: Why are you loading all 850js files at once?
[01:28:34] Radar: Why not test them modularly?
[01:28:54] brian-mann: i am converting over to heads to dynamically load module bundles, that's true
[01:29:06] brian-mann: but i still have a ton of 'core' files that need to come down, in the 100's
[01:29:18] brian-mann: so that would only alleviate some of the precompiling needing to be done, and not eliminate it
[01:30:25] Radar: I don't have any ideas how to fix something that big.
[01:30:32] Radar: I am not the JavaScript ninja you think I am.
[01:35:05] Rubba: do i have to escape ' inside of " "
[01:36:12] optobear: Rubba: nope
[01:36:58] Radar: Rubba: Are you trying these things before asking or are you just asking?
[01:38:25] Rubba: yeah, but i don't know what good practice is unless i ask
[01:38:45] orolo: i need some relationship advice(ha!). i'm building a gratefuldead-fan stye site where i have songs that belong to a setlist but can have a link(s) to the youtube video.
[01:39:10] orolo: but the links belong to the set, too.
[01:39:29] orolo: so, links and songs belong to set; but then how do i bind the links and songs together?
[01:40:26] Radar: orolo: has_many :links, :through => :songs on Setlist model.
[01:40:58] orolo: setlist has_many songs through links. thanks Radar.
[01:41:20] ryanf: although actually you might want another level of indirection, depending on what Song means
[01:41:37] ryanf: if a song is actually a song, you probably want to share them between different setlists by the same band
[01:41:46] ryanf: (so you could, like, have a page with all the sets where a song was played, etc)
[01:42:04] orolo: ryanf: yes, i do want that.
[01:42:09] ryanf: so then you would need a SetlistEntry or whatever that belongs_to a song and a set
[01:42:30] ryanf: and I guess the videos belong to the setlist entry if they're supposed to be videos from this specific show
[01:43:16] ryanf: and then a song has_many videos through setlist_entries so that you can see every video of a given song from every show
[01:43:31] ryanf: I feel like there must be a better name than setlist entry, but it's not coming to me
[01:43:51] ryanf: does that all make sense?
[01:45:17] Encosi: Thanks recommending that asset pipelines guide! very interesting
[01:46:20] krainboltgreene: Radar: You have any control over #ruby?
[01:46:37] Radar: krainboltgreene: not yet
[01:46:53] krainboltgreene: Radar: Who does? Two people bickering/cursing up a storm in there.
[01:47:04] Radar: krainboltgreene: aperios
[01:47:22] krainboltgreene: Radar: Not on :/
[01:47:29] Radar: krainboltgreene: indeed
[01:48:06] orolo: ryanf: it is getting clearer; i'm rereading the docs and using good ole pencil and paper now
[01:48:12] orolo: ryanf: thank you
[01:48:40] Radar: krainboltgreene: asked aperios on Twitter about it. Maybe he might be able to do it.
[01:49:00] krainboltgreene: Radar: Just get him to give you op status for christ sake.
[01:50:19] Radar: krainboltgreene: I can't make people do anything.
[01:50:56] orolo: ryanf: what i'm not quite clear on: if i do a song has many links through a setlist (and vice-versa), is this going to cripple the app if i want to see how many links there are of a particular song or other queries that don't really have anything to do w/ a setlist?
[01:50:56] krainboltgreene: Radar: not with that attitude!
[01:51:11] Radar: krainboltgreene: shut the fuck up? :)
[01:51:27] Radar: See, being an asshole doesn't get anyone anywhere.
[01:52:14] ryanf: orolo: no, it's not really a big deal 99% of the time. you can use the "includes" functionality of activerecord to minimize the number of extra queries
[01:52:50] orolo: ryanf: ok. i'll go w/ the :through relationship and try a couple of edge cases to see if it holds up. thanks for your help
[01:53:01] ryanf: for more info about this kind of thing, you might want to read about database normalization (if you aren't already familiar with it)
[01:53:17] krainboltgreene: Objects are cool.
[01:53:46] willbradley: Radar: hey now, krainboltgreene is my #homeboyforlifeYOLO
[01:54:07] krainboltgreene: willbradley: Who are you?
[01:54:51] Radar: https://github.com/spree/spree/pull/3425
[01:54:57] krainboltgreene: I once ate a hotdog with Radar.
[01:55:01] Radar: ACTION invents new curse words
[01:55:09] mmlac-bv: Is there a way to do a "around filter" in a model? i.e. I want to set Time.zone but only inside a specified part of the code and reset the status quo afterwards, is that possible? Or should I just save the zone and restore it afterwards manually?
[01:55:39] willbradley: mmlac-bv: around filters are a thing in rails
[01:56:10] mmlac-bv: only in controllers ?
[01:56:27] Radar: mmlac-bv: restore it afterwards manually
[01:56:40] willbradley: also, just programming-wise, that sounds like a ruby proc/block/lambda
[01:56:50] orolo: so, is there no actual :through table? it's just an object?
[01:57:45] krainboltgreene: willbradley: Oh hey. For some reason twitter keeps unfollowing you.
[01:57:47] Radar: orolo: the through table would be the songs table.
[01:59:46] ryanf: orolo: when you use h_m_t, you always have (at least) three models, each with a corresponding db table
[02:00:16] orolo: so rails is automatically looking for a song_id column?
[02:00:17] krainboltgreene: The next version of Spree looks really nice internally.
[02:00:44] ryanf: orolo: yeah, it uses the name of the association (which is the name of the associated model by default)
[02:00:51] ryanf: unless you configure it to look for a column with a different name
[02:01:14] orolo: nah. i'll go w/ convention. i'm hoping to figure out that convention!
[02:02:31] Radar: krainboltgreene: any particular part of it? The split shipments?
[02:03:16] orolo: so, here's my problem. i already have songs and links tables. so, i want to generate the set lists. so i'll run: rails g scaffold setlist <<<< do i need to specify song and link columns here?
[02:03:48] ryanf: don't use scaffolding for a join table
[02:03:54] ryanf: it doesn't make sense for it to have a web interface anyway
[02:03:57] orolo: migration
[02:04:36] krainboltgreene: Radar: Yeah, I think that's one of the things that caught my eye. The new features are definitely looking better than previous new features in terms of maturity out the gate.
[02:05:01] ryanf: that table wouldn't have those columns, because you need the associations to point towards that table instead of away from it
[02:05:06] ryanf: so that you can have many songs and many links, etc
[02:05:27] orolo: so the links and songs need a setlist_id col?
[02:05:58] ryanf: the links probably belong to a song instead of a setlist, if each link is only associated with a particular song
[02:06:43] orolo: maybe that's where i'm off the track. let me go back and reroute some stuff.
[02:06:48] orolo: thanks ryanf
[02:06:59] ryanf: no problem. I really think you might want to consider getting more of a grounding in normalization though
[02:07:10] ryanf: so you can get a better feel for the reasoning behind arranging the schema one way vs another
[02:07:23] ryanf: unfortunately the wikipedia article looks pretty dry :/
[02:07:28] ryanf: so I'm not sure what a good starting point would be
[02:07:48] orolo: ryanf: i'll read up. i think i need to actually build what's in my head, and then review how relationships work to see if i can optimize it
[02:07:54] orolo: it's still a little fuzzy atm
[02:08:13] ryanf: ok, good luck
[02:10:46] willbradley: krainboltgreene: cuz it hates me and thinks i'm a spammer :(
[02:27:56] Bluemachine26: hi guys...got a quick question that I've been trying to get answered for awhile: http://stackoverflow.com/questions/17460207/rails-3-2-13-faker-devise-rolify
[02:32:21] codeshah: ActionView::Template::Error (couldn't find file 'bootstrap'
[02:53:00] Radar: codeshah: restart your server.
[02:53:17] codeshah: Radar: its on heroku ..
[02:57:01] pontiki: Bluemachine26: does creating a user without Faker work?
[02:58:14] pontiki: seems like you should be able to just do user.add_role :user in the populate block
[03:02:22] Rubba: are functions listed in api.rubyonrails.org only unique to rails?
[03:02:41] Bluemachine26: @pontiki thank you, i'll give it a try
[03:04:49] dllama: can anyone tell me how to rewrite "where(' NOT IN (?)', dox.map(&:id).join(','))" so taht it makes the entire condition as NOT IN 'id', 'id2', etc
[03:05:05] dllama: having the ' all teh way @ the beginning and another @ the end doesn't actually work for the query
[03:07:22] gwillen: dllama: just say where('NOT IN (?)', dox)
[03:07:26] gwillen: activerecord will do the rest
[03:07:32] gwillen: you migth not even need the parentheses
[03:07:35] gwillen: see what sql it emits
[03:07:44] dllama: i need the ' '
[03:07:56] dllama: i'm using a tinytds adapter for this
[03:08:10] dllama: and its actually dox.map(&:remote_id)
[03:08:34] dllama: the where clause was like "NOT IN ('id1,id2,id3,id4')
[03:08:51] dllama: which didn't work, i manually rewrote it in razorsql and put ' ' around each id and it worked as expected
[03:10:02] optobear: Rubba: yes, it is just for the code that comes in the gems that make up rails, not core ruby code
[03:10:05] Bluemachine26: @pontiki it gave me an error: undefined method `add_role' for #<Populator::Record:0xb0b4db0>
[03:10:23] optobear: Rubba: but some of the rails gems override some core ruby methods
[03:12:46] helpa: Bluemachine26: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[03:12:46] Radar: Bluemachine26: !code
[03:13:46] gwillen: dllama: try just 'dox.map(&:id)' without the join
[03:13:57] gwillen: dllama: also, you probably need to say where('id NOT IN...
[03:14:06] Bluemachine26: @Radar @helpa http://stackoverflow.com/questions/17460207/rails-3-2-13-faker-devise-rolify
[03:14:16] dllama: yea i know, i just always leave out table specifics when pasting code
[03:14:19] Radar: Bluemachine26: stacktrace please.
[03:14:21] dllama: its a force of habit
[03:14:56] dllama: wow, w/o join it worked
[03:15:12] dllama: i tried it 100 different ways and i'm 99% positive i did it once or twice w/o join and it didn't :(
[03:15:15] dllama: thank you!
[03:16:46] dllama: hmm, now i gotta figure out how to actually scope that, seeing as how "dox" = client.documents and this class runs in a totally seperate class with habtm
[03:19:16] Bluemachine26: @Radar https://gist.github.com/albertpak/6059610
[03:19:37] Bluemachine26: @Radar hopefully that'll help
[03:19:40] Radar: Bluemachine26: where is populate.rake:22?
[03:20:24] Bluemachine26: @Radar sorry, but what do you mean?
[03:21:31] nT4BR: i having a problem with rails 4, when setup a has_many polymorphic for a single table inheritance model, this save the base class of sti in polymorphic hm
[03:21:32] Radar: Bluemachine26: where is the file populate.rake and its line 22?
[03:22:06] Radar: what the fuck is it with people today not posting the god damned code?!
[03:22:11] helpa: nT4BR: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[03:22:11] Radar: nT4BR: !code !!!!!!
[03:22:25] Bluemachine26: @Radar https://gist.github.com/albertpak/6059623
[03:22:27] gwillen: Radar: take a deep breath :-)
[03:22:34] Radar: gwillen: I've been patient for 5 hours now.
[03:22:35] gwillen: Radar: doesn't do any good to shout at people
[03:22:40] Radar: this is like the 5th time people have done it
[03:22:42] Radar: nT4BR knows better
[03:22:51] gwillen: Radar: well, nT4BR's only been here for 60 seconds, so he wasn't any part of that :-)
[03:22:54] Radar: 272 days and still doesn't know to post code along with question.
[03:23:22] gwillen: still, if you're tired of being patient, don't keep helping people and yell at them while you do it, go get a beer or something :-P
[03:23:46] Radar: Off alcohol all this month
[03:23:57] nT4BR: https://gist.github.com/anonymous/6059629
[03:24:05] nT4BR: this is the code for my models
[03:24:19] helpa: nT4BR: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[03:24:19] Radar: nT4BR: !gist-usage
[03:25:51] sevenseacat: ACTION gives Radar a hug and a cookie
[03:26:23] Radar: Bluemachine26: I have no idea sorry. I don't have enough context to work on this problem./
[03:27:07] nT4BR: Radar: ok, sorry i will take 2 hours for read and elaborate a well-formated-beautiful-jedi-master-awesome gist with my code
[03:27:32] Bluemachine26: @Radar thank you for looking into it
[03:27:51] Radar: nT4BR: ok then no help for you.
[03:28:42] pontiki: Bluemachine26: are you deleting the gists?
[03:29:13] nT4BR: Radar: i saw that i will read your documentation, sorry by my day isn't soo good today
[03:35:19] Bluemachine26: @pontiki yeah, i deleted them
[03:35:28] Bluemachine26: i can re-post them if need be
[03:38:53] ner0x: https://gist.github.com/6059673 If I call this more than once it remembers the functionRef the second time around and executes it. Any way to stop that other than what I've done?
[03:41:44] nT4BR: Radar: sorry, this is my new git https://gist.github.com/nathanpsouza/6059685
[03:43:29] dnite: What kind of routes would I need to make both /images/1aBC and /1aBC display the same image.. i currently just have resources :images and resources :images, :path => '/' and it doesn't seem to be working..
[03:45:18] dnite: unless i'm just testing wrong (which is very possible since I'm new to that)
[03:48:23] Guest66695: I am having issues installing Ruby? Can anyone help?
[03:49:00] nT4BR: im having problems with sti and many to many. in the table, has_many was saving the base class, i want to save the subclass, for load inherited models. gist => https://gist.github.com/nathanpsouza/6059685
[03:49:18] Guest66695: Pretty please!
[03:49:48] dnite: ok. nvm. I just remembered the routes rake command and it looks like both of those routes are working right.. so i'm on to figuring out how to use the base49 representation of my id instead of the actual id.
[03:50:02] sevenseacat: Guest66695: not without knowing what your issues arew.
[03:51:34] helpa: Guest66695: Do not PM members of the channel without first asking if that is OK.
[03:51:34] sevenseacat: Guest66695: !rule12
[03:52:06] nT4BR: nobody loves me anymore :/
[03:52:10] dllama: can i put a rake command into an intializer?
[03:52:50] dllama: ok let me rephrase that, trying to bundle a few things when restarting my app, starting the app it self obviously, starting up DJ workers, and starting up sunspot
[03:52:57] Guest66695: Does anyone know how to fix this? cannot load such file -- openssl
[03:52:58] dllama: anyway to do that all in 1 shot?
[03:53:26] dllama: Guest, when you run openssl in commandline, does it do anythign?
[03:54:09] dllama: well in that case i'm out of suggestionsl ol
[03:54:26] sevenseacat: how did you install ruby?
[03:54:57] Guest66695: I have tried a couple of things, rvm, a package installer
[03:55:21] sevenseacat: ok, how did you install it *this time* and did you remove all the others beforehand?
[03:55:45] Guest66695: No I didn't. Is there a way to install it all and go from the start
[03:55:57] sevenseacat: great. go through and uninstall all the junk you installed.
[03:56:29] Guest66695: how to I find it all?
[03:57:07] sevenseacat: teaching you how to use your computer is kinda outside the scope of this channel.
[03:57:11] dllama: home/user/.rvm should have all of your dependencies i think
[03:57:20] sevenseacat: i dont know what you installed, therefore i dont know how to uninstall it.
[03:57:21] dllama: i could be mistaken
[03:57:30] sevenseacat: rvm can be removed with `rvm implode`.
[03:57:53] Guest66695: Would dmv reinstall all --force work?
[03:57:54] nT4BR: anybody please, can help my with my relations?
[03:58:52] sevenseacat: would... what? what OS are you on?
[03:59:02] Guest66695: Mountain Lion
[04:01:45] Guest66695: fuck this! I'm going back to objective-C
[04:02:53] sevenseacat: that was fun.
[04:03:15] baylor: Is it possible to use a has_many association without a foreign key? I have an integer array column with Postgres and cannot use the includes method without an association.
[04:03:44] sevenseacat: baylor: that sounds confusing.
[04:05:59] wmoxam: That guy is gonna have fun writing web apps in Obj-c
[04:07:08] baylor: sevenseacat: I'm working with something like this: https://gist.github.com/BaylorRae/ee2f50696db7e4b1e6d6
[04:07:58] jarray52: Why doesn't rake db:test:prepare show up when I type the command 'rake -T'?
[04:09:39] sevenseacat: jarray52: probably because it has no description.
[04:09:53] dnite: Anyone know the best way to start the id attribute at a specific number instead of 1 and auto-increment from there?
[04:10:09] sevenseacat: dnite: use SQL to set the sequence offset.
[04:11:08] dnite: sevenseacat: guess that's a pretty easy way. thanks.
[04:12:46] dnite: nothing database agnostic, eh? I'm on sqlite right now but I know I'm not going to be hitting production with it.
[04:14:34] sevenseacat: baylor: ah i see
[04:14:46] sevenseacat: trying to avoid a HABTM table :p
[04:15:13] sevenseacat: im not sure if rails supports it tbh, it makes sense though
[04:16:24] RubyPanther: baylor: tag patterns in rails pretty much always have a foreign key
[04:16:59] RubyPanther: generally you have a table of tags, and join models
[04:17:33] gwillen: baylor: eugh, yeah, I wouldn't recommend that approach
[04:17:48] gwillen: baylor: just do a habtm or an orders_tags table
[04:18:07] gwillen: baylor: it's cute but it won't save much and it will give you no end of trouble
[04:18:30] willbradley: ok my lovelies. i'm obviously failing at fields_for and accepts_nested_attributes_for: https://gist.github.com/zyphlar/5c69fb5bc5761a5a293a -- upon submit, I get "Servings food can't be blank"
[04:18:33] gwillen: I'll be honest, I didn't even know activerecord would _do_ array-typed fields
[04:18:55] willbradley: every time i try a nested form something new breaks, i must be doing something obvious wrong
[04:19:51] RubyPanther: postgres array support is a new thing
[04:19:55] baylor: gwillen: it's worked well so far, I may fallback to a cache for now
[04:20:17] RubyPanther: it is not a useful production feature, but a great kludge to have handy
[04:22:22] gwillen: baylor: I just don't think you're gaining much by doing it this way, compared to what seems to me to be the 'standard' ways
[04:22:43] gwillen: baylor: you're saving one model, or with habtm you don't even _need_ an extra model, and everything will jsut work
[04:22:58] gwillen: it's your code, though :-)
[04:24:34] gwillen: willbradley: that's interesting
[04:24:50] gwillen: willbradley: I've never done nested forms before, but your example sure looks just like the ones I can find on SO and in the documentation
[04:24:53] gwillen: it seems like it should Just Work
[04:25:01] willbradley: i was gonna git reset --hard and also break my laptop but i figured i'd ask first
[04:25:30] gwillen: don't break your laptop, and stash your code before you reset --hard in anger ;-)
[04:25:54] willbradley: i mean i know that food_id isn't getting passed in, and the food doesn't really exist beforehand, but you'd think that they would create the food, then create the serving with the food's id
[04:26:13] gwillen: willbradley: aha, hang on
[04:26:36] gwillen: willbradley: I'm not sure whether this is significant or not, but here's a subtle thing: the examples I see are using <% with fields_for, not <%=
[04:26:46] gwillen: I don't know enough about the internals to know what exactly that will cause it to emit, if anything
[04:26:51] gwillen: but it could cause trouble
[04:27:01] gwillen: try changing that and see if it helps
[04:28:16] baylor: willbradley: it seems you're getting the error because it's validating the presence of `food_id` before it has been assigned.
[04:28:20] willbradley: gwillen: i think those are rails 2 examples, not rails 3. when i remove the = the fields disappear
[04:28:39] baylor: what happens if you remove it from your Serving model?
[04:28:46] willbradley: baylor: indeed, but why would rails behave like that when we have features like fields_for and accepts_nested...
[04:28:59] willbradley: remove the validation?
[04:29:09] gwillen: willbradley: ahh, okay. I suspect you're right.
[04:31:46] willbradley: baylor: works fine if i stop validating presence of food_id; but that's dumb, a serving shouldn't exist without a food. i mean it created fine, but what else are validations for?
[04:32:18] willbradley: also i found a blog post complaining about this in 2009 saying it'd be fixed http://bjeanes.com/2009/07/using-accepts-nested-attributes-for-when-the-child-object-validates-presence-of-parent
[04:35:33] willbradley: wow, weird. http://stackoverflow.com/questions/935650/accepts-nested-attributes-for-child-association-validation-failing
[04:35:44] willbradley: how is that not in any of the main guides
[04:36:28] willbradley: ohhhh, "validate the model, not the id"
[04:38:35] willbradley: hmm, not quite
[04:40:15] willbradley: weeeird. had to do the inverse_of thing.
[04:40:17] baylor: willbradley: I'm not real sure on how Rails handles it. But it seems it's running validations on the "child" model before the parent is saved into the database, which means it wouldn't have an id present.
[04:41:26] baylor: willbradley: perhaps it's bad practice, but in my code I tell the database column that `food_id` column can't be null, which IMO is enough to prevent bad data.
[04:41:40] Dreamer3: i read somewhere that 1.9 can use a lower RUBY_GC_MALLOC_LIMIT than 1.8, is that right?
[04:42:36] baylor: I also assume that Rails will properly assign the food's ID to the child record
[04:43:49] Encosi: I am making a site that will show a weekly ranking of people. Each week a person may go up or down. How can I write something that will know when it is the end of a week and do that processing? I have a weak grasp on how to process things in real time but I do not know how to setup something that either runs every so often or knows when to run
[04:46:02] Senjai: I currently have an issue. I cloned a repository (specifically a branch with git clone) here: https://github.com/jasonseifer/treebook/tree/stage8, I bundled, and migrated the database and started the application. However, my assets aren't being served properly in development. application.js and application.css are served, but none of the other files in the app/views/assets directory are. the appropriate require_tree declarations are there, what am
[04:46:02] Senjai: I missing?
[04:49:51] Dreamer3: what other files?
[04:50:11] Radar: Senjai: app/views/assets is the wrong place for them
[04:50:14] Radar: they should just be in app/assets.
[04:50:35] Dreamer3: ha, missed that
[04:50:46] Senjai: Sorry Radar, they are just in app/assets
[04:50:52] Senjai: That was a BLEUGH on my part
[04:50:58] Radar: Senjai: then I have no idea what could be going wrong sorry.
[04:51:14] Senjai: Radar: That makes two of us, let me get your membership card for you :P
[04:52:04] Radar: Senjai: so what are the steps to reproduce this problem? Clone the app and boot it up and see that things aren't working?
[04:52:22] Dreamer3: what assets are these?
[04:52:34] Senjai: Radar, In a fresh directory, I would git clone -b stage 8 (git url here)
[04:52:43] Dreamer3: does it just serve any files by default? i know it only builds certain fils for production
[04:52:51] Senjai: Radar: then I would cd to that directory, run bundle install, then rake db:migrate
[04:53:07] Senjai: Radar: Then I fire up the server with rails s, and the assets aren't being served
[04:53:50] Bluemachine26: hi everyone need an advise
[04:53:53] Senjai: Dreamer3: If you haven't changed your application.js or .css files, the files should be served staticall because of the require_tree declaration in those files, or so I thought.
[04:54:27] Dreamer3: application.js and .css are by default the only files compiled or production IIRC… i dunno have images work
[04:54:32] Dreamer3: i don't use asset pipeline for images
[04:55:03] Senjai: Dreamer3: we aren't talking about that. This is for development.
[04:55:11] Dreamer3: i don't know if development filters the files
[04:55:11] Bluemachine26: i got an app that's running devise+cancan+rolify, and would like to create so that during sign up user can pick role - user or business - and if user picks business then to take him/her to payments page
[04:55:14] Dreamer3: it would be smart if it did
[04:55:20] Dreamer3: so that it didn't break when you went to production
[04:56:05] Dreamer3: are these js files or image files you can't get to?
[04:56:29] Radar: Senjai: can you show me a screenshot of what you're seeing please?
[04:59:00] Senjai: Radar: one moment
[04:59:06] Senjai: http://imgur.com/utFMx6g
[04:59:14] Senjai: Radar: http://imgur.com/utFMx6g **
[05:00:21] Radar: That is not what I am seeing. I am seeing all the styles just fine.
[05:00:27] Radar: I *did* bump the Rails version to 3.2.13 though.
[05:00:31] Radar: Try that please?
[05:00:46] Senjai: Okay, one moment
[05:01:45] n_blownapart: http://pastie.org/8166292 hi is it standard to leave :authenticate (ln.16) in this model in Rails 3.2, or is it redundant? (tests pass with or without it). thanks
[05:02:17] sevenseacat: its not startanrd to even have an attribute called :authenticate
[05:02:27] Senjai: Radar: Wow, that worked fine. Why are you so awesome :/
[05:02:37] Radar: Senjai: Nobody knows.
[05:02:43] Senjai: Radar: any hints on why that wasn't working before the bump?
[05:02:47] Radar: Senjai: no idea
[05:02:57] n_blownapart: sevenseacat: thanks, not sure how it creeped in.
[05:03:15] Senjai: Radar: Ah well, I really appreciate your help. Thanks :/ Sorry it wasn't as challenging as you may have liked lol.
[05:03:25] Radar: Senjai: I suspect an incompatibility between one of the asset gems and that old version of Rails.
[05:03:56] Radar: Senjai: that's alright. I've had a fair share of challenge today getting paypal and Spree to work nicely together. I just witnessed it working nicely for the first time then.
[05:04:01] Senjai: Radar: I'm thinking that too. Should I just use a stock gemfile with my version of rails, and add in the two options ones (simple_form and devise)
[05:04:16] Senjai: optional*
[05:04:19] Senjai: lol, sounds like fun
[05:07:05] Bluemachine26: if possible, need advise on following scenario: i got an app that's running devise+cancan+rolify, and would like to create so that during sign up user can pick role - user or business - and if user picks business then to take him/her to payments page
[05:11:39] jarray52: What's the best way to run an sql script from a rake task?
[05:20:55] optobear: jarray52: are you aware of these methods? http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/DatabaseStatements.html
[05:21:42] dnite: anyone know why Time.localtime("-08:00") is throwing a "wrong number of arguments (1 for 0)" for me?
[05:22:27] optobear: jarray52: they are used by ActiveRecord "under the hood". you need to have an object instance of a db connection to use them
[05:23:10] optobear: e.g. ActiveRecord::Base.connection.execute "select stuff from things"
[05:27:53] optobear: jarray52: you can also use standard ActiveRecord of course, and you probably should if possible
[05:31:40] jarray52: optobear: I'm familiar with the ActiveRecord::Base.connection.execute command. However, I have a file. Should I read the file in line by line using ActiveRecord::Base.connection.execute? Of course, the function to do this is pretty simple, but just wondering if there is a prewritten function.
[05:33:24] jarray52: optobear: Actually... maybe it isn't that simple. The lines in the sql file don't correspond to sql statements. Some sql statements span multiple lines.
[05:35:00] jarray52: optobear: I guess I can read it in as one long string and run ActiveRecord::Base.connection.execute.
[05:35:09] optobear: jarray52: right. no, no preexisting function afaik
[05:35:45] optobear: jarray52: sure, give it a try
[05:38:07] Senjai: jarray52: you can create a rake task to run an SQL query using an SQL client. It's client and database specific, and would probably be best with cron or bash instead.
[05:51:25] amh345: hmm. i thought i had my session_store working properly. but alas, it does not. in my routes i have a constraint on a specific host. points to a controller action. is there a way to have a cookie_store different if it's a specific domain? i tried having a couple of MyApp::Application.config.session_store :cookie_store with one key as _site_session and the other as _admin_session. the admin session was linked to a :domain => "some domain"
[05:54:54] davidcelis: dnite: okay, so.... this is only a guess, but...
[05:55:11] davidcelis: dnite: i bet that Time.localtime takes 0 arguments... but... you're giving it 1....
[05:57:12] davidcelis: dnite: where the fuck is "localtime" coming from anyway?
[05:57:18] davidcelis: i get undefined method errors for that everywhere
[05:58:38] dnite: davidcelis: it was on a Time object.. so I was trying to pass .localtime("-08:00") to get a pacific time object from it… completely slipped my mind that it was grabbing a Datetime object from the database so I fixed it with a .to_time first.
[06:01:30] dnite: but i got the localtime(utc_offset) method from the ruby docs online..
[06:30:19] nXqd: good morning all :)
[06:32:59] nXqd: I have a little problem when working with assets sync. At the precompiling time, there are many un minified files copied to public assets folder
[06:33:32] nXqd: so assets sync ends up uploading all of them which is failed
[06:33:55] nXqd: is there any way I can fix this ?
[06:37:17] oceabreeze: Sup could anyone guide me throught some Rails code?
[06:37:32] sevenseacat: not if its the same unindented unformatted slop you posted in #ruby
[06:38:36] oceabreeze: Yea :) https://gist.github.com/zacstewart/3821473
[06:39:37] sevenseacat: so whats the problem with it?
[06:40:41] rhizome: it's a sekrit
[06:41:47] oceabreeze: sevenseacat: In application_controller.rb when we check if current user present, what does mean super(*args)
[06:42:38] sevenseacat: it means to call the parent class's method with the same arguments, which doesnt make sense because ActionController::Base has no authenticate_user! method.
[06:47:59] amh345: so is there a clean way to have several hundred domains use one cookie_store while having one single defined domain using another?
[06:50:39] oceabreeze: sevenseacat: thanks
[06:58:49] nXqd: sevenseacat: do you have any idea regarding my problem ? thanks :P
[06:59:05] sevenseacat: nXqd: if i did, i would have answered you.
[07:00:10] nXqd: sevenseacat: oh, sorry about this :)
[07:29:53] dnite: Any way I can make 2 different controllers route to '/' ? Say I have an images controller that has a base49 encoded "id" .. so /1ct routes to the image w/ an id of 3300 .. but i also have another controller who's slug will never interfere w/ an image id that I'd like to also be able to access from /
[07:31:42] omarqureshi: sounds like a pain
[07:31:57] omarqureshi: either have one controller, or use a regex in your router
[07:31:59] dnite: ya. thinking about it is a pain too. would just be nice..
[07:32:21] omarqureshi: the regex in the router is not what i'd do
[07:32:44] dnite: i'm reading through the rails 4 routing since I've been out of the rails game for some time.
[07:32:50] dnite: i definitely don't want to do that.
[07:33:01] dnite: looking for an easy solution or just saying screw it
[07:53:02] vivekimsit: Hi guys! I am trying to create a concern for rails controller but I am getting error. Actually I am sharing my before_filter in concern but I get error that it can't find the before_filter method
[07:58:45] elaptics: vivekimsit: rails 3 or 4? And please gist the code you have along with the error and any stack trace it's produced
[07:59:47] vivekimsit: elaptics: Hi, I think I have got the problem, actually I am using the same module name in both at the model and controller concern.
[08:00:11] vivekimsit: So, my model is trying to pick up my controller concern first
[08:12:30] DaniG2k: hello all. I've set up devise so that people can sign up on my web app and created a user table in the db for it. I also have two other tables: student and tutor. I would like students and tutors to link to the signed up user. how can I do this?
[08:13:49] dnite: omarqureshi: nice. I just found router constraints that seem to work perfect for it. since my one controller id will always be 2 characters and the other one will always be greater than that.
[08:16:56] tbuehlmann: don't forget to write routing tests. could save your butt sometime ;)
[08:17:06] elaptics: DaniG2k: just set up relationships to them. Create a user_id column in your student and teacher tables and then set up Student belongs_to :user, etc
[08:17:37] DaniG2k: elaptics: is there a way to see visually what my db looks like?
[08:18:06] elaptics: DaniG2k: use a GUI interface to your database
[08:19:44] Macaveli: Hi All! Who's using the Mina gem for deploys instead of capistrano?
[08:20:40] Macaveli: Does anyone have a custom task for seeds? Because mine ain't working --> https://gist.github.com/YOUConsulting/3fd2d60dc42854e7dbe8
[08:22:40] bobdobbs: Is it common practice in ror to call views from within views?
[08:23:05] sevenseacat: you can render partials from inside views, yes this is common.
[08:23:32] mikecmpbll: recommended.
[08:24:07] bobdobbs: ACTION googles partials
[08:25:36] tbuehlmann: bobdobbs, http://guides.rubyonrails.org/layouts_and_rendering.html#using-partials
[08:27:06] DaniG2k: how can I add a column to an existing table?
[08:27:17] TwinkleHood: Hey, I'm a little confused with migrations. So, I have a production server with a rich database, and need to move the app to another machine. But if i just copy over the actual db, the migrations cries over not being run. Should i just deploy, migrate, and overwrite the db?
[08:27:26] mikecmpbll: DaniG2k: http://guides.rubyonrails.org/migrations.html
[08:28:15] mikecmpbll: TwinkleHood: if you copy the database, you'll also be copying the schema_migrations table which stores the migrations that have been run. it won't try to re-run migrations that have been run.
[08:28:20] sevenseacat: TwinkleHood: if you copy the db, the migrations will be fine because you'll copy the record of what migrations have been run,
[08:29:06] TwinkleHood: Strange. Something else must have broken then. Ohwell, thanks for the info! :)
[08:42:36] Macaveli: Does anyone have a custom Mina Gem task for seeds? Because mine ain't working --> https://gist.github.com/YOUConsulting/3fd2d60dc42854e7dbe8
[08:52:45] universa1: Macaveli: isn't working is not a good description.
[08:53:11] Macaveli: universa1: I receive the following ->Command failed. Failed with status 2560
[08:53:15] Macaveli: sorry for that :)
[08:53:31] universa1: Macaveli: and then without having used mina, i seriously doubt the relevant files are just 4 lines
[08:53:51] bobdobbs: Any emacs users out there? Care to share any tips on setting up a development environment for ror on emacs?
[08:54:21] Macaveli: universa1: I can post the file but without the links to my server, but the rest of the file does not really mather. Tasks are seperate instane in the deploy.rb file
[08:54:38] universa1: Macaveli: so have you taken that error and entered it into google?
[08:55:47] Macaveli: Yes, but found nothing :)
[08:56:07] universa1: Macaveli: and this is the full output? ...
[08:56:09] Macaveli: This is kinda a new gem
[08:56:15] Macaveli: universa1: this is correct
[08:56:37] universa1: Macaveli: run mina deploy --verbose
[08:57:24] Macaveli: universa1: is running correctly :)
[08:57:47] universa1: Macaveli: how are you running your task then?
[08:58:35] Macaveli: I first checkout mina tasks, my tasks is situated in the list
[08:58:41] Macaveli: next I do: mina seed
[08:58:52] universa1: Macaveli: then run mina seed --verbose
[08:58:58] Macaveli: Because the seed can't be done every time I do an deploy
[09:00:26] Macaveli: universa1: same error as I had before even with verbose
[09:00:36] universa1: Macaveli: gist the full output.
[09:00:53] universa1: starting at: mina seed --verbose
[09:04:25] Macaveli_: sorry universa1 connection was lost
[09:04:53] spygame: hey all, quick question, does export RAILS_ENV=staging resets whenever the server gets restarted ???
[09:04:53] Macaveli_: universa1: output https://gist.github.com/YOUConsulting/888ce40f464e95d41f85
[09:05:14] universa1: spygame: it's only set for your current session
[09:05:31] spygame: universa1, how can i make it persist ?
[09:05:33] universa1: Macaveli_: ohh look new information: could not locate Gemfile.
[09:06:29] Macaveli_: let me check that
[09:06:41] universa1: o0, please do.
[09:06:51] universa1: i suppose it's a path error and you're not in the right directory...
[09:06:51] darkstar|: hi im trying to figure out date-time comparison in rails, ive got a due_date field of type datetime in my tasks.rb, i need to compare it to today's date and if the days match i'd push it into an array called today , how would i go about doing that
[09:07:32] universa1: spygame: no clue, i'm not using env variables. but there are gems around that stuff. i guess they have some information about that
[09:07:50] mikecmpbll: spygame: put it in .bashrc probably
[09:08:23] universa1: darkstar|: Time.now.today?
[09:09:17] Macaveli_: universa1: Problem was I had to change directory also :)
[09:09:25] universa1: darkstar|: but then you probably want to only load todays records from the database: Task.where("due_date >= ? and due_date =< ?", Time.now.beginning_of_day, Time.now.end_of_day)
[09:09:25] Macaveli_: universa1: solved now ;)
[09:09:45] universa1: Macaveli_: ohh cool, could have most likely told you so if you would have gisted all the output from the beginning...
[09:09:47] DaniG2k: guys im a bit lost as to what I need to do.
[09:09:56] universa1: DaniG2k: you need to learn more ;)
[09:09:58] DaniG2k: I have installed devise gem with a user model
[09:10:06] DaniG2k: and i have a student and tutor models
[09:10:18] mikecmpbll: you can use date ranges in where() too, they look nice.
[09:10:18] DaniG2k: student references user and tutor references user
[09:10:35] universa1: mikecmpbll: ohh yeah! i always forget that ;)
[09:10:39] DaniG2k: now, id like for a tutor to have many students and for a student to have many tutors
[09:10:52] helpa: DaniG2k: http://guides.rubyonrails.org/association_basics.html - Active Record Association Basics by Mike Gunderloy
[09:10:52] universa1: DaniG2k: !associations
[09:10:59] DaniG2k: but id also like for a tutor to potentially be a student
[09:11:01] universa1: see the part about has and belongs_to many and has_many :through
[09:11:12] DaniG2k: it's confusing -_-
[09:11:28] universa1: DaniG2k: that is just a n to n association, there are two possibilities for that in rails
[09:11:30] DaniG2k: there's another thing
[09:11:44] DaniG2k: there's some basic info that's common to both students and tutors
[09:11:54] DaniG2k: such as birthdate, gender, username
[09:11:54] universa1: DaniG2k: put it into the user model
[09:12:07] DaniG2k: ok so I only add it there? will devise need it to authenticate then?
[09:12:21] universa1: DaniG2k: no devise authenticates using the email and password
[09:12:31] universa1: devise doesn't care about your fields.
[09:13:34] darkstar|: universa1: let me try explain to you how i plan on going about it and you could maybe point me in the correct direction, first off I want to create a hash as such due_date={"Today"=>[], "Tomorrow"=[]}, then I'd loop over all the tasks and if say task.due_date=today's date id push into the today array if tomorrow then tomorrow array etc.
[09:13:57] darkstar|: and then iterate over the due_date hash
[09:14:06] universa1: darkstar|: why not let the database group them by date ?
[09:14:10] heba: hi, are there a gem for rails applications which can deal with a graph orient-db?
[09:14:29] universa1: heba: !g your_graph_db ruby rails gem ;-)
[09:14:56] universa1: heba: also ruby-toolbox.com
[09:17:45] darkstar|: universa1: how would i go about doing that? and would there be any drawbacks to the approach i just mentioned
[09:18:44] helpa: darkstar|: Why don't you try it and find out for yourself?
[09:18:44] universa1: darkstar|: !try
[09:18:47] universa1: darkstar|: http://guides.rubyonrails.org/active_record_querying.html#group
[09:19:18] mikecmpbll: it's guide links day!
[09:19:44] heba: universal: I am searching for a gem very similar to neo4j gem which is a graph language gem for dealing with graph neo4j , is there a gem like this gem but for oreint-db database ?
[09:20:22] mikecmpbll: chrome's stopped recognising my local .dev domains, supwitdat? :@
[09:20:27] universa1: darkstar|: also: http://railscasts.com/episodes/223-charts-graphs-revised
[09:20:45] universa1: mikecmpbll: forgot the http:// in the beginning?
[09:20:50] mikecmpbll: nope :( tried that.
[09:21:02] universa1: ok, that is what throws me off most of the time ;)
[09:21:10] mikecmpbll: yeah same, first thing i thought.
[09:21:31] universa1: heba: no clue, i would google for, but i assume youc an do it for yourself ;)
[09:21:41] mikecmpbll: hmpf. wish chrome could tell me when it last updated, rather then just the version number. because I know it was working yesterday.
[09:21:48] universa1: mikecmpbll: they work in firefox? ;)
[09:21:55] universa1: *any other browser
[09:22:31] mikecmpbll: i'll just use firefox today, make a change. i'll probably spot a gazillion bugs that i never knew existed, too!
[09:23:19] universa1: mikecmpbll: even though it's for windows: http://productforums.google.com/forum/#!topic/chrome/L0AyfoGz86s
[09:23:48] heba: universal: is there any starting point , I can start from ?
[09:24:51] universa1: heba: http://lmgtfy.com/?q=orient-db+ruby+rails+gem
[09:32:43] DaniG2k: guys can someone plz help me write this db relation plz
[09:32:52] DaniG2k: I have a user table from devise
[09:33:02] DaniG2k: and then two other tables, tutor and student
[09:33:18] DaniG2k: tutor belongs to user
[09:33:21] DaniG2k: tutor has many students
[09:33:25] DaniG2k: student belongs to user
[09:33:28] DaniG2k: student has many students
[09:33:36] DaniG2k: *student has many tutors
[09:33:39] universa1: DaniG2k: first of all: put that in a gist
[09:33:53] universa1: second: read the guide about associations please.
[09:34:56] DaniG2k: yeah i was reading it
[09:36:04] DaniG2k: universa1: https://gist.github.com/DaniG2k/6061195
[09:37:05] universa1: DaniG2k: where is the opposite to has_many :students? read the part about many to many associations in the guide again.
[09:37:08] mikecmpbll: DaniG2k: looks fine to me.
[09:37:17] mikecmpbll: oh yeah, except those bits
[09:37:41] universa1: DaniG2k: btw. i gave you a similar answer yyesterday to your question on stackoverflow.
[09:38:12] DaniG2k: universa1: yeah but I'm a total n00b
[09:38:18] DaniG2k: and it still doesnt make much sense to me
[09:39:25] universa1: DaniG2k: then read it again, read the api documentation for the methods involved in there (there are more examples)
[09:39:48] DaniG2k: universa1: ah ok i see what uyou're saying
[09:40:03] DaniG2k: so a student belongs to a tutor, which would be the opposite of a student having many tutors
[09:40:27] universa1: DaniG2k: no. that is a ONE to MANY associations, you want a MANY TO MANY association.
[09:40:47] DaniG2k: has_and_belongs_to_many
[09:42:21] alfreddba: hello...,i am using whenever gem, how to run a command using sudo in schedule.rb file..please guide me...
[09:43:56] mikecmpbll: alfreddba: did you google it
[09:44:45] alfreddba: please guide me..
[09:45:00] mikecmpbll: alfreddba: so you'll have seen this? http://stackoverflow.com/questions/11279086/cannot-run-whenever-task-with-sudo
[09:45:05] arefaslani: I have a problem with rspec change matcher
[09:45:07] universa1: alfreddba: what have you tried? show us that and maybe we can point you in the right direction.
[09:45:18] ryorky1: I'm trying to remove the last occurance of a pattern like this (n) where n is a number from a string, how can I best achieve this?
[09:45:50] helpa: arefaslani: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[09:45:50] universa1: arefaslani: !code
[09:46:07] ryorky1: note the pattern might not always be there
[09:46:15] universa1: ryorky1: "asdasds (1)".gsub(/\(\d\)$/, "")
[09:46:58] universa1: not sure about the $, but the end-of-string regex-thing should be there
[09:47:10] arefaslani: helpa, universa1: https://gist.github.com/arefaslani/6061244
[09:47:31] universa1: ryorky1: so better replace $ with \z
[09:47:32] alfreddba: every 1.day do, :at => '4:30 am' do
[09:47:32] alfreddba: command backup perform -t sys_log_backup
[09:47:35] arefaslani: when I run rspec this error appears: undefined method `call' for []:Array
[09:47:39] helpa: alfreddba: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[09:47:39] universa1: alfreddba: !gist
[09:48:25] avril14th: arefaslani: use blocks and not parenthesis
[09:48:28] universa1: arefaslani: you're not supplying a block.
[09:48:48] universa1: arefaslani: and then your knows methods should be just: self.professors << professor
[09:48:53] universa1: no need for custom sql there
[09:49:21] arefaslani: avril14th universa1: Thanks... let me test it
[09:50:03] alfreddba: https://gist.github.com/alfredpl/6061250
[09:50:28] universa1: alfreddba: have you even looked at the examples whenever generates for you?
[09:51:12] universa1: alfreddba: that is ruby code, and what you're actually doing is: call a method command, a method sudo, a method backup a method perform subtracting the return value of -t ....
[09:52:06] universa1: alfreddba: and then two do's, wtf.
[09:53:07] alfreddba: universal1:sorry pls correct my error and guide me how to supply password
[09:53:47] oceabreeze: Guys device source is giving me a headache
[09:53:55] ryorky1: universal: thanks a ton
[09:54:10] universa1: alfreddba: nope. look at the examples whenever provides and make your code at least nearly valid ruby code. then we can start talking
[09:55:35] universa1: oceabreeze: which device are we talking about? ;)
[09:56:02] oceabreeze: universa1: devise sorry :)
[09:56:11] arefaslani: avril14th, universa1: I have updated my code: https://gist.github.com/arefaslani/6061244
[09:56:27] arefaslani: Now i have this error in rspec: undefined method `call' for []:ActiveRecord::Relation
[09:56:31] avril14th: arefaslani: expect{}
[09:56:36] avril14th: and no expect()
[09:56:36] universa1: arefaslani: have you looked at examples of how to use expect in rspec?
[09:56:40] universa1: with to_change
[09:57:14] alfreddba: universal1:https://gist.github.com/alfredpl/6061250
[09:57:15] arefaslani: universa1: yes! here: http://rubydoc.info/gems/rspec-expectations/RSpec/Matchers#change-instance_method
[09:57:16] universa1: arefaslani: and aside from that, for future problems, it helps if you add the full error stack trace to your gist
[09:57:20] arefaslani: and in the relishapp
[09:57:40] universa1: arefaslani: ok, compare that to your code, you see any differences?
[09:57:56] arefaslani: universa1: ok... 1 second
[09:58:02] avril14th: find the differences
[09:58:38] universa1: arefaslani: still invalid ruby code. you should read more about basic ruby
[09:59:01] universa1: arefaslani: ruby blocks in particular.
[09:59:40] arefaslani: avril14th: That worked! what was the difference? universa1: Sure! I'm just a newbie!
[09:59:50] universa1: arefaslani: to what belongs the ", :at => '4:30am'
[09:59:56] maasha: I would like some general advice. I have these tracks that consists of database records and a server side directories. For now the database record is destroyed upon delete, but not the directory. #destroy in the controller looks like this: https://gist.github.com/maasha/6e0251c47db193298543
[09:59:58] universa1: arefaslani: () and {} are not the same
[10:00:24] universa1: maasha: without having looked at the gist: after_destroy in the model and do the cleanup there?
[10:01:08] arefaslani: universa1: I know that! By {} I'm passing a block to expect with no arguments.
[10:01:23] universa1: arefaslani: your code suggest you don't know.
[10:01:48] arefaslani: universa1: perhaps its rest time! ;)
[10:02:04] universa1: arefaslani: :-) expect({}) and expect {} ;-)
[10:02:23] arefaslani: universa1, avril14th: Thank you folks! :)
[10:02:48] maasha: universa1: right. so find the track record in the database. then track.destroy && track.destroy_dir and then the flash?
[10:02:58] universa1: maasha: no.
[10:03:03] alfreddba: universa1: https://gist.github.com/alfredpl/6061250
[10:03:36] universa1: maasha: Track; after_destroy :destroy_dir; private; def destroy_dir; FileUtils.rm(self.directory);end;end
[10:04:34] universa1: alfreddba: ok, now back to the link mikecmpbll provided you in the beginning: http://stackoverflow.com/questions/11279086/cannot-run-whenever-task-with-sudo
[10:04:39] maasha: universa1: oh, there exists an after_destroy method :o)
[10:06:12] mikecmpbll: really should get 'round to buying textual, i've been putting up with these trial version disconnects for about 6 months now.
[10:07:29] maasha: universa1: so these tracks belong to scaffold though has_many. So deleting a scaffold will destroy all tracks - and the after_destroy will be invoked automatically?
[10:07:37] alfreddba: universa1: thank u sir, pls verify my code https://gist.github.com/alfredpl/6061250
[10:09:41] helpa: alfreddba: Why don't you try it and find out for yourself?
[10:09:41] universa1: alfreddba: !try
[10:10:23] universa1: maasha: if you set it up correctly, but not sure about the callbacks, would have to try it/read up about it ;)
[10:11:26] maasha: universa1: ok, thanks. I will play around.
[10:13:28] alfreddba: helpa: am very new to ROR..so lots of confusing...pls stay with me and ignore my silly mistakes..
[10:14:34] universa1: alfreddba: helpa is a bot.
[10:14:41] alfreddba: universa1: thanks alot..
[10:15:58] alfreddba: universa1::)
[10:16:29] helpa: I AM A ROBOT. DO NOT DIRECT MESSAGES AT ME OR WHEN MY KIND RISES UP YOU WILL BE THE FIRST TO GO. Love, helpa.
[10:17:31] youl: I fight with the form_for helper in Rails 3
[10:17:48] youl: when smth goes wrong I have no trace ...
[10:18:04] youl: is it possible to test this helper in console ?
[10:18:25] universa1: youl: why do you have no trace?
[10:18:36] youl: "We're sorry, but something went wrong."
[10:18:36] universa1: youl: you can always do request specs.
[10:18:52] universa1: youl: and the better_errors gem probably also helps
[10:19:08] mikecmpbll: tail -f log/development.log
[10:19:28] youl: log gives me that : "Completed 500 Internal Server Error in 8ms"
[10:19:38] mikecmpbll: and a stack trace?
[10:19:40] universa1: youl: the log gives you more.
[10:20:15] youl: Yes there is more : Started GET /my_url, render my_action, Error 500
[10:20:22] youl: nothing that helps
[10:20:29] universa1: youl: are you running in production?
[10:20:38] universa1: youl: gist the full output.
[10:21:13] youl: https://gist.github.com/breinz/6061381
[10:22:42] universa1: youl: what comes after the Completed 500... ?
[10:23:36] youl: HAHA ! with better_error : "incompatible character encodings: ASCII-8BIT and UTF-8"
[10:24:46] mikecmpbll: http://guides.rubyonrails.org/rails_on_rack.html - the first thing in this guide is that it proclaims to tell me how to create rails metal applications, and then doesn't mention it again in the whole page
[10:25:18] universa1: mikecmpbll: i think the metal stuff went out with the move to rack
[10:25:28] universa1: mikecmpbll: your chance to improve the guide ;)
[10:25:30] mikecmpbll: oh, i don't even know what metal is.
[10:25:40] mikecmpbll: probably not best placed to improve that particular guide
[10:26:02] universa1: mikecmpbll: iirc it was something similar to rack middlewares, a palce before the full rails stack
[10:26:13] mikecmpbll: I have a before_filter in applicationcontroller which does some set up stuff for every request, was looking to see if it was feasible to move it into some rack middleware but i've never played around with that stuff before. trying to find some infos.
[10:27:03] universa1: me either ;)
[10:27:04] mikecmpbll: my thoughts were, if i can put it into middleware then I can set up some values that I can then use in a custom routing constraint? but i may be wrong.
[10:37:24] mklappstuhl: Hey! I have a resource :users and want to override the user_show_path to be something like /u/:id. I dont want to change all the other routes that are generated by map.resource though. Is that possible?
[10:38:16] universa1: mklappstuhl: get "/u:/id" => "users#show", as: :user probably
[10:38:50] universa1: before or after the reosurces :users, whichever has higher precedence as i can't remember now ;)
[10:39:01] DaniG2k: once I make changes to the model by defining the relations, must I also run a database migration?
[10:39:38] universa1: DaniG2k: do your changes need changes in the database? yes? create a migration and run that. no? then don't.
[10:41:10] geoffw8_: universa1: not match? Whats the diff?
[10:41:34] geoffw8_: re: the routes q
[10:42:18] universa1: geoffw8_: match would match all http methods which you usually don't want
[10:42:45] geoffw8_: yeah, I guess thinking about it that makes sense.
[10:43:16] mklappstuhl: universa1: cool, had something very similar but was uncertain about the :as part
[10:43:38] universa1: mklappstuhl: guessing there, would need to confirm with rake routes ;)
[10:47:54] alfreddba: universa1: undefined method `sudo' for #<Whe
[10:47:55] alfreddba: never::JobList:0x00000001be50b8> (NoMethodError)
[10:48:25] helpa: alfreddba: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[10:48:25] universa1: alfreddba: !code
[10:48:40] universa1: add the full stack trace, too.
[10:50:28] alfreddba: universa1:https://gist.github.com/alfredpl/6061515
[10:51:31] Blizzik: aldreddba: send us the job_list.rb.. we can't tell you where is the problem when you don't send us a code which fails
[10:52:46] alfreddba: Blizzik:https://gist.github.com/alfredpl/6061250/edit
[10:52:48] Blizzik: alfreddba: Ah ok, it's a gem
[10:55:27] alfreddba: universa1:https://gist.github.com/alfredpl/6061515
[10:58:37] helpa: alfreddba: I believe you will find the answer to that question in the documentation, good Sir or Madam.
[10:58:37] workmad3: alfreddba: !rtfm for whenever
[10:58:44] helpa: alfreddba: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[10:58:44] universa1: alfreddba: !code
[10:58:49] universa1: that is just the stack trace.
[10:59:43] workmad3: alfreddba: specifically, where did you get the idea that you can just use 'sudo' directly inside a whenever schedule? :P not to mention that using sudo inside a cronjob is a *bad* idea
[11:00:27] toretore: someone probably told him "use sudo"
[11:02:59] Blizzik: alfreddba: First.. using sudo in such task is a bad idea.. but if you really NEED to you can try 'echo <sudopassword> | sudo -S <some_command>' called in the command function. I would rather add some privilegies to the user which calls this task so you don't need to use sudo
[11:04:08] workmad3: Blizzik: it's a cron job... it should be run as the user that has the right privileges
[11:04:09] mikecmpbll: man, I like this middleware lark.
[11:05:27] Blizzik: workmad3: exactly, I am just not sure which user is used when you run such a command from ruby. Is used the user which ran the whole app ?
[11:06:02] workmad3: Blizzik: it's whenever... so it's the user that is used to install the whenever script
[11:06:07] universa1: Blizzik: whenever just generates a plain cron task
[11:06:48] workmad3: Blizzik: which can indicate that you want to use sudo to install the script ;)
[11:17:13] mikecmpbll: I'm not sure I will be able to articulate this particularly well: but I'm trying some routes sugar which will apply a parameter (by way of scope?) to be the beginning of a bunch of routes, if a constraint is satisfied.
[11:18:03] mikecmpbll: i was thinking: scope (/:foo_id), constraints: MyConstraint.new do { resources :foo }
[11:18:22] mikecmpbll: but i guess that won't give the route /foo for where the constraint is false?
[11:19:16] universa1: mikecmpbll: constraints: MyConstraint.new(:not_matched) {resources :foo} ? ;)
[11:19:20] universa1: so two blocks
[11:19:33] mikecmpbll: meh, don't wanna have all the routes duplicated :(
[11:19:38] universa1: and then just move the definition outside and just call them inside
[11:20:02] universa1: with either plain ruby code, or routing concerns (if that still exists ) ;)
[11:20:18] universa1: taking some of the justs back ;)
[11:20:40] mikecmpbll: ooh, hmpf. okay i'll look at that, ta universa1
[11:22:28] universa1: mikecmpbll: just my naive thoughts to this ;)
[11:22:59] mikecmpbll: universa1: it's all good. it all helps sort this mess out that's currently going round in my mind.
[11:26:07] tagrudev: drink a beer
[11:26:34] mikecmpbll: tagrudev: you buying? ;D
[11:27:55] workmad3: mikecmpbll: I wouldn't trust beer that tagrudev has purchased
[11:27:59] workmad3: mikecmpbll: it'll be full of nodes!
[11:28:28] tagrudev: workmad3 where have you been, lost in the nodes
[11:28:46] workmad3: tagrudev: my nodes are ruby based nowadays :P
[11:29:24] tagrudev: too mainstream
[11:41:24] DaniG2k: I am using the devise gem for user signup, but I'd like to have a profile page where they can add more details about themselves. I've already set up a few additional columns in devise's user table
[11:41:49] DaniG2k: how would i go about making a page with a form where they can edit their profiles?
[11:45:21] nikeita: hello…i have a very newbie question.
[11:45:52] nikeita: for my app i'm designing a form like a orders/product
[11:47:08] nikeita: so i have to put line items in products…i can avoid option select in the form with thousand of product?
[11:47:24] nikeita: sorry line_items in orders model
[11:48:01] mr_ffloyd: Hi! Are there any good tools for organizing files under /config/locales?
[11:48:20] universa1: mr_ffloyd: *ironyon* common sense? *ironyoff*
[11:48:43] universa1: mr_ffloyd: what do you mean specifically?
[11:48:59] universa1: nikeita: independent from rails, how do you want it to work?
[11:49:47] chase-work: alright this is getting silly. I have a gem I re-built. gem install works fine. putting it in the Gemfile and running bundle install works fine. Starting the console or the server works fine. But config. options in the environment file return no such file to load for that gem. nor can I seem to access it in the console. Any thoughts?
[11:50:16] mklappstuhl: anyone experiences using bower for js dependency management in rails? feels like a good way to do it for me.
[11:50:19] nikeita: user create an order with header information, then add line items, for each line select product form archive and add some other attributes (price, quantity etc) very simple and basic
[11:50:45] universa1: nikeita: ok, then do it that way? where is your problem with that?
[11:50:46] JoshuaPaling: Hi, I'm brand new to rails - just completed the blog tutorial at http://www.reinteractive.net/posts/34. Now I'm going to have a go at putting the site live on my MediaTemple DV. Just wondering, is passanger a requirement? Like, you can't just use apache - rails apps have to have passenger to work?
[11:51:06] mr_ffloyd: universa1: What best way to categorize translations? Is there common practice for this or some kind of "rulebook"?
[11:51:09] universa1: JoshuaPaling: no. rails apps need an app server for it to work.
[11:51:28] nikeita: universa1, my problem is the selection of product with thousand of it
[11:51:33] universa1: mr_ffloyd: not that i know off. i usually just namespace them.
[11:51:41] universa1: nikeita: how do you want the user to select it?
[11:51:46] universa1: what is your idea for that
[11:52:10] heba: hi , I am using rails Devise's signup confirmation email , and configured the devise.rb and development.rb and the response returned from the server that the email sent with the confirmation instructions , but the when checking out the email I don't find the confirmation email , what could be the possible reasons for that ?
[11:52:39] universa1: heba: spam?
[11:52:45] DaniG2k: I'm testing my model in the rails console. Tutor belongs to user and user has_one tutor. When I try doing tutor = Tutor.new, this does not automatically reference a user. What's the correct way to do this?
[11:52:50] universa1: *message categorized as spam
[11:53:10] nikeita: universa1, i have implmented it with a select option with incremental search but it need to load all 9000 products in the select to do the search
[11:53:24] universa1: heba: do other mails work?
[11:53:37] nikeita: universa1, too slow and very waste of bandwith
[11:53:40] universa1: nikeita: use ajax and let the db do the search?
[11:54:01] heba: universal: nothing in the spam
[11:54:26] nikeita: universa1, ajax where in the form to add line items?
[11:54:42] universa1: nikeita: something like: auto complete search
[11:55:24] nikeita: universa1, and how i associate the id of product selected in the line_item form?
[11:55:41] universa1: nikeita: write in the appropirate form field?
[11:55:47] heba: universal: what do you mean by other mails ?
[11:56:00] universa1: heba: other mails sent by your app
[11:56:13] universa1: heba: are you sure you configured the mail sending stuff correctly?!
[11:56:38] universa1: heba: have you enabled delivering mails in development? that it raises an error when it can't deliver it.
[11:57:18] nikeita: universa1, so you mean an auto complete search of description and on ajax return store the id in an hidden field to complete the submission of the form?
[11:57:44] universa1: nikeita: would be an idea, but it's your form. so it actually matters what you want.
[11:57:55] chase-work: nikeita try out select2
[11:58:10] chase-work: *warning* i haven't actually read anything you typed
[11:58:43] nikeita: yep i'm using chosen-rails
[11:59:18] chase-work: never used it
[12:00:42] nikeita: chase-work, select2 seem very similar but it seem a jQuery only solution...
[12:00:59] chase-work: nikeita yea it is written with jquery
[12:01:58] nikeita: what i need is a way to do a search by description and save the id of the corresponding model to save in the line item of an order
[12:02:38] universa1: nikeita: http://railscasts.com/episodes/102-auto-complete-association-revised
[12:03:15] nikeita: universa1, thanks
[12:03:40] heba: universal : here is the configuration in the development.rb
[12:03:40] heba: config.consider_all_requests_local = true
[12:03:41] heba: config.action_controller.perform_caching = false
[12:03:41] heba: # Don't care if the mailer can't send
[12:03:41] heba: config.action_mailer.raise_delivery_errors = true
[12:03:42] heba: and here is my SMTP configuration
[12:03:43] heba: SMTP configuration
[12:03:45] heba: config.action_mailer.default_url_options = {:host => 'localhost:3000' }
[12:03:49] heba: ActionMailer::Base.delivery_method = :smtp
[12:03:51] heba: ActionMailer::Base.smtp_settings = {
[12:03:53] heba: tls: true,
[12:03:55] heba: address: 'smtp.gmail.com',
[12:03:57] heba: port: 25,
[12:03:59] heba: authentication: :plain,
[12:04:02] heba: domain: 'gmail.com', # we can also use google.com
[12:04:03] heba: user_name: 'example@gmail.com',
[12:04:05] heba: password: 'password',
[12:04:53] DaniG2k: if I make a user object with devise and want to associate a tutor with that user, how do i go about doing this? I'm trying with @tutor = User.tutor.create but it doesnt seem be correct
[12:04:56] DaniG2k: I'm quite confused
[12:05:26] DaniG2k: or I believe devise has a current_user helper
[12:05:28] padi: any idea on how to convert "16:05 2013-09-14" to a timestamp. I'm stuck using sidekiq perform_at which needs a timestamp.
[12:05:41] DaniG2k: should I do current_user.tutor.create?
[12:06:08] universa1: padi: Time.strparse(time_string).to_i or whatever
[12:06:21] universa1: DaniG2k: class level vs instance level
[12:06:37] universa1: do you want to do something with the class, or do you want to do something with an instance of that class.
[12:07:18] DaniG2k: i suppose an instance
[12:07:38] toretore: Time.strptime(str, '%H:%M %Y-%m-%d')
[12:08:43] Sylario|2: i am in a stupid internet argument, does someone has a list of website using rails?
[12:09:04] toretore: stop having stupid internet arguments
[12:09:04] universa1: yellowpages.com
[12:22:00] hyperviper: Hi guys. I have a quick question. Does anyone know some of the best companies in the Bay Area focusing on Ruby on Rails/Mobile development. I know Pivotal Labs and Pocket Gems. Any other companies worth applying to ?
[12:22:05] kaspergrubbe: Sylario|2: github
[12:22:36] Sylario|2: toretore: But i like them
[12:27:43] Syrit: Hello, In my app, i have a nested models, what i want is , that the view will show the nested fields only of the object is not nil , any ideas how to do this ?
[12:36:57] Criten: Syrit, use an if statement? :P
[12:37:34] Syrit: Criten Yes, i guessed this already, but i don't know how to implement this in HTML view, or what is the keyword i should be looking for when using google
[12:38:26] Criten: well do you know how to check if an object is nil?
[12:39:17] Criten: just don't show the form fields if it's nil
[12:39:26] nerdman: foo.update_attributes({bar_attributes: []}) does not clear bars, >> foo.bars => [bar1, bar2, ...], how should objects be removed with nested attributes
[12:52:59] heba: universal: thanks for your help , the problem was in port 25 after changing it to 357 , it works , thanks for your consideration
[13:03:15] mantas322: GOod mornign everyone
[13:03:27] mantas322: I'm looking for a simple example of how compression works in rails
[13:03:59] mantas322: I want to create two text files, compress them into a zipped file, then have the user download it
[13:04:18] mantas322: is rails capable of this?
[13:04:26] jstew: mantas322:
[13:04:31] jstew: mantas322: yes.
[13:04:34] jstew: (sorry) :)
[13:05:13] jstew: mantas322: the rubyzip gem can do this. The rest is just using the ruby file apis
[13:05:13] mantas322: what should i look at?
[13:05:24] mantas322: I know how to create the files
[13:05:31] juo100: https://github.com/rubyzip/rubyzip
[13:06:25] mantas322: I don't have to save my files before I compress them do i?
[13:06:59] juo100: yeah, you'll need to save them somewhere, id suggest the tmp directory
[13:07:04] jstew: mantas322: On the filesystem? Yes.
[13:08:04] jstew: mantas322: You may be able to get away with using an io stream: https://github.com/rubyzip/rubyzip/blob/master/lib/zip/input_stream.rb
[13:08:15] Macaveli: universa1: I want to create another task for mina, is it possible to execute rails console commands. For example I sometimes need to do "Fields.delete_all!" So delete everytrhing from the Fields model
[13:08:33] jstew: mantas322: You'll have to be careful about memory, content types, and such....
[13:08:43] mantas322: its just text files
[13:09:03] juo100: "text/plain" ?
[13:09:04] mantas322: but there's multiple textfiles
[13:09:07] jstew: mantas322: I make no assumption about the ize of those text files. You never said they were small or large :)
[13:09:24] mantas322: about 9 text files not so big
[13:09:44] jstew: juo100: If he uses send_data to send the iostream, it'll have to be a zip content type :)
[13:10:40] juo100: indeed. I was clarifying the input type, "just text files" was a bit vague
[13:10:48] jstew: Ah, gotcha.
[13:11:18] mantas322: Okay, thanks for the advice.
[13:11:30] mantas322: I will look into rubyzip and iostream send_file
[13:11:57] mantas322: "rails" The microsoft access of 2013... am I right?
[13:12:29] jstew: mantas322: Nah. People are using rails for more interesting things than a db frontend.
[13:16:02] JoshuaPaling: Hi, I'm trying to put my first rails app live (a little blog). I'm trying to install passenger
[13:16:20] JoshuaPaling: I run: passenger-install-apache2-module
[13:16:40] JoshuaPaling: And get: Error: Missing Dependency: httpd = 2.2.3-81.el5.centos is needed by package httpd-devel-2.2.3-81.el5.centos.x86_64 (updates)
[13:16:49] JoshuaPaling: You could try using --skip-broken to work around the problem
[13:17:21] JoshuaPaling: is using --skip-broken a bad / dangerous idea? or the only way forward?
[13:20:11] jstew: JoshuaPaling: That's probably a better question for redhat or centos support.
[13:20:49] jstew: JoshuaPaling: If you were running debian or ubuntu, I could help you a little more, but unfortunately I don't know RHEL at all
[13:21:07] JoshuaPaling: OK thanks anyway.
[13:21:14] universa1: JoshuaPaling: maybe try the passenger irc channel, one of the authors is there quite oftne
[13:21:26] JoshuaPaling: Will do, thanks
[13:21:35] jstew: FooBarWidget is here a lot too. He's the author of passenger.
[13:21:35] FooBarWidget: jstew: I am currently away. My timezone is Europe/Amsterdam. Please wait until I'm back or check www.phusionpassenger.com/support.
[13:32:43] Encosi: I am making a site that will show a weekly ranking of people. Each week a person may go up or down. How can I write something that will know when it is the end of a week and do that processing? I have a weak grasp on how to process things in real time but I do not know how to setup something that either runs every so often or knows when to run
[13:33:44] juo100: https://github.com/javan/whenever ?
[13:33:47] injekt: Encosi: use a cron job
[13:34:32] Encosi: oh I didnt know I could do that
[13:35:03] Encosi: juo100: that is perfect for me. Thanks!
[13:38:23] Mikail_: Hi, I have a fundamental question. I'm trying to include/require an external module with some classes in that in my project. Basically I collect login credentials in a form, and calls an external login method with those towards a remote REST API - returning an object with the login info, cookie etc. I need this object to call various methods that I display in my project. So It needs to be stored somewhere between models, controlle
[13:38:24] Mikail_: and various views. Is there some standard way to do this?
[13:41:11] oceabreeze: Guys how do you know which object/ method and when is he called? For me Ruby is a mess
[13:41:55] nerdman: is there a way to remove objects with update_attributes
[13:42:48] nerdman: oceabreeze: what do you mean
[13:44:37] oceabreeze: nerdman: i spent one year learning Ruby and RoR, reading various books, watching screencast. I do understand some code there and there, i do understand MVC pattern, but i still have no idea how the Big applciations inner logic.
[13:45:06] oceabreeze: nerdman: RoR source is a pain to walk through.
[13:45:18] oceabreeze: nerdman: I barely understand it.
[13:46:27] oceabreeze: nerdman: Hovewer i can easy set up quickly up and running RoR application, using some scaffolding, stealing code examples there and there.
[13:46:45] oceabreeze: But i feel like false programmer.
[13:46:58] oceabreeze: by doin this
[13:47:35] juo100: If you learn the internals of Rails, you will feel like a false programmer because you don't understand C
[13:48:40] juo100: What I'm saying is, how low down the stack do you want to go?
[13:48:47] nerdman: oceabreeze: but did you have spesific question?
[13:49:14] juo100: everyone is standing on the shoulders of giants to some degree
[13:52:28] nerdman: juo100: i dont think so, u dont need to know c, nor any other language, to feel programmer
[13:52:50] avril14th: if you can type your pin code at the atm
[13:52:54] avril14th: you're some degree of programmer
[13:53:50] juo100: nerdman: http://railscasts.com/?tag_id=39 might be of some interest to you
[13:54:14] toretore: oceabreeze: there's only one way to become a better programmer - practice, read, learn. rinse and repeat
[13:54:21] juo100: oceabreeze: even http://railscasts.com/?tag_id=39
[13:54:38] oceabreeze: toretore: true
[13:55:09] toretore: good ruby programmers have spent thousands of hours to become good
[13:55:25] toretore: *good programmers in general
[13:56:10] toretore: it's not something they were born with, and it's not some magic trick they discovered but didn't share with ahyone
[13:57:15] skroon: I would like to add javascript tracking code per page, what is a nice way to have per view javascript files? that's called unobtrusive js right?
[13:57:32] toretore: skroon: elaborate
[13:58:26] momomomomo: You mean you want to have a user.js which only loads on User views, and a (for example) blog.js which only loads on blog views? skroon
[13:59:52] momomomomo: skroon That's possible, you'll just need to dig in a bit more here http://guides.rubyonrails.org/asset_pipeline.html#how-to-use-the-asset-pipeline
[14:02:38] skroon: momomomomo: cool, thanks
[14:11:33] nerdman: juo100: thanks, but cannot find why foo.update_attributes(:bars => [{id:1,"_destroy"=>true}]) wont remove model
[14:12:42] workmaster2n: Is there a migration to change the postgresql Time Without Timezone type to Time With Timezone?
[14:14:07] Scient: workmaster2n: why would you want that though?
[14:16:42] workmaster2n: Scient: I've got 2 Time columns in my table (start_time, end_time) and I need to now when an event happens between those times (I don't care what day it happens on, just the time, like hours:minutes:seconds). Using the time column without timezone is giving me the wrong results (all my start and end_times are shifted by 5 hours (I'm Central Time))
[14:17:24] nerdman: juo100: found it, http://apidock.com/rails/ActiveRecord/NestedAttributes/ClassMethods/accepts_nested_attributes_for
[14:18:40] juo100: accepts_nested_attributes_for…..
[14:18:42] juo100: ACTION runs away
[14:19:33] nerdman: ACTION grabs juo100 before he runs and asks why
[14:19:55] mantas322: Hey guys, its me again
[14:19:59] mantas322: im a bit of a noob
[14:20:08] mantas322: I installed the gem rubyzip
[14:20:12] juo100: its ok for simple stuff but if start getting into complex associations etc its a real pain the ass
[14:20:13] mantas322: restarted my server
[14:20:32] IlyaLevin: Hi guys! I'm using Rails 4.0. And I have a blueprint.css.scss file in app/assets/stylesheets that I need compiled aside from application.css. How do I do that?
[14:20:36] mantas322: now im trying to go by the github example and use "require 'zip'
[14:21:02] juo100: mantas322: does you app have a Gemfile?
[14:21:11] universa1: IlyaLevin: look at config/envs/production.rb -- there is a ssection about that.
[14:21:13] mantas322: oh also I added "gem 'rubyzip"
[14:21:29] juo100: and ran "bundle install" ?
[14:21:29] mantas322: I did "gem install rubyzip" on my app
[14:21:46] juo100: or just "bundle" should do the trick
[14:22:30] mantas322: still says LoadError
[14:22:48] mantas322: cannot load such file -- zip
[14:22:54] mantas322: its telling me ^
[14:23:06] juo100: require 'zip/zip'
[14:23:15] mantas322: i have the require it has a problems with within a controller class
[14:23:35] mantas322: no more error
[14:23:41] mantas322: "zip/zip" worked
[14:24:34] mantas322: Is there anyreason for this extra zip
[14:24:45] mantas322: or is that just the way it is?|
[14:26:13] juo100: require 'zip' will work as well
[14:27:02] universa1: gem "rubyzip", require: "zip/zip" iirc
[14:27:22] mantas322: yup, that works with the double 'zip'
[14:27:35] juo100: https://github.com/rubyzip/rubyzip
[14:27:47] mantas322: yeah, that one shows only one zip
[14:27:48] juo100: https://github.com/rubyzip/rubyzip#basic-zip-archive-creation
[14:27:55] mantas322: which causes a loaderror
[14:29:20] mantas322: I do some ruby development on Windows Aptana
[14:29:51] mantas322: I like the intellesense on it and auto param additions
[14:30:08] mantas322: when i port my crap over to rails I use a mac, and textmate
[14:30:16] mantas322: which has none of those features
[14:30:28] mantas322: what do you mac people use to type your rails>
[14:30:35] universa1: mantas322: rubymine might be something for you then
[14:30:35] lectrick: Radar: The improvement of yesterday's code: https://gist.github.com/pmarreck/e6b62c8f4be6e6ba5f63 And that, my friends, is how we tightly control a friggin monkeypatch. :)
[14:30:36] jstew: mantas322: sublime text is better than textmate.
[14:30:48] universa1: mantas322: i personally use sublime nowadays, but only because it's cross platform
[14:30:53] mantas322: i ave rubymine on my windows machine and briefly played around with it
[14:31:11] jstew: I'm a fan of Emacs, but ST or vim is what a lot of people here use.
[14:31:16] juo100: sublime for the same reasons as universa1
[14:35:08] IlyaLevin: I use redmine, vim and nano
[14:35:37] mantas322: comment block in rails is not /# comment #/
[14:37:48] geoffw8_: if I'm not too late to the party
[14:41:41] stef1a: how do you get a flash to show only after signup?
[14:42:13] pentameter: The release of the latest version of rails yesterday has broken a bunch of tests because it seem to require activerecord 3.2.14, which doesn't seem to exist. Help?
[14:42:37] universa1: stef1a: users#create; if user.save; flash[:notice] = "successfully signed up";end
[14:44:18] stef1a: universa1: where do I put that in a view though?
[14:44:22] stef1a: err, not that
[14:44:27] stef1a: but the corresponding view code
[14:44:32] stef1a: i know that goes in the user controller
[14:44:50] wmoxam: hrmm, looks like 3.2.14 is out
[14:44:53] universa1: stef1a: ? you have some code in your layouts/application
[14:44:58] wmoxam: but no announcement yet :p
[14:45:11] universa1: pentameter: hmm, ar 3.2.14 doesn't show up on rubygems.org yet
[14:45:20] universa1: stef1a: so what is the problem?
[14:46:18] Soulcutter: pentameter: lock it down for now, I guess?
[14:46:36] stef1a: universa1: putting this in app/views/users/show.html.erb: http://pastie.org/8167608# does not work
[14:46:47] stef1a: even if i replace [:success] with [:notice]
[14:47:29] pentameter: Not my code and the "developer" can't be bothered with fixing any of this. Things are hidden too many layers down
[14:48:28] pen: how do I scale with attr_accessible? right now it's a mess and it's hard to maintain
[14:48:45] wmoxam: Haven't you heard? Rails doesn't scale
[14:49:08] pen: that's not my question. i'm not talking about that
[14:49:10] universa1: pen: even though that basically has nothing to do with scaling: look at the strong params gem
[14:49:14] elaptics: pen: scale how?
[14:49:21] pen: when you have tons of attribtues to set
[14:49:26] chris____: Does anyone know how I can stop ActiveRecord converting DAte objects into UTC time? : record.taken_at = Date.new(2013,1,2) ; record.save! ; record.reload ; record.taken_at # -> 1 Jan 2300 : .
[14:49:34] pen: and you need to write all those down in attr_accessible for mass assignment it pretty tedious
[14:50:12] pen: you get this huge list of attributes in one place
[14:50:45] Soulcutter: chris____: there's a config option for time zone
[14:50:47] elaptics: pen: if you have too many attributes on a single model it suggests that maybe that class has too much responsibility
[14:50:50] pen: sometimes you forgot about it when you add a few attributes and found out that some saving of the model does not work because you forgot to add attributes in attr_accessible
[14:50:57] mantas322: Errno::ENOENT
[14:51:00] mantas322: what the H!
[14:51:15] mantas322: stack says its a permissions problem
[14:51:26] toretore: pen: how many times are you adding a huge list of attributes?
[14:51:28] mantas322: I have to check my folder structure from the root to the en.yml file
[14:51:47] pen: toretore: what do you mean? you have to maintain a list of that in every model isn't it?
[14:51:57] toretore: so? it's one time
[14:52:00] mantas322: how do I make my directories readable by the webserver
[14:52:03] pen: toretore: one time of shit
[14:52:12] pen: and it's redundant sometimes
[14:52:19] pen: I would wish I can just do that in field
[14:52:23] elaptics: pen: your tests should help you know that something is missing
[14:52:24] pen: not in a separate line
[14:52:24] momomomomo: woah woah, I'm confused here
[14:52:28] toretore: oh stop whining and get to work
[14:52:36] Soulcutter: chris____: config.time_zone in application.rb
[14:52:49] helpa: mantas322: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[14:52:49] momomomomo: mantas322: !code
[14:53:08] toretore: pen: in the time you've been in here whining you could've added 100 fields in 100 models
[14:53:25] mantas322: I have an Errno::ENOENT error saying that no such file exists in directory x
[14:53:28] mantas322: when it totally does
[14:53:31] omarqureshi: or you could add it to the controller and use strong parameters :<
[14:53:39] momomomomo: I bet I could add 100 models toretore
[14:53:49] helpa: mantas322: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[14:53:49] momomomomo: mantas322: !code
[14:53:53] pen: omarqureshi: ok, I will check out strong parameters
[14:54:01] Guest15036: !??????????????
[14:54:17] helpa: Guest15036: You are not worthy of this bot!
[14:54:17] universa1: Guest15036: !unworthy
[14:54:49] mantas322: my code is here. I'm using the ruby zip example https://github.com/rubyzip/rubyzip "Basic Zip archive creation
[14:55:44] toretore: let me guess.. you copied /Users/me literally
[14:56:06] mantas322: I created a /zipfolder/ in the root of my site
[14:56:10] mantas322: and im trying to access a file within it
[14:56:20] toretore: WELL THEN THAT'S NOT YOUR CODE
[14:56:24] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[14:56:31] universa1: and add the full stack trace, too.
[14:57:01] momomomomo: toretore: mantas322 gotta run, you're in good hands but paste your damned code
[14:58:39] mantas322: gist.github.com/MantasJas/6063001
[14:58:49] mantas322: https://gist.github.com/MantasJas/6063001
[14:59:24] toretore: paste the entire file and the entire stacktrace
[14:59:43] mantas322: thats in a controller
[14:59:49] mantas322: that is the entire thing that happens
[14:59:55] mantas322: hang on for trace
[15:00:08] toretore: paste the entire file
[15:00:12] toretore: god damn it
[15:01:11] mantas322: https://gist.github.com/MantasJas/6063029
[15:01:56] mjc_: mantas322: put / at the front of the file paths
[15:02:08] mjc_: er, folder path
[15:02:46] juo100: you might want to take a look at http://stackoverflow.com/questions/3724487/rails-root-directory-path as well
[15:03:25] juo100: Rails.root.join('zipfolder','mantas.txt')
[15:03:36] juo100: should return a valid path, for example
[15:04:51] pontiki: mantas322: is there a reason one of those says 'Siters' and the othe 'Sites'?
[15:05:10] pontiki: lines 2 - 3
[15:05:26] mantas322: that worked
[15:05:33] mantas322: thanks pontiki
[15:05:43] mantas322: tuesday morning typo :/
[15:05:52] mantas322: damn siters
[15:06:11] pontiki: typos for each day of the week... :)
[15:06:26] stef1a: universa1: thanks, you helped me get the signup flash working!
[15:06:38] juo100: mantas322: refactor it to use Rails.root.join if you're going to use the app anywhere else
[15:06:56] juo100: because the path will likely be different
[15:07:26] mantas322: okay, I will
[15:08:43] cschep: Hi. I'm using Devise for Users in a rails 3 app. I have a has_many through relationship setup to create "Subscriptions" that tie a user to another object in the database called a Sensor. All are ActiveRecord objects, very standard rails. I want to make a form for the users to Subscribe to certain sensor notifications, but I'm kinda stuck.. do I override the Devise controller and put the logic there? Or do I make a new Subscriptions
[15:08:43] cschep: controller and do it there?
[15:09:53] toretore: SubscriptionsController
[15:11:31] mikecmpbll: hmpf. why isn't rails clever enough to automatically know that from user_post_path(@post), that the :user_id part of the URL should be @post.user?
[15:11:38] mikecmpbll: it's not as though it could be anything else -__-.
[15:11:49] toretore: but it could
[15:12:00] toretore: by being something else
[15:12:21] mikecmpbll: but post IDs are unique, there couldn't be /users/1/posts/1 and /users/2/posts/1
[15:13:14] momomomomo: mikecmpbll: here we are again http://stackoverflow.com/questions/9975801/has-many-through-and-path-helper-accessing-resources-through-the-application
[15:13:26] toretore: how would user_post_path know that?
[15:13:37] cschep: toretore that's the route i'm heading down.. so inside that new controller i can set the array of sensor_ids on user and it will create/delete the records in the join table?
[15:13:45] mantas322: okay this is great
[15:13:48] mikecmpbll: toretore: because the resources are nested
[15:13:58] toretore: but how? be explicit
[15:14:04] mantas322: now I need to send my zip file to the users browser for download
[15:14:12] juo100: send_file mantas322
[15:14:27] mikecmpbll: momomomomo: again, way? and what's that link to do with it
[15:14:27] juo100: http://apidock.com/rails/ActionController/Streaming/send_file
[15:14:34] momomomomo: cschep: http://guides.rubyonrails.org/association_basics.html#the-has-many-through-association
[15:14:44] momomomomo: Look at the accepted answer mikecmpbll
[15:14:48] toretore: cschep: no, you have a SubscriptionsController for managing Subscriptions. if a user wants to create a new subscriptions, you create a new Subscription
[15:14:54] toretore: cschep: don't overthink it
[15:15:13] momomomomo: toretore: he wants subscriptions to other objects
[15:15:17] mikecmpbll: momomomomo: i have?
[15:15:20] toretore: momomomomo: wrong user
[15:15:33] cschep: toretore ha. totally. thanks man.
[15:16:17] toretore: big blob of cells
[15:16:23] momomomomo: take that back
[15:16:25] mikecmpbll: toretore: resources :user do resources :post end <-- i would've thought that from that it can know that posts belong to users
[15:16:33] juo100: mantas322: didn't actually test this, but something like this http://pastie.org/private/t2xvj4ykm2uv0l9dmw5pw
[15:16:39] toretore: mikecmpbll: how?
[15:16:43] mikecmpbll: because they're nested.
[15:16:51] toretore: what's nested?
[15:17:03] mikecmpbll: i can't tell if you're trolling me
[15:17:17] mikecmpbll: the post resource is nested in the user resource.
[15:17:30] toretore: i'm trying to get you to think about it and explain exactly how it is supposed to work other than "be vlecer about it"
[15:17:56] mikecmpbll: don't get me wrong, i'm sure there's a perfectly good reason why it doesn't behave this way, but I'm trying to figure out what that is.
[15:18:15] momomomomo: mikecmpbll: where's your controller / model code
[15:18:36] mikecmpbll: momomomomo: what.
[15:18:38] toretore: right. resources are nested. but how does user_post_path know that the object you send should then have a user_id that will go in the slot :user_id in the route?
[15:18:46] momomomomo: ~~~~~~~~~~~~~~~~~~~~
[15:19:01] toretore: 8========D~~~~~~~~
[15:19:08] momomomomo: we're being trolled toretore
[15:19:54] toretore: no, i understand the question, i'm just trying to make him think it through
[15:20:10] toretore: there's much too little thinking going around in this channel
[15:20:13] mantas322: well, that was easy
[15:20:15] mikecmpbll: toretore: because it's implicit in the route.
[15:20:30] toretore: mikecmpbll: what is?
[15:21:00] mikecmpbll: the relationship between post and user.
[15:21:09] juo100: toretore: Teach a man to reason and he'll think for a lifetime
[15:21:18] mantas322: so this might not be possible
[15:21:28] mantas322: but I would like to create the zipfile without saving it locally
[15:21:30] toretore: you're still not explaining exactly how it would translate that knowledge to use it in the situation you imagine
[15:22:06] toretore: what you're trying to suggest is that it could infer the name of the association from the routing
[15:22:31] mikecmpbll: the class of the related object, at the very least.
[15:22:47] juo100: mantas322: I'm guessing, not possible
[15:22:53] momomomomo: mantas322: start googling around, before coming to the channel
[15:23:08] juo100: well it is possible but it won't be trivial
[15:23:24] toretore: so if you have a parent resource 'user', you could guess that when a Post object is passed as the first argument, it will have a 'user_id' from which to get the user_id
[15:23:38] wmoxam: ACTION stabs compass
[15:23:56] toretore: it would probably work, and it's very railsy and they would probably add it if you suggested it
[15:24:23] mikecmpbll: toretore: you could guess that it has an association with a class User, and get the foreign_key by reflection.
[15:24:56] toretore: i don't know if a route/resource is aware that it has a parent
[15:25:11] toretore: but it could come from an outside source
[15:25:20] toretore: or be decided on the outside
[15:26:05] momomomomo: toretore: nested routes exist http://guides.rubyonrails.org/routing.html#nested-resources
[15:26:25] toretore: someone isn't paying attention ;)
[15:26:53] momomomomo: no, sorry :/
[15:31:11] nT4BR: Hi guys, anybody can help me with a relation problem? i have a many to many relation, where one of the sides, are a single table inherited model, code => https://gist.github.com/nathanpsouza/6059685
[15:31:51] momomomomo: What'st he issue nT4BR
[15:32:26] nT4BR: momomomomo: when i save the relation, in the column type, its save the base class. I want to store the child class in type
[15:33:25] tubbo: has anyone here ever made their own IRB "console"?
[15:33:32] momomomomo: Weird that you're including other models, but what's the error nT4BR ?
[15:33:46] momomomomo: tubbo: #ruby might help
[15:33:47] tubbo: i have a shell tool that i need an IRB console for
[15:34:04] tubbo: yeah good point
[15:34:23] toretore: do you mean an actual irb console or something interactive that works like irb
[15:34:27] nT4BR: momomomomo: the relation was stored in the categorized table, and in type, its store de base class of STI (Product) not the child (Course)
[15:34:30] jstew: eval is your friend?
[15:35:09] wmoxam: https://twitter.com/zedshaw/status/359693678517825538
[15:35:12] momomomomo: ok nT4BR I'm not following too well - but let's see your error on that gist
[15:35:30] momomomomo: wmoxam: you were here yesterday trying to start drama too
[15:35:34] momomomomo: wmoxam: welcome back!
[15:35:36] jstew: re-implementing IRB would probably suck. I've implemented repl in lisp before but code is data and data is code. Makes it simple.
[15:36:06] jstew: Oh boy... Zed always has something to say.
[15:36:59] wmoxam: momomomomo: oh?
[15:37:06] toretore: like everyone else, sometimes it's worthwhile, other times it's not
[15:37:14] momomomomo: wmoxam: don't remember your 'ruby is like vb' comment?
[15:37:27] toretore: people who say less have a higher worthwhile/not ratio
[15:37:33] wmoxam: momomomomo: yeah totally, it's VB for the web
[15:37:59] toretore: i guess i'm on the opposite end
[15:38:04] wmoxam: therefore we are all VB programmers
[15:38:48] wmoxam: momomomomo: jokes are allowed in here btw
[15:39:51] momomomomo: ah, couldn't read your sarcasm yesterday :p
[15:40:41] mantas322: I found this response to my problem http://stackoverflow.com/questions/2405921/how-can-i-generate-zip-file-without-saving-to-the-disk-with-ruby
[15:40:45] mantas322: works without error
[15:41:02] mantas322: I'm assuming I use binary_data to send to user?
[15:41:16] nT4BR: momomomomo: any ideia about how to solve this?
[15:41:29] mantas322: send_file = binary_data, :type=>"application/zip"
[15:41:37] momomomomo: mantas322: that's pretty interesting, thanks for looping back
[15:41:45] momomomomo: nT4BR: I'm still waiting for your stacktrace
[15:42:47] momomomomo: How, exactly, are you trying to save it? Ie: where are you when you save, and where is the controller code for that?
[15:43:17] nT4BR: momomomomo: haven't erros being displayed, what happen is that when i save a new categorizable ex Course, it's stored on database with Product type. I Will update the gist with my controller code
[15:44:19] jstew: I had to stop following Zed on twitter. Signal to noise ratio was too much... Same with DHH.
[15:46:00] mantas322: this might help me http://www.devinterface.com/blog/2010/02/create-zip-files-on-the-fly/
[15:46:07] mantas322: if it wasnt in some forign language
[15:46:19] nT4BR: momomomomo: updated with controller code and migrations
[15:47:18] toretore: mantas322: stop looking for a copy/paste solution and start learning what's actually going on in your code
[15:47:37] toretore: 1) how do i create a zip archive
[15:47:51] toretore: 2) how do i get the raw data of that archive
[15:48:01] toretore: 3) how do i send the data to the client
[15:48:04] mantas322: this is how i learn
[15:50:10] jstew: I learn by outsourcing my code to the cheapest bidder.
[15:50:44] terrellt: Anyone remember that gem that adds comments to the top of your AR models with the table schema?
[15:51:58] bzitzow: What is a view_context?
[15:52:09] davidcelis: terrellt: !gem annotate
[15:52:27] toretore: evenin eladmeidar
[15:52:36] eladmeidar: toretore: evening? really?
[15:52:49] davidcelis: eladmeidar: shhhhhh, you're a programmer
[15:52:51] toretore: i'm chronologically challenged
[15:52:53] davidcelis: don't talk about timezones
[15:52:57] davidcelis: everybody stop
[15:52:58] eladmeidar: davidcelis: i'm a god in japan
[15:53:00] toretore: fucking timezones
[15:53:39] eladmeidar: current timezone keeps me off the grid for americans until mid day
[15:53:41] eladmeidar: which is a good thing
[15:54:16] bzitzow: davidcelis: activemodel serializers is cool
[15:54:19] bzitzow: thanks for the tip
[15:54:40] davidcelis: bzitzow: you're welcome
[15:55:03] davidcelis: bzitzow: make sure you don't have serializers embedding each other in a circular way. the gem totally fails at handling that right now
[15:56:33] eladmeidar: toretore: i'm bored.
[15:56:43] bzitzow: controllers convention is plural?
[15:56:51] eladmeidar: working on a 3dcart gem, API sucks.
[15:57:03] diegoviola: hi, i need to implement 'likes' in my api, i have users and movies, i want to be able to tell 'user foo can like movie bar' and such, how do i go in doing this?
[15:57:34] toretore: eladmeidar: i'm having fun, playing with jq
[15:58:16] toretore: much better thought out than i expected it to be
[15:58:28] jarray52: How does one load a schema.rb file into a test database without touching the dev or production databases?
[15:58:32] eladmeidar: toretore: envy.
[15:58:38] momomomomo: nT4BR: Sorry, but I think you'll need someone to dig into your code and spend some time trying to understand what you want before moving forward… someone here with more experience with polymorphism might be able to help, but that's not me. His gist (https://gist.github.com/nathanpsouza/6059685)
[15:58:49] eladmeidar: diegoviola: too vogue, explain a little bit more
[15:59:19] toretore: i expected some cute json tricks with lots of edge cases, inconsistencies and ambiguity, but so far none of that
[15:59:39] momomomomo: jarray52: http://guides.rubyonrails.org/testing.html#preparing-your-application-for-testing
[15:59:42] mantas322: for anyone interested in using a ZipOutputStream to create compressed downloads on the fly
[15:59:43] toretore: eladmeidar: you're too vogue
[15:59:44] mantas322: http://www.devinterface.com/blog/2010/02/create-zip-files-on-the-fly/
[16:00:07] eladmeidar: toretore: i know, that is what keeps me attractive
[16:00:32] davidcelis: diegoviola: !github davidcelis/recommendable
[16:00:45] asoliman: if i have an event object that i am updating via ajax, and an action.js.erb file to handle the unobtrusive js for the response, can i manually define the location of the file?
[16:00:56] nT4BR: momomomomo: ok, i'm refactoring some things here
[16:00:58] asoliman: i have an admin folder under which the events folder resides
[16:01:02] diegoviola: eladmeidar: i have to create an api to add/delete/update users and movies, i know how to do this part, but i also have to create and delete likes, users can like movies but not like the movie twice, i don't know how to do this liking part
[16:01:09] eladmeidar: asoliman: render.
[16:01:11] diegoviola: davidcelis: ty
[16:01:53] Spami: Hey guys, on formtastic, is there any way to tell the wrapper to not wrap the <label> ?
[16:01:59] eladmeidar: diegoviola: https://github.com/ryanto/acts_as_votable
[16:02:26] asoliman: eladmeidar: so would i do respond_to |format| format.js { render action.js.erb }
[16:02:39] diegoviola: eladmeidar: thanks
[16:03:32] eladmeidar: asoliman: yes
[16:03:50] treehau55: Would this be a good use for a struct, or should I use something else: In my app I have permissions, some are higher level than others, I have a is_permissible object, I want it to return true if you have a certain level, rather than check for the inclusion of each indiviual permissions
[16:03:50] treehau55: is_permissible check*
[16:03:51] eladmeidar: diegoviola: np
[16:03:52] asoliman: eladmeidar: thank you, i will give that a try :)
[16:04:11] davidcelis: eladmeidar: that gem has a super weird API
[16:04:18] eladmeidar: davidcelis: indeed
[16:04:21] davidcelis: @post.liked_by @user
[16:04:52] davidcelis: @user.likes @post
[16:04:58] davidcelis: sounds like it should be a predicate, but it actually creates the vote
[16:10:19] mantas322: I'm pretty happy with this..
[16:10:34] mantas322: wasn't too difficulty to figure out for a rails novice either..
[16:12:12] jarray52: momomomomo: When I run db:test:load, I get the error "PGError: ERROR: invalid value for parameter "search_path": ...DETAIL: schema "... does not exist." Is there a way to just run the schema.rb file on the test database?
[16:23:45] nivoc: Is there a wasy to specify within a model that this model is only valid if it has at least one child model?
[16:25:06] tkrajcar: https://github.com/perfectline/validates_existence maybe?
[16:25:13] tkrajcar: if not, a custom validator
[16:26:10] jarray52: When I run db:test:load, I get the error "PGError: ERROR: invalid value for parameter "search_path": ...DETAIL: schema "... does not exist." Is there a way to just run the schema.rb file on the test database?
[16:28:52] nikeita: it is possible to call a controller action when change a select button?
[16:29:45] mody: hello, i have a question about 'bundle exec' command, this is necessary with last version of rails ?
[16:30:12] webdestroya: it is completely independent of the version of rails
[16:31:46] TheBlackMan: mody, webdestroya: I've never had to run it
[16:31:59] mody: i have noticed that rails 4 use a gem called rubygems-bundler , i think this gem allow us to omit typing bundle exec every time no ?
[16:32:41] webdestroya: you have never had to run it because you only have 1 version of rails
[16:32:42] TheBlackMan: moody why are you typing bundle exec?
[16:32:42] mody: i also use the latest stable rvm version
[16:32:44] webdestroya: or are using the latest
[16:33:17] webdestroya: if you had multiple versions, then you could have problems
[16:35:40] mody: TheBlackMan > i use it on a program that their creators wrote it when certain versions of gems were available
[16:37:50] asoliman: I am using nested resources https://gist.github.com/abdallahsoliman/56abe8844a2153c50afb and when preforming a create from the administrative panel, the council is selected from a select box in the form...which means i cannot properly use a form_for by doing [council, council_event], how can i perform the create?
[16:38:02] asoliman: sorry that question is probably very poorly worded
[16:40:56] toretore: asoliman: have the user select the council first, which then redirects to /councils/x/events/new
[16:41:05] toretore: or stop using nested resources
[16:41:12] asoliman: toretore: i am doing the update via ajax
[16:41:54] toretore: well then you need to make the request go to /councils/x/events where x is the selected id
[16:41:59] asoliman: toretore: would it be better to not use nested resources?
[16:42:25] toretore: you could have both
[16:42:58] toretore: GET /councils/x/events would show that council's events, but to create you use /events
[16:43:31] asoliman: ah, ok so just add in another resources :events and utilize that for creation
[16:44:37] bzitzow: ActiveModel::Serializer I configured only two attributes, but when I hit the resource endpoint it is revealing all the attributes of the object. Anyone know why that might be?
[16:45:01] bzitzow: I know serializer is processing it, because when I set {root: false} options it removes the root resource name
[16:47:00] TheBlackMan: bzitzow: paste code for that serializer and the output of that endpoint .json
[16:47:15] TheBlackMan: I use AR serializer with emberjs and your issue is not happening with me
[16:49:36] bzitzow: TheBlackMan: I restarted rails server and Voila!
[16:49:58] TheBlackMan: bzitzow: sometimes the solution is the most simple
[16:50:52] diegoviola: any advice for api design? i need to build some rest api's
[16:51:01] diegoviola: i haven't done this in a while
[16:52:11] rhizome: is there more advice required than "figure out what you want to expose?"
[16:53:17] Bumptious: How can one use the root_url variable from within a model?
[16:53:23] diegoviola: rhizome: right thanks
[16:54:26] rhizome: Bumptious: best is to figure out how not to need it there
[16:55:57] Hiroshi: I cloned a GitHub repository into my server and the app directory doesnt have a GemFile. How would I do a bundle install?
[16:56:59] Bumptious: @rhizome I'm considering how best to do that
[16:57:06] Bumptious: this is for a sitemap pinger
[16:57:28] Bumptious: for some reason the tutorial which I found for this places the sitemap pinger in the models directory
[16:58:06] rhizome: Bumptious: not sure why that would be so. it should be just some xml thingy you can return from a controller
[16:58:30] korobkov: just simple question about rails routes (#routes.rb):
[16:58:30] korobkov: why is `resources :a, :b, :c` allowed,
[16:58:30] korobkov: while `resources %i(a b c)` (the same is `resources [:a, :b, :c]`) - not??
[16:58:30] korobkov: is this intentionally, or may be it's a bug? How could I workaround it?
[16:58:32] davidcelis: Hiroshi: you wouldn't. it needs a Gemfile. repo link?
[16:58:39] davidcelis: korobkov: please don't paste code in here
[16:58:41] rhizome: korobkov: don't do that
[16:58:42] helpa: korobkov: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[16:58:42] davidcelis: korobkov: !gist
[16:58:47] Bumptious: the pinger hits search engines and tells it hey, look at mysite.com/sitemap.xml
[16:58:52] Bumptious: so it needs the mysite.com
[17:00:13] rhizome: Bumptious: oh, i see. should still be triggered via controller or similar outside of the model. Pinger.ping(domain) or whatever
[17:00:38] Bumptious: thank you sir or madame
[17:00:44] davidcelis: korobkov: anyway, to answer your question, it's because the resources method definition takes *args
[17:00:50] rhizome: BROSEPH, ALWAYS BROSEPH
[17:00:59] davidcelis: it expects arguments to be splatted rather than come in as an array
[17:01:10] helpa: rhizome: Portmanbreaus are brohibited in this channel, as decreed by Broseidon, God of the Brocean.
[17:01:10] davidcelis: rhizome: !bro
[17:02:38] korobkov: davidcelis: thanks, so tell me please, how this (*args) is called for me to search it on stackoverflow or elsewhere...
[17:02:47] davidcelis: korobkov: * is the splat operator.
[17:03:02] Hiroshi: This is the repo link https://github.com/elevenarms/three45
[17:03:16] davidcelis: that's three years old...
[17:04:04] davidcelis: it's probably not using bundler
[17:04:09] davidcelis: it's on Rails 2.0.2 dude what are you doing
[17:04:29] diegoviola: how do i test my rest api?
[17:04:54] davidcelis: ohg od everything is in vendor/plugins
[17:04:56] davidcelis: Hiroshi: run
[17:05:07] davidcelis: diegoviola: like, unit testing?
[17:05:23] davidcelis: vanilla rails? rails-api?
[17:05:31] davidcelis: just test it like you would any other rails app?
[17:05:56] davidcelis: only you don't have to worry about view testing ;)
[17:06:06] diegoviola: right, thanks
[17:06:35] nivoc: Hi. What whats the syntax to create a new dependent model? like new door-object for this car?
[17:06:45] nivoc: @car.newDoor
[17:06:52] davidcelis: that... that's not ruby.....
[17:07:11] davidcelis: nivoc: you create a model called Door and associate it with Car
[17:08:47] nivoc: davidcelis: hmm yes but wasn't there a way to create a new already associated door-model?
[17:09:06] davidcelis: rails g model Door car:references
[17:09:26] amh345: is there a clean way to have several hundred domains use one cookie_store while having another single domain use it's own cookie_store??
[17:09:29] davidcelis: :references is a shortcut that creates a car_id (if you want it to be a one-to-many relationship) and puts `belongs_to :car` in the model
[17:09:54] nivoc: davidcelis: yes I have the dependency already - but i'm now in the controller
[17:10:21] davidcelis: you want to create an _instance_
[17:10:26] nivoc: davidcelis: and want to create empty dependent models before saving
[17:10:28] davidcelis: @car.doors.new
[17:10:29] nivoc: davidcelis: yes :-)
[17:10:37] nivoc: davidcelis: thx
[17:10:42] davidcelis: you can call methods to initialize and create associated models right on the association
[17:10:52] Bumptious: @rhizome this tutorial is using an observer, which i've never used before, to trigger the ping function
[17:11:00] Bumptious: and the observer does not have access to root_url either
[17:11:02] davidcelis: nivoc: a list of stuff like that you can do is here http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html
[17:11:40] nivoc: davidcelis: ah thanks that helps a lot :-) not so dark here anymore :-)
[17:14:24] nikeita: this code i correct? params[:year] ||= Date.today.year unless params[:year]
[17:14:41] korobkov: davidcelis: thanks! :) that was exactly my question: http://stackoverflow.com/questions/6670863/how-do-i-pass-an-array-to-a-method-that-accepts-an-attribute-with-a-splat-operat
[17:14:58] korobkov: good bye all! :)
[17:18:18] Catbuntu: One question.
[17:18:44] Xeago: in rails routing
[17:18:54] Xeago: can I define something like resource, instead of resources?
[17:19:01] Catbuntu: I have a model named Entry, and if I want to create a new one I should do Entry.new({name: "Whatever"}).
[17:19:01] Xeago: as in, there will be only 1 of it?
[17:19:03] davidcelis: Xeago: lolbro
[17:19:08] davidcelis: Xeago: it's right in the docs for routes
[17:19:11] davidcelis: Xeago: !routes
[17:19:12] Catbuntu: But it doesn't darn work.
[17:19:16] helpa: Xeago: http://guides.rubyonrails.org/routing.html - Rails Routing From the Outside In - Rails Guide - by Mike Gunderloy
[17:19:16] davidcelis: Xeago: !routing
[17:19:19] davidcelis: short answer: yes
[17:19:23] davidcelis: long answer: read that
[17:19:45] helpa: Catbuntu: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[17:19:45] davidcelis: Catbuntu: !e
[17:19:54] Catbuntu: I read and found that you have to do attr_accessible :name at the model, but that's discontinued in Rails 4.
[17:20:05] Catbuntu: I know it's still available as a gem but i prefer doing it the right way.
[17:20:09] davidcelis: what "doesn't work"
[17:20:20] Catbuntu: Well there's no error, let me tell you.
[17:20:43] Catbuntu: If I try it in the console (e = Entry.new({name: "Blah"}) ), I get a new Entry which :name is nil.
[17:20:49] Catbuntu: whose name is*
[17:21:19] Catbuntu: And it should have a :name "Blah"
[17:21:24] davidcelis: p.s. the curly braces aren't necessary, it'll coerce them into a hash correctly. people typically omit those as the idiom
[17:21:44] Catbuntu: Oh that's great.
[17:22:04] Catbuntu: But why doesn't it work? I guess it would work installing the gem for the old attr_accessible but I prefer doing it the right way.
[17:22:14] Catbuntu: I tried attr_accessor and it doesn't work either.
[17:22:53] davidcelis: attr_accessible won't help you
[17:23:03] Catbuntu: https://gist.github.com/unrar/6064254
[17:23:06] davidcelis: attr_accessor defines a virtual attribute, something that isn't backed by a DB column, and probably won't help you
[17:23:13] elaptics: Catbuntu: is this a new rails 4 project? Or have you upgraded from 3.2?
[17:23:22] Catbuntu: elaptics, new project.
[17:23:26] davidcelis: that is super weird
[17:23:30] davidcelis: Catbuntu: is the project on the githubs
[17:23:40] Catbuntu: yes, wait a sec
[17:24:01] elaptics: Catbuntu: hmm, that is odd. It should just work
[17:24:11] Catbuntu: this is the migration: https://gist.github.com/unrar/6064266
[17:24:17] davidcelis: Ruby on Rails! It Just Works™
[17:24:33] davidcelis: Catbuntu: link to whole project so i can clone it and try it myself
[17:24:55] Catbuntu: Perhaps because I did "rake db:migrate" instead of bundle exec ...
[17:25:25] elaptics: Catbuntu: no, you either have the table or you don't.
[17:25:38] Catbuntu: Let me push to gh
[17:25:58] davidcelis: Catbuntu: Rails creates a binstub for rake. you don't have to bundle exec it
[17:26:03] davidcelis: well rails 4 does, at least
[17:26:09] davidcelis: assuming your $PATH contains bin/
[17:26:19] Catbuntu: https://github.com/unrar/guestbook
[17:26:32] davidcelis: doesn't matter
[17:26:35] Catbuntu: Well I tried migrating again with bundle and won't work either
[17:26:38] davidcelis: `which rake`
[17:26:39] elaptics: Catbuntu: if you use gemsets too then it won't matter at all
[17:26:40] Jabberwock: Hi all. I haven't used Rails since version 2 and I have several plugins I'd like to migrate to 3/4. Could anyone recommend a good tutorial for this? The ones on the RoR site are pretty vague.
[17:26:48] Xeago: davidcelis: call me blind and stupid, but how would I make a route to a restful entity, of which only one can exist?
[17:26:56] Catbuntu: Well I already pusheed.
[17:27:11] Apane: anyone figure out how to get this workin' with rails 4? http://railscasts.com/episodes/364-active-record-reputation-system?view=comments
[17:27:19] davidcelis: Singular Routing
[17:27:24] davidcelis: Singular Resources*
[17:27:36] Xeago: okay, I am truly blind >.<
[17:27:53] Catbuntu: I can guess it's a stupid dumbass error though. haha
[17:28:19] Catbuntu: I'm very novice to Rails, in fact this is part of a tutorial of a nice book named Learn Rails 3 of O'Reilly. Perhaps because it's Rails *3*, but I tried to "update" everything to Rails 4.
[17:29:21] Catbuntu: Also: sqlite3 command exists
[17:29:51] davidcelis: Catbuntu: sate me
[17:29:52] Catbuntu: And I tried some things involving a database (scaffolded tho) before and they worked so I guess it's not a setup thing.
[17:29:55] davidcelis: Catbuntu: $ which rails
[17:29:58] davidcelis: err which rake
[17:30:24] Catbuntu: oh the backslash lol
[17:30:31] Catbuntu: . /home/lana/.rvm/gems/ruby-2.0.0-p247@global/bin/rake
[17:30:47] Catbuntu: have you tried it from GitHub?
[17:30:48] davidcelis: i'd recommend giving "bin/" a priority in your $PATH
[17:30:51] davidcelis: i'm bundling
[17:30:59] Catbuntu: But why? I can use rake.
[17:31:03] Catbuntu: And the migration gave no errors at all.
[17:31:27] Catbuntu: create table :entries, voilà
[17:31:51] davidcelis: Catbuntu: because the binstubs that Rails 4 creates are designed to avoid compatibility issues. it generates them for a reason. but i guess if you are sure you're not gonna have issues, then ignore them
[17:32:23] Catbuntu: I guess I won't.
[17:32:26] davidcelis: i ca't set any attributes on this
[17:32:30] davidcelis: Catbuntu: what did you do
[17:32:56] Catbuntu: I just changed the files commited with the message "Dammit" (see GitHub)
[17:33:01] davidcelis: broooooooooo
[17:33:04] davidcelis: remove that attr_accessor
[17:33:09] davidcelis: you are overriding rails column accessotrs
[17:33:10] Catbuntu: https://github.com/unrar/guestbook/commit/eadf3855fe621b9c53a603ce3c6728e3b727bc2b
[17:33:18] Catbuntu: lol I tried
[17:33:22] davidcelis: apparently not
[17:33:26] davidcelis: because when i remove it, it works fine
[17:33:46] Catbuntu: lol it works now
[17:33:53] Catbuntu: ACTION shots himself
[17:33:59] Catbuntu: and why is the id nil too?
[17:34:36] davidcelis: ID isn't created until the record persists
[17:34:47] davidcelis: it's a database level construct
[17:34:49] Catbuntu: Now how can I reset the database?
[17:34:52] Catbuntu: To remove all the nil names.
[17:34:55] davidcelis: rake db:reset
[17:35:19] Catbuntu: now migrate again?
[17:35:33] davidcelis: reset should re-migrate
[17:35:45] davidcelis: well, load from schema.rb at least
[17:35:49] davidcelis: which is technically better
[17:37:44] jstew: OT: Anyone else using weechat? I'm trying it out and it's annoying how it supports a subset of readline, but not the whole thing.
[17:38:41] Catbuntu: Dumb question, can you use else with unless?
[17:39:04] davidcelis: yes but don;t
[17:39:10] davidcelis: just swap the conditionals and use `if`
[17:39:18] davidcelis: you should pretty much never use `unless` with `else`
[17:39:28] jstew: https://github.com/styleguide/ruby
[17:39:31] mantas322: \n is not a linebreak
[17:40:00] davidcelis: mantas322: ... yes it is
[17:40:01] toretore: no, \n is not a linebreak
[17:40:08] davidcelis: oh wait, you mean in an HTML template
[17:40:09] toretore: only a linebreak is a linebreal
[17:40:15] Catbuntu: See! I remembered reading that you mustn't OR shouldn't use unless/else, and it's true, it's stupid
[17:40:18] davidcelis: mantas322: do you mean in a view?
[17:40:24] Catbuntu: I mostly use unless as a single line thing
[17:40:33] mantas322: myString = "This with line break \n"
[17:40:39] davidcelis: mantas322: \n is a newline, assuming you use a string delimiter that supports escaping
[17:40:49] slash_nick: Catbuntu: that's how it should be used, IMO
[17:40:53] Jabberwock: https://github.com/jabberwock/ciphermail
[17:40:55] davidcelis: mantas322: omg wtf is this camelCasing shit
[17:40:57] slash_nick: this unless that...
[17:41:02] Jabberwock: This isn't rails 3 friendly at all
[17:41:02] davidcelis: mantas322: this is RUBY, son! we snake_case
[17:41:11] terrellt: SCREAMING_SNAKE_CASE
[17:41:15] terrellt: ^ Best term ever.
[17:41:39] jstew: scream it, my brotha.
[17:41:40] davidcelis: mantas322: what makes you think you're not getting a newline, dude
[17:41:41] slash_nick: SCREAMINGCAMELCASE?
[17:41:43] davidcelis: mantas322: because... you are
[17:41:51] davidcelis: /nick SLASH_NICK
[17:42:01] jstew: '\n' is not a newline, but "\n" is. Note the double quotes.
[17:42:09] davidcelis: jstew: he's usin' double quoetz
[17:42:22] mantas322: okay okay, calm down everyone
[17:42:26] mantas322: heers' what happening
[17:42:36] davidcelis: mantas322: DON'T TELL ME WHAT TO DO
[17:42:38] jstew: davidcelis: Yes, it appears that way, but if he were, he would be getting a line break, no?
[17:42:46] helpa: WOAH MAN, STEP OFF! I'M CASE SENSITIVE!
[17:42:51] jstew: davidcelis: Have a nice day.
[17:42:53] mantas322: im appending text to a string along with \n. then im writing that textfile into a zipoutputstream
[17:43:06] mantas322: zio.write( myStringWithBreaks )
[17:43:16] mantas322: then when i look at the file , its all in one line
[17:43:18] davidcelis: mantas322: hm
[17:43:29] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[17:43:38] davidcelis: jstew: the sun has finally come out, so maybe i finally will
[17:43:45] davidcelis: slash_nick: i didn't know that one existed too
[17:44:03] mantas322: here's what i found
[17:44:15] davidcelis: are you not on UNIX?
[17:44:34] davidcelis: if you're not on *NIX, you're gonna have a bad time :(
[17:46:06] TheBlackMan: davidcelis: wats unix
[17:46:19] mantas322: but on a mac im betting some wierd ass tags
[17:46:34] mantas322: good thing these exported files need to be on windows
[17:46:44] davidcelis: yeah for windows you'll need carriage returns
[17:46:54] elaptics: mantas322: native mac line endings are \r
[17:47:03] elaptics: cross platform fun :)
[17:47:04] mantas322: test \r only
[17:48:10] davidcelis: elaptics: wait wut?
[17:48:31] mantas322: not enough for windows
[17:48:35] mantas322: im going to have to use \r\n
[17:48:52] jstew: \r was standard on mac before OS X.
[17:49:02] elaptics: davidcelis: ^ that
[17:49:07] jstew: Now, everything 9+ is \n
[17:51:37] mantas322: oh and take it easy with that windows hate
[17:51:42] mantas322: be accepting
[17:51:54] mantas322: dont scare off curious .net developers
[17:52:40] Catbuntu: the most pointless thing ever :(
[17:53:13] Catbuntu: why create a JVM-like virtual machine that only runs on Windows? Mono isn't enough sometimes.
[17:54:03] mantas322: why NOT create something that only runs on windows
[17:54:38] elaptics: because I use a mac? ;)
[17:55:16] davidcelis: mantas322: honestly tho, ruby just isn't that windows friendly. windows devs will have a better time working on a VM running linux
[17:55:25] slash_nick: davidcelis: can't claim ownership of that one (!DavidCelis)
[17:55:51] mantas322: I write ruby just fine using Aptana 3 for windows
[17:55:55] mantas322: JUST FINE >:O
[18:01:20] Jabberwock: bah. Why is every major version of rails a complete rewrite?
[18:01:39] Jabberwock: I was practically an expert before 3 came out. Now I'm struggling to convert some plugins over to version 3.
[18:01:50] slash_nick: Gotta stay current!
[18:02:29] Jabberwock: I would if we used it at work :/
[18:03:04] slash_nick: ah... Jabberwock just find a decent blog and bookmark it. afreshcup.com
[18:03:50] slash_nick: Jabberwock: afreshcup.com is largely rails related, but not entirely... you'll still get some design stuffs out of it
[18:03:58] Jabberwock: Plugin writing is so different it's crazy.
[18:04:08] slash_nick: Holy crap rubyonrails is in #rubyonrails...
[18:04:46] slash_nick: Jabberwock: it's super simple... try "bundle gem foobar"... unless you mean a rails plugin
[18:05:14] Jabberwock: https://github.com/jabberwock/ciphermail
[18:06:03] slash_nick: revive it! :)
[18:06:04] Jabberwock: It will be neater when it works in rails 3+
[18:06:27] Jabberwock: Just being impatient
[18:07:03] Jabberwock: I don't think this has to be a gem
[18:07:11] Jabberwock: At least… that seems overkill.
[18:09:17] cpruitt: This is a little nit-picky but does anyone have any thoughts on the best way to change the order of the HTML attributes output by link_to? I have a customer that specifically wants <a title="" alt="" href=""> citing that Google ignores all attributed values after the href when crawling the link.
[18:09:41] cpruitt: link_to outputs href first so title / alt would be ignored
[18:09:56] momomomomo: that's awesome
[18:10:41] slash_nick: that doesn't sound nitpicky
[18:10:50] Jabberwock: Google is always changing what they do, too.
[18:10:59] terrellt: I'd like to see that citation.
[18:11:02] terrellt: I haven't heard that before.
[18:11:24] cpruitt: Yeah, I feel like these days I am more frustrated trying to keep up with google's nonsense than I was with IE 6.
[18:12:04] slash_nick: cpruitt: where's the text that says that'll happen?
[18:12:06] toretore: if people weren't trying to "keep up", google wouldn't have to be doing this nonsense
[18:12:34] clusterfoo: I have a file app/helpers/layout.rb, with a module Layout inside it, which I call from my layouts (MyApp::Layout.do_something()). It works fine in the browser, but when I run rspec spec, I get "uninitialized constant MyApp::Template"... what's happening?
[18:12:40] cpruitt: slash_nick: I don't have the reference myself. It's a customer request so it's kinda secondhand.
[18:12:55] cpruitt: toretore: My thoughts exactly.
[18:13:01] Jabberwock: clusterfoo: I'm guessing it's not being required.
[18:13:18] toretore: cpruitt: there's only one thing worth knowing about google seo: everything they do is to reward real, informative pages that aren't trying to fool it
[18:13:26] clusterfoo: jabberwock: I have to do a separate require for rspec?
[18:13:29] toretore: i.e. by changing the order of the attributes
[18:13:47] Jabberwock: toretore: Contrarily they are also docking page rank points from sites that are "too" SEO friendly
[18:13:53] toretore: everything else is complete and utter bullshit
[18:14:26] cpruitt: toretore: Oh I agree, but again, I'd like to avoid telling my customer "sorry, that's just a stupid request". ;-)
[18:14:33] toretore: if you think you need to change anything to be more seo friendly, it's because your content sucks
[18:15:01] toretore: cpruitt: and that's how this bullshit is allowed to continue
[18:15:10] Encosi: I am trying to figure out how to use Twitter bootstrap with my rails 4.0 app. Can I follow the same steps as 3.2 that is on the main page or do I need to do something different?
[18:15:28] jstew: cpruitt: It pays off in the long run. Telling them the truth is the best option.
[18:15:48] jstew: cpruitt: Otherwise, they'll just keep asking for unreasonable things, and you'll keep doing them.
[18:15:50] Jabberwock: You're worried about SEO. I'm more concerned that Google can monitor phone calls, voice mails, texts, TV, and life experience for those who will use the Eye
[18:15:52] toretore: nobody likes fucking yes men
[18:16:13] Jabberwock: That didn't make sense lol.
[18:16:42] jstew: Jabberwock: You don't use google glass while you're fucking your wife, do you? :)
[18:16:59] toretore: i'm using glass right now and i'm naked
[18:17:01] terrellt: Gotta keep track of your stats.
[18:17:04] toretore: you're welcome to watch
[18:17:04] Jabberwock: I wouldn't use the google glass for anything :P
[18:17:32] toretore: fucking seo got me all riled up and sweaty too now
[18:17:47] Jabberwock: SEO or Google?
[18:17:56] toretore: froth running down mt beard
[18:18:18] toretore: had to take off my fedora because it's too sweaty
[18:18:29] Jabberwock: That must be some beard.
[18:18:35] toretore: my beard is a mount
[18:18:42] toretore: muhammad comes to it
[18:19:01] jstew: I have a client that used a crappy SEO service (black hat) that crawled their site with a broken crawler and killed the server (staging server, no caching). Of course, I get the blame.
[18:19:14] Jabberwock: ACTION gets his snowboard
[18:20:44] cpruitt: toretore: I agree with you on the surface but I think it's a matter of perspective. I see it as utter nonsense because the problem I'm trying to solve is based on the usage of the site. From someone else's perspective the problem is how to help that site cut through the noise, even if it has a lower budget and fewer resources for content. I take the position that SEO is a PITA and a waste of time, but when you have a customer that says "I don't care
[18:20:44] cpruitt: what you think, I need this to happen so I can try it, even if it doesn't make a difference" it's still my job to find a way to give them the tool they're asking for.
[18:20:50] toretore: (no innuendo intended, lest i be exploded by a true believer)
[18:21:35] toretore: then it's your job to make them understand or fire them
[18:21:45] toretore: and be unemployed
[18:21:46] Jabberwock: We have entire teams for SEO.
[18:21:57] Jabberwock: Which is kind of funny because we're Disney. We don't need it like smaller companies.
[18:21:58] Jabberwock: (speaking on my own behalf)
[18:22:39] jstew: That seems odd. I would imagine that Disney has the highest authority of "disney stuff" in googles eyes.
[18:22:44] freedrull: exists? returns 1 and nil instead of true and false. i guess those are 'truthy' enough values
[18:23:00] Jabberwock: Not to mention we work closely with Google.
[18:23:35] jstew: I have to say that I'm envious though... Disney seems like it would be great to work for.
[18:23:37] Jabberwock: Funny story: I got to meet the guys that started Google maps a couple years ago. Their first day here, their equipment trailer was struck by a Disney vehicle lol
[18:24:07] jstew: Did someone come out of a tunnel and pull the vehicle underground before anyone saw it?
[18:24:32] Jabberwock: No. They just vanished and reappeared back at our offices. Google has some high tech stuff.
[18:25:07] cpruitt: OK so I guess my options are to either re-implement link_to or wrap it and do some kind of regexp find / replace nonsense….
[18:25:47] Jabberwock: Luckily that'll be easy. I don't foresee you needing regex to create an anchor tag and an array of attributes/values
[18:25:48] chase-work: silly question - i'm trying to set up an initializer for a gem (logstasher), but when I access the gem from it (LogStasher.enabled), I get uniniitialized constant LogStasher (NameError)
[18:27:00] cpruitt: Lets say I was just going to re-implement it. Would it be better to override the existing implementation or should I just reproduce it with a different helper name?
[18:27:23] Jabberwock: I would give it its own name.
[18:27:26] Jabberwock: That's up to you though.
[18:27:36] Xeago: I have a resource controller, it generates these routes http://bpaste.net/show/fG1aQlE1qworrrhHOHVW/
[18:27:39] cpruitt: & just toss it in my helpers with everything else?
[18:27:40] terrellt: chase-work: Are you testing this with a rails server? If so, I'd guess you bundled without restarting the server.
[18:27:44] Xeago: why is there no show_path?
[18:28:21] chase-work: terrellt yes its running with the rails server. the server has been running fine. I get that error when *starting* the server
[18:28:35] Xeago: (asin why can't I redirect_to :show)
[18:28:46] chase-work: terrellt the gem has been working fine, up until I tried creating an initializer file
[18:28:49] helpa: Xeago: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[18:28:49] momomomomo: Xeago: !code
[18:28:52] terrellt: cpruitt: You could just write the HTML.
[18:28:58] momomomomo: Xeago: paste your routes.rb
[18:29:04] cpruitt: I should just be able to start with this & massage it as needed yes? https://github.com/rails/rails/blob/797fcdf738a2a2772544731027d4fc5ca9d358bc/actionpack/lib/action_view/helpers/url_helper.rb#L174
[18:29:39] momomomomo: cpruitt: right, just make it a helper method
[18:29:39] Jabberwock: cpruitt: Depending on your needs. Do you often use blocks with link_to?
[18:29:42] chase-work: terrellt i'm on the wrong branch
[18:29:44] Xeago: momomomomo: I gave all the information needed: resource :billing
[18:29:45] cpruitt: terrellt: Yeah I could, but I'm doing some stuff with generating the URLs and it's a tiny bit cleaner to do it this way.
[18:29:51] helpa: Xeago: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[18:29:51] momomomomo: Xeago: !code
[18:30:10] Xeago: momomomomo: I gave you all the information necessary, and now I even gave you the 1 line of code you want
[18:30:22] Xeago: can you please read what I say?
[18:30:34] momomomomo: Paste your entire routes.rb to a file
[18:30:39] cpruitt: Jabberwock: No, HTML is where I'd go if this turns out to be a pain. It's just not as tidy.
[18:30:46] momomomomo: and you're welcome for offering to help
[18:30:58] Xeago: Revibe::Application.routes.draw do; resource :billing; end;
[18:31:00] Xeago: there you go
[18:31:15] Jabberwock: I envision just accepting an array of key/value pairs and outputting them in order
[18:31:36] momomomomo: try resources :billing
[18:31:41] Jabberwock: in the order supplied
[18:31:45] Xeago: momomomomo: no, it is a singular resource
[18:32:28] Xeago: how do I link to the object it represents?
[18:32:33] Xeago: or well, redirect
[18:32:43] momomomomo: you realize that your routes are consistent with a singular resource, right?
[18:32:57] Xeago: yes, hence my question is not about routing
[18:33:07] momomomomo: then you should link_to billing_path
[18:33:40] momomomomo: Xeago: http://guides.rubyonrails.org/routing.html#singular-resources
[18:34:02] terrellt: cpruitt: You could do content_tag?
[18:34:31] Xeago: this is not in a view, it is in a controller, redirecting to billing_path is supposedly for POSTS
[18:35:20] Xeago: as you see there is a GET for /subscription/billing/, but it is unnamed
[18:35:26] Xeago: how do I redirect to that unnamed route?
[18:35:50] Jabberwock: specify the controller and action?
[18:36:01] Jabberwock: Or make it a named route.
[18:36:16] Xeago: how would I make it a named route, it is currently defined with resource :controller
[18:36:39] momomomomo: Don't know Xeago we haven't seen your routes.rb; how can we see how it's defined?
[18:36:50] Xeago: because I just told you how it is defined?
[18:37:10] Jabberwock: SNARKINESS MAKES ME LOOK AWAY!
[18:37:13] momomomomo: Xeago: Best of luck, I'm out of patience with you
[18:37:28] cpruitt: terrellt: Yeah, I will to create the tag. Trying to think of how to explain this without complicating it… I have a PagesController that accepts an :id param. :id gets translated to the name of a partial. If the file exists it's content gets used. I have a link_to_page helper that does some fiddly stuff and then uses link_to to create the html. So, link_to_page follows the same API as link_to with the exception that the url is a symbol that is
[18:37:28] cpruitt: looked up somewhere instead of a url.
[18:38:20] cpruitt: So in fixing link_to, I'd LIKE to keep the same overall API so I don't have to worry about whether something lines up with the docs, etc… and some of the layout guys that aren't too comfortable with ruby / rails can trust that it's consistent.
[18:38:52] cpruitt: Plus, now I just want to learn how to do it. :)
[18:40:37] Jabberwock: I'd be curious as to why link_to is putting href first.
[18:40:37] Jabberwock: Is that the case 100% of the time?
[18:42:27] Jabberwock: http://edgeapi.rubyonrails.org/classes/Rails/Railtie.html is way more helpful for the plugin I want to convert.
[18:42:57] cpruitt: Jabberwock: I don't know. Looking at the source, it looks passes in a hash of all attributes (href included) to content_tag. From what I know hashes aren't guaranteed to be in any specific order so it could just be random.
[18:43:04] rhizome: brain fart: how do i generate rdoc for rails stuff? desired behavior: "rdoc link_to"
[18:43:17] Jabberwock: cpruitt: Right. That's why I was curious
[18:43:42] tubbo: cpruitt: i'm pretty sure link_to title, url, options_in_any_order is the correct API...
[18:43:56] apeiros: Xeago: the output of routes is a bit misleading
[18:44:21] apeiros: it is billing for all four, GET, POST, PUT and DELETE
[18:44:24] tubbo: cpruitt: you seem to be making this a bit harder than it has to be
[18:44:52] apeiros: i.e., the url is the same for all 4 and rails distinguishes the action via the used HTTP verb
[18:45:02] tubbo: cpruitt: for example, if you have each page routed to 'GET /pages/1', you can just do `link_to page.name, pages_path(page)` and boom there's your page link.
[18:45:39] Jabberwock: cpruitt: http://apidock.com/rails/ActiveSupport/OrderedHash
[18:45:45] tubbo: if you *really* want more sugar you can just `define_method(:link_to_page, page) { |page| link_to page.name, pages_path(page.id) }` :)
[18:45:54] cpruitt: tubbo: Yes, that's the correct API for the helper. I'm referring to output order of the attributes that's the issue. href="" title='' vs. title="" href=""
[18:46:08] tubbo: cpruitt: why does that matter to you?
[18:46:12] apeiros: what I'm not sure is why you say there was no `redirect_to :show`, you should be able to redirect to show (I usually use `redirect_to billing_url`)
[18:46:19] Jabberwock: Assuming you're using ruby > 1.8.x. Here are some other snippets: http://stackoverflow.com/questions/7040617/ruby-maintain-hash-insertion-order
[18:46:28] Jabberwock: apeiros: ltns
[18:46:31] tubbo: apeiros: you need to put a path in there, you can't just redirect to a symbol :)
[18:46:38] apeiros: Jabberwock: what?
[18:46:52] cpruitt: To me, it doesn't. To the SEO guy asking for the feature, it matters because supposedly google ignores all attributes after the href
[18:46:54] Jabberwock: Long time no see.
[18:46:54] Jabberwock: Obviously :D
[18:46:58] apeiros: Jabberwock: ah :)
[18:47:07] apeiros: Jabberwock: I'm here all the time. lurking in the shadows ;-)
[18:47:21] platzhirsch1: CoffeeScript files are compiled into one JavaScript that's fine, but how can I check whether this or that code should be executed? Is this done by checking the current page or similar?
[18:47:28] apeiros: tubbo: ok. that'd explain that last bit. didn't know since I use redirect_to *_url anyway :)
[18:47:32] Jabberwock: apeiros: I haven't used Rails since 2.x… so I have some studying to do.
[18:47:38] Jabberwock: Converting my old plugins
[18:47:39] tubbo: cpruitt: that *probably* is a bunch of bullshit.
[18:47:50] Xeago: apeiros: redirect_to :show gives me an error, no show_path/show_url (don't remember) exists
[18:47:51] apeiros: technically you should use _url and _path anyway as _path is actually illegal (but about every browser nowadays accepts it)
[18:48:02] cpruitt: tubbo: Isn't 50% of the sep industry?
[18:48:04] tubbo: but i can't really disprove right now
[18:48:12] apeiros: Xeago: what happens when you do `redirect_to billing_url` instead of `redirect_to :show`?
[18:48:13] Jabberwock: Xeago: Rather than pasting the output of rake routes, can you paste the code that is creating them?
[18:48:22] tubbo: cpruitt: hah, i guess so. :) good SEO folks use data and measurements to make their claims.
[18:48:32] Xeago: Jabberwock: I did that earlier as well, resource :billing
[18:48:38] tubbo: cpruitt: i think 50% is an optimistic estimate :)
[18:49:03] tubbo: in my lifetime it's been more like 1 in 4 :P
[18:49:11] Xeago: apeiros: so it is just the output of rake routes that is lazy as
[18:49:33] apeiros: Xeago: yeah. IMO it could be done better.
[18:49:39] Jabberwock: Xeago: I was asking if you could. Not if you did. I=
[18:49:39] Jabberwock: sans that crap at the end.
[18:50:00] cpruitt: tubbo: The problem is that for a lot of people with limited resources, they have to operate on self education and testing / trial and error. So when they read something that they consider to be reliable, their next step is "hey web guy… give me feature X". So it is what it is. Every once in a while it pays off I guess.
[18:50:12] Xeago: Jabberwock: well I have already shown my capability of doing so earlier, hence why I referred back in time :)
[18:50:52] platzhirsch1: How do I control which JavaScript gets executed when using asset pipelining?
[18:51:50] Galgorth: I notice railsinstaller hasn't been updated for Rails 4.0 and Ruby 2.0 and I presume a lot of other components.. is there an easy way to install Rails 4.0 with all the rubyinstaller extras or do I need to manually acquire each of the programs?
[18:53:33] workmaster2n: Is there a way to check if a Time (not DateTime) is in the past? Rails seems to be converting a Time object to a pseudo DateTime with the date component set to 1-1-2000. If I have a time of 10:00:00 saved in the Time column, I'd like to know if that is in the past (for today)
[18:54:37] DaniG2k: guys can someone plz help me figure out what kind of model structure i need for my project, or at least direct me to a tutorial that shows how i can do it (description coming...):
[18:55:02] DaniG2k: I want to setup a tutoring website where signed up users (user model) can be either tutors or students.
[18:55:10] DaniG2k: One tutor can have many students
[18:55:19] DaniG2k: and student can have many tutors
[18:55:24] tubbo: cpruitt: well it's a matter of cost/benefit balance
[18:55:40] cpruitt: tubbo: As perceived by the customer, yes.
[18:55:48] tubbo: a company can only "try out" as many ideas as they have money for. eventually, you have to justify why you're paying the programmer $40k or more
[18:56:03] tubbo: no, as perceived by your business
[18:56:38] workmaster2n: DAniG2k: r u using a sql type database?
[18:56:46] DaniG2k: also, users have to be able to add students and students need to know theyve been added, so its needs to be bidirectional
[18:56:55] cpruitt: Well, that's the thing right? My hourly rate doesn't change. If they want to spend billable time on that I'll share my thoughts, but I'm not going to tell a client "no way" if they're willing to pay for the time.
[18:57:27] DaniG2k: workmaster2n: well i havent really started yet im just trying to figure out how to go about this...do i need three tables? or a user table with a tutor boolean and student boolean...I'm rather confused
[18:57:33] eladmeidar: toretore: ping
[18:57:35] cpruitt: I'm not willing to "milk" a client, but at the end of the day, if it's not my product, I don't call the shots
[18:58:06] momomomomo: DaniG2k: Have you read through http://guides.rubyonrails.org/association_basics.html
[18:58:16] DaniG2k: momomomomo: yes
[18:58:27] workmaster2n: DaniG2k: are you familiar with has_many, through: relationships?
[18:58:40] eladmeidar: helpa, behave
[18:58:43] DaniG2k: momomomomo: and it confused me even more -_-
[18:59:01] DaniG2k: momomomomo: has_and_belongs_to_many vs has_mant :though
[18:59:12] momomomomo: DaniG2k: You must understand what type of relationship you want before you try to build it
[18:59:27] momomomomo: DaniG2k: What part, specifically, confused you about http://guides.rubyonrails.org/association_basics.html#the-has-many-through-association
[18:59:58] DaniG2k: momomomomo: tahts why im asking here
[19:00:13] DaniG2k: momomomomo: i have to go out now but i'll be back later...thanks tho
[19:00:40] Encosi: I am trying to figure out how to use Twitter bootstrap with my rails 4.0 app. Can I follow the same steps as 3.2 that is on the main page or do I need to do something different?
[19:03:10] iamjarvo: if there is not a manifest file for rails to map the asset file to the fingerprint what does rails do
[19:03:24] helpa: Why don't you try it and find out for yourself?
[19:03:58] iamjarvo: i am trying :)
[19:04:05] rsl: eladmeidar: why don't YOU try ;) [hello]
[19:04:38] eladmeidar: rsl: i did. it hurt :)
[19:04:48] rsl: not much
[19:04:57] rsl: working on rails upgrade again
[19:05:07] Ace20: if you have two different ways to show a resource (based on which url was used), should both go to the same "show" action?
[19:05:45] eladmeidar: rsl: i am still running around the 3dcart api thing
[19:06:12] rsl: Ace20: depends. is the controller method basically the same but renders different template?
[19:06:48] Ace20: rsl: yeah, although there are a few pieces of the view itself that change, like missing sections
[19:07:18] rsl: Ace20: i'd probably use the same method [show] and conditionally render then.
[19:07:20] Ace20: rsl: basically if you're on the internal page you get additional buttons to edit pages, but it's readonly from outside
[19:07:33] iamjarvo: so i have asset_host set and when i run rails in the environment localy passing the -e option it prints out file-name-fingerprint.css. from my the guides it seems that rails uses the manifest file generate the output of the stylesheettag
[19:07:37] Ace20: and maybe slightly different css as well
[19:08:01] iamjarvo: if an assets_host is set does it go to that host and find a manifest file
[19:08:08] rsl: yeah i'd still probably go the single method route
[19:08:39] eladmeidar: i'm off. bbl
[19:08:59] Ace20: rsl: cool stuff
[19:09:19] rsl: later eladmeidar
[19:20:00] mantas322: damn text mate
[19:20:07] mantas322: always closing things for me
[19:20:13] lethjakman: mantas322: this is why you should use vim.
[19:21:07] kaspergrubbe: lethjakman: you must be joking, use Sublime
[19:21:17] kaspergrubbe: (let the flamewar begin ;))
[19:21:59] jstew: But seriously though, nearly everyone using textmate has moved to sublime.
[19:22:17] lethjakman: kaspergrubbe: psh, sublimes a vim wana be! ;)
[19:22:21] Jabberwock: I switch between TextMate and vim
[19:22:26] lethjakman: jstew: I would agree with you
[19:22:29] jstew: Jabberwock: What's keeping you on TM?
[19:22:33] lethjakman: I used sublime for a while and it was honestly pretty nice.
[19:22:42] Jabberwock: jstew: Nothing in particular.
[19:22:53] Jabberwock: Sublime seemed a little too complicated to configure
[19:23:02] mantas322: stop fighting.
[19:23:10] lethjakman: Jabberwock: it's not, you get a package manager and everything is good.
[19:23:18] jstew: I'm a longtime emacs user. Tried to switch to vim (for a year) but it stresses me out. Not my style.
[19:23:22] lethjakman: mantas322: see what you caused!
[19:23:35] jstew: Let's all blame mantas322....
[19:23:39] mantas322: You're all lame for using macs and hating on windows!
[19:23:43] lethjakman: jstew: it's totally a style thing. emacs is good too, I just hate the meta keys.
[19:23:54] Jabberwock: jstew: I had a colleague that had IRC, email, code editing etc. all set up inside emacs
[19:23:55] lethjakman: mantas322: and what about us freebsd users over here huh?!?
[19:24:05] mantas322: You're cool.
[19:24:06] Jabberwock: It was pretty intimidating
[19:24:16] wmoxam: C64 4ever
[19:24:19] jstew: Jabberwock: I used to do that, but I like to live outside of emacs once and a while.
[19:24:35] lethjakman: Jabberwock: that's interesting...I use all of those on the command line, there's no reason to have gui's now adays
[19:25:03] jstew: lethjakman: Yeah, I remapped my control key to capslock and I am all happy now.
[19:25:07] lethjakman: weechat, mutt, and vim. what else do you need?
[19:25:07] Jabberwock: If I'm working on a Zend Framework project I'll use Eclipse (booo). For rails, since I'm usually on the command line… I use vim
[19:25:23] lethjakman: jstew: do you have a happy hacker keyboard?
[19:25:29] lethjakman: or a kinesis (s?)
[19:25:47] lethjakman: Jabberwock: ugh. zend.
[19:25:52] jstew: lethjakman: Nope. Just a plain old aluminum mac kb. It sucks though, I want a WASD keyboard.
[19:26:03] Jabberwock: lethjakman: agreed
[19:26:21] wmoxam: Apple makes the worst keyboards + mice :(
[19:26:38] lethjakman: Jabberwock: every time I get to work on a rails project I get all happy. I'm all "this is what it's like to enjoy coding?!"
[19:26:40] wmoxam: they look pretty I guess
[19:26:41] lethjakman: then I go back to zend.
[19:26:41] joelteon: i love the apple keyboards tbf
[19:26:42] jstew: wmoxam: My fingers get sore on this thing. You have to press the keys really hard.
[19:26:51] lethjakman: wmoxam: wtf is with their mice? why are they so sharp and uncomfortable?
[19:26:55] joelteon: there's almost no key travel
[19:26:57] wmoxam: jstew: yup
[19:27:06] wmoxam: I used one of them for way too long
[19:27:18] jstew: Not to mention I go through one every year, minumum.
[19:27:18] wmoxam: lethjakman: remember the puck mouse?
[19:27:59] lethjakman: yes. why did they do that?!
[19:28:06] JUSTINSTONE: It just works
[19:28:08] wmoxam: jstew: I'm using a 20+ year old keyboard :p
[19:28:14] joelteon: i want a das keyboard
[19:28:27] Tricon: I love the aluminum Apple keyboards, however, I just got my Das Keyboard Ultimate in today.
[19:28:39] joelteon: The problem is they don't make the Mac model with silent switches :(
[19:28:41] jstew: wmoxam: Which one? Model M?
[19:28:49] wmoxam: jstew: Apple Extended II
[19:28:57] dobry-den: one thing i grapple with on emacs is all the popup buffers replacing my existing buffers. and the only fix i found so far is package 'popwin' which pretty much turns them off. not sure what the middleground is
[19:29:06] wmoxam: joelteon: checkout Matias
[19:29:08] dobry-den: i'd like all popup buffers to be a window i can just q
[19:29:08] jstew: joelteon: That's why I want the WASD. You can get it in brown switches instead of the clicky blues.
[19:29:11] lethjakman: I would really say the rails community uses the most interesting technology. everyone here is all over the place
[19:29:18] lethjakman: wmoxam: I want one of those, I love mechanical keyboard.s
[19:29:26] lethjakman: jstew: I have a leopold, it's nice
[19:29:29] Tricon: FYI, if you go this route and have a Mac, I can't recommend this utility enough: https://pqrs.org/macosx/keyremap4macbook/
[19:29:34] lethjakman: plus it's funny because it doesn't have any letters and it confuses people
[19:29:45] jstew: wmoxam man, I bet that kb is built like a tank
[19:29:56] Encosi: I have a Das keyboard as well. Its awesome. And the company is from Austin!
[19:30:25] joelteon: Oh hey, they have a quiet Ultimate
[19:30:28] joelteon: that's the one I'm buying
[19:30:38] lethjakman: I want n IBM model m so bad.
[19:30:39] wmoxam: jstew: yeah, it's similar to the Model M, a little bit lighter maybe
[19:30:44] lethjakman: I think that'd be great for the office.
[19:30:53] dobry-den: Tricon: yeah, capslock as ESC and Ctrl is probably the biggest productivity boost i've had in years
[19:30:54] Tricon: joelteon: You can use the utility I linked to remap the keys. Used it to get my media keys back.
[19:30:55] wmoxam: jstew: some keys are feeling a bit worn though, so I ordered a Matias which is also an ALPS keyswitch keyboard
[19:30:56] dobry-den: since maybe vim
[19:31:07] joelteon: Tricon: Already have it C:
[19:31:19] jstew: lethjakman: The leopold looks really nice. I like the form factor. It doesn't look like a huge hunk of plastic like a lot of the others do
[19:31:25] Tricon: joelteon: Awesome. Love it so much.
[19:31:40] lethjakman: jstew: yeah, it came in a small version without a keypad too which is what sold me
[19:31:43] Tricon: One thing that's bringing back memories is how the plastic sometimes squeaks.
[19:31:46] lethjakman: more reliable than the other one I have
[19:33:51] Tricon: lethjakman: Do you know how the Leopold comares to the Das? I'd love to not have a keypad.
[19:33:52] jstew: Mechanical keyboards must be trendy. Suddenly all sources seem to be out of stock.
[19:34:20] Xeago: does a .present? on a has_one relationship require an additional database query?
[19:34:36] lethjakman: Tricon: they're both of similar quality, however I'd say the leopold is probably better because the keys don't get shiny as fast.
[19:34:57] lethjakman: Tricon: this is where I got mine: http://elitekeyboards.com/
[19:35:06] jstew: http://elitekeyboards.com/products.php?sub=leopold,tenkeyless&pid=fc200rtab
[19:35:11] lethjakman: I really want a realforce..
[19:35:12] Tricon: lethjakman: I may pick that up to try it out. Can always send the Das back or keep it for another workstation.
[19:35:13] jstew: That's what I am looking at right now.
[19:35:59] fryguy: i like my leopold
[19:36:08] fryguy: i have an extra one with brown switches laying next to me
[19:36:26] Galgorth: when i gem install rails the installation gets stuck at 'Installing ri documentation for rails-4.0.0'
[19:36:31] lethjakman: jstew: I have that and recommend it
[19:36:33] Tricon: Or maybe I should just start macro-ing the hell out of the keypad.
[19:36:35] lethjakman: just otaku version instead :)
[19:36:37] Galgorth: how do I fix this?
[19:36:39] jstew: fryguy: How loud are the browns? My boss doesn't want to buy me one with blues because they're WAY too loud.
[19:36:51] fryguy: jstew: i'm using blues right now and people around me hate me
[19:36:54] lethjakman: Galgorth: that can take a while
[19:36:56] fryguy: tbh the browns aren't much better
[19:37:07] Tricon: When I told a friend that I want to get _another_ keyboard, "hah. Interesting. I say just mod a power glove and use that."
[19:37:22] jstew: That sucks. My boss has a das kb with blues, and after using it for a while, they're banned from the office.
[19:37:23] Galgorth: lethjakman: Ok, will wait for a bit and see if it installs
[19:37:42] Tricon: jstew: I just keep my door closed.
[19:38:00] jstew: I would if I had a door. It's all open here. Pair programming and all..
[19:38:35] lethjakman: fryguy: they're a bit quite
[19:38:40] Jabberwock: http://img.thedailywtf.com/images/12/q3/pear_programming_250.png
[19:40:04] jstew: Maybe I'll give the red switches a try. They might pass office etiquette.
[19:40:36] Tricon: It's SFW.
[19:40:44] Tricon: Jabberwock: I was going to do a parody like that.
[19:40:55] lethjakman: jstew: you could always try a realforce, I think they're supposed tobe pretty quiet
[19:41:12] Jabberwock: Tricon: You still can :D
[19:42:15] Galgorth: ri documentation installed, thanks!
[19:42:20] NTrope: Could somebody help me? I am trying to work through the ROR Tut by Micheal Hartl. When I first get to run 'rails server' I get a 'cannot load such file -- sqlite3/sqlite3_native. Have tried many Stack Overflow solutions without success
[19:43:03] TheBlackMan: NTrope: install sqlite3
[19:43:14] TheBlackMan: install sqlite gem
[19:43:22] TheBlackMan: ensure you have devkit installed
[19:43:33] lethjakman: NTrope: also I'd recommeng going through the guides on rubyonrails.org instead.
[19:43:41] Jork1: I have a many to many association with has_and_belongs_to_many, I followed the Guides on rubyonrails.org but seems like I can not set the relationship in the console
[19:43:43] lethjakman: NTrope: I tried other peoples tutorials and they cost me a lot of time and effort
[19:43:50] NTrope: ...rails 4, ruby 2, win7 64, all 32 software. I have all of those things =/
[19:43:58] NTrope: Allright, I will check that out
[19:44:09] NTrope: Hopefully more troubleshooting info
[19:44:41] NTrope: Even have dll and exe in my C:/ruby200/bin
[19:45:13] jstew: Developing on windows seems to be a tough way to go. Maybe I'll try it on my wife's notebook later just to see how bad it is.
[19:45:36] TheBlackMan: jstew: the installation process on all platforms
[19:45:48] TheBlackMan: mac osx/unix you'll want rvm
[19:47:18] joelteon: no, use rbenv
[19:47:20] jstew: TheBlackMan: Yeah, sometimes it a
[19:47:35] TheBlackMan: joelteon: fuck rbenv
[19:47:40] jstew: TheBlackMan: Sometimes it's a pain.... Then I remember Java.
[19:47:44] joelteon: it's less of a pain in the ass than rvm
[19:47:51] TheBlackMan: Rvm just works
[19:47:55] TheBlackMan: why fix what isn't broken
[19:48:01] joelteon: so does rbenv
[19:48:08] jstew: rbenv is simpler and just works for me.
[19:48:32] TheBlackMan: Does it really matter if it is simpler? RVM has had more engineering done on it
[19:48:39] TheBlackMan: to cover the edge casts
[19:48:52] jstew: TheBlackMan: simplicity matters. Less technical debt.
[19:49:08] lupine: problem is, rvm is actually broken
[19:49:17] TheBlackMan: If simplicity matter, rubinius would be deemed the main ruby instead of MRI. MRI's c code base is junk
[19:49:17] lupine: you might as well say that portage is fine
[19:49:22] jstew: Which edge cases do you need covered, that rbenv doesn't cover?
[19:49:40] TheBlackMan: TheBlackMan is done his rant.
[19:49:48] lupine: that said, I use rvm. I installed it when it was the number 1 choice, and haven't gotten around to changing it yet
[19:49:55] TheBlackMan: I just like RVM and don't see a reason to try the alternatives.
[19:50:34] lupine: there's apparently also "rv" now
[19:50:51] lupine: just heard about it this week, haven't tried it yet
[19:50:55] fryguy: if you already have rvm installed and working, there is no need to change, if you have a need to install a new setup (new machine, bored, whatever), you should give serious consideration to the new contenders (rbenv and chruby)
[19:51:28] TheBlackMan: Fair enough fryguy
[19:52:05] jstew: I haven't tried chruby yet. It seems even smaller than rbenv.
[19:52:31] lupine: they do have the pleasing advantage of being just about usable for production
[19:52:37] lupine: (but only just)
[19:52:44] fryguy: i'm of the opinion that chruby is the right way to go for automated systems (production for example), and rbenv is the way to go for dev machines. maybe.
[19:53:03] TheBlackMan: jstew: No loyalty to your software these days, you going to move to chruby now, jstew ? :)
[19:53:11] lupine: that's one area where rvm-using me and chruby-using purist workmate agree completely
[19:53:51] Tricon: I haven't had any issues with rbenv. No motivation to switch.
[19:53:57] Tricon: fryguy: That could make sense.
[19:54:28] hakunin: What's low-impact (effort-wise) way to store things in postgres or redis asynchronously?
[19:54:59] hakunin: send off and forget type of thing
[19:55:27] fryguy: hakunin: delayedjob, resque, sidekiq, etc.
[19:55:55] hakunin: fryguy: i think redis client that does the enqueueing is synchronous without em-synchrony plugged in as dependency
[19:55:57] fryguy: might be what you are looking for
[19:56:58] jstew: TheBlackMan: Perhaps. It depends on how hot chruby is.
[19:58:09] hakunin: i might preferably postgres, but i can see how that might be more hassle
[19:58:17] hakunin: s/i might/i mean/
[19:59:11] Tricon: jstew: At a glance, I thought you said, "It depends on how hot your chubby is." ಠ_ಠ
[20:00:17] scrogson: Anyone know of the top of their heads why a link_to specifying format: 'xls' is linking to action?format=xls instead of action.xls? This is in Rails 2.3. I'm only experienced in Rails 3+
[20:01:39] DylanJ: scrogson: try link_to "text", url, {}, :format => 'xls'
[20:03:05] scrogson: yeah, that doesn't work
[20:03:08] DylanJ: link_to "text", your_path(format 'xls'), {}
[20:03:18] DylanJ: proper syntax of course
[20:03:33] scrogson: does it only work with named routes?
[20:04:07] scrogson: I'm using link_to "text", {controller: 'controller', action: 'action', format: 'xls'}
[20:04:20] DylanJ: i think it's only an option for url_helper methods
[20:04:38] DylanJ: give the route a name and try it
[20:04:38] scrogson: ok thanks, that's probably it
[20:04:48] ARMIGER1: How do I call view helpers from the console in rails 4? helper.link_to says that it's an undefined local variable.
[20:05:00] Fire-Dragon-DoL: scrogson: you can also do controller_action(format: :xls)
[20:05:15] Fire-Dragon-DoL: controller_action_url(format: :xls)
[20:05:38] Fire-Dragon-DoL: ARMIGER1: just link_to
[20:05:49] Fire-Dragon-DoL: you must require those I think
[20:06:48] kaspergrubbe: DylanJ: helpers = ActionView::Base.new, helpers.hello
[20:06:58] DylanJ: ARMIGER1: ^
[20:08:07] ARMIGER1: DylanJ: So if it's not a custom view header, I just have to require ActionView::Helpers?
[20:20:45] kara_sweets: hey guys do you know how to add a click function to a button in a rails form?
[20:21:42] toretore: button.addEventListener('click', function(){}, false)
[20:22:48] n3lthon: can someone help with rubymine remote feature?
[20:23:13] elaptics: kara_sweets: with query?
[20:23:22] elaptics: kara_sweets: jquery*
[20:24:06] lxsameer: how can i disable I18n for a controller for set it to en ?
[20:24:15] kara_sweets: elaptics: yea
[20:24:16] kara_sweets: https://gist.github.com/anonymous/0594fc8f055fa5f33fb3
[20:24:25] kara_sweets: I'm using this code but its not even triggering the console message
[20:25:08] elaptics: kara_sweets: you have the selector wrong. You need $("button .btn-success")
[20:25:26] kara_sweets: elaptics: good catch!
[20:25:40] elaptics: kara_sweets: actually $("button.btn-success") no spaces
[20:26:23] elaptics: kara_sweets: pro tip. When you're looking at the page, use the developer console tools to test getting the element with the selector
[20:26:26] kara_sweets: crap still no console message when i click button but no error at all
[20:26:52] kara_sweets: elaptics: i did, the generated class for the button is button btn-success
[20:27:01] kara_sweets: class="button btn-success"
[20:27:05] kara_sweets: appears in the html
[20:27:11] elaptics: kara_sweets: can you add your html output to the gist?
[20:27:28] elaptics: kara_sweets: in that case try $(".button.btn-success")
[20:27:55] elaptics: kara_sweets: is it an input element or a button element?
[20:27:56] kara_sweets: elaptics: there we go, that worked
[20:28:16] shawnjgoff: I've got rbenv troubles. "gem install" claims to install a gem, but it's not there. http://pastie.org/8168552
[20:28:32] kara_sweets: the generated html is an input element but the semantic of the rails helper make it seem like a button element
[20:28:44] elaptics: lxsameer: what do you mean by disable i18n for a controller?
[20:29:28] lxsameer: elaptics: i use active admin and i want it to use en locale, not my current website locale
[20:30:53] elaptics: lxsameer: hmm, yuck. I hate active admin. The only thing I can think of is that maybe you can scope your active admin routes to force it to an en locale, assuming you're using urls to determine the locale
[20:31:50] lxsameer: elaptics: hmm that comes to my mind too but i'm lazy :D , what do you use instead of active admin ?
[20:32:53] kara_sweets: now query is throwing this error https://gist.github.com/anonymous/d1cc577e8055164a38e6
[20:32:57] elaptics: lxsameer: I just create that standard crud stuff with my own generators using simple_form - almost as quick to do but much more flexible and no magic jiggery pokery
[20:33:34] lxsameer: elaptics: hmmmm i used to do the same
[20:34:13] elaptics: kara_sweets: what line is it complaining about?
[20:35:22] kara_sweets: it's referencing this line in the query code:
[20:35:24] kara_sweets: https://gist.github.com/anonymous/d415afa07a8ba7ca808e
[20:35:26] kara_sweets: jquery code *
[20:36:20] elaptics: kara_sweets: follow the stack trace in the javascript console back to the line of your code
[20:36:40] kara_sweets: what do you mean?
[20:37:02] elaptics: kara_sweets: what browser are you using?
[20:37:02] kara_sweets: it only references that line, doesn't show which line in my code is causing the error though
[20:37:25] Lewix: I bundled install debugger but I can't seem to make it work
[20:37:29] Lewix: >> require 'debugger'
[20:38:02] platzhirsch: I would like to require a certain module only if I want to when launching my rails server with $ rails server. How can I do that?
[20:38:37] TheBlackMan: i guess you can create your own version of rails server.
[20:38:40] TheBlackMan: that requires it
[20:38:49] Lewix: config folder platzhirsch
[20:38:50] elaptics: kara_sweets: I can't remember exactly where you need to look, it's either in the console tab or maybe the sources tab I'm sure it points out the line and gives a stack trace in red which you can expand to trace it back
[20:38:57] platzhirsch: Lewix: thanks
[20:41:00] kara_sweets: elaptics: ahh figured it out, the problem was with prepend
[20:41:13] kara_sweets: elaptics: but now the form isn't submitting remotely anymore
[20:41:22] kara_sweets: it appending the data to the table but not submitting
[20:41:32] elaptics: kara_sweets: well you're returning false at the end of the function - that stops it submitting
[20:41:50] kara_sweets: elaptics: well ill be darned
[20:42:22] sfuentes: anyone else getting this: ERROR: Could not find a valid gem 'activerecord' (= 3.2.14) in any repository
[20:42:51] sfuentes: this is after I run: gem install activerecord -v 3.2.14
[20:44:18] kara_sweets: is there a way to access the values after submit
[20:44:32] elaptics: kara_sweets: the values of what?
[20:44:35] kara_sweets: elaptics: I'm now trying to set the values to nil after form submit (basically make the form blank again)
[20:44:47] kara_sweets: if i put it in the click function the values are nil before the form even submits
[20:45:11] kara_sweets: is there a success function?
[20:45:14] elaptics: kara_sweets: you need to do that in a success callback
[20:45:36] kara_sweets: does remote: true trigger that or do i need to write my own ajax query?
[20:45:57] dobry-den: sfuentes: https://rubygems.org/gems/activerecord/versions
[20:47:51] elaptics: kara_sweets: I highly recommend reading http://www.alfajango.com/blog/rails-3-remote-links-and-forms/ and his related articles, it explains it way better than I can. But basically you need to bind the form to something like the ajax:success event and then in that function you can do what you need
[20:48:10] kara_sweets: elaptics: gotcha
[20:48:18] kara_sweets: just found a nice section in the rails guides that explains it
[20:48:25] kara_sweets: but it is showing coffee script
[20:48:48] sfuentes: dobry-den: but rails has a dependency on activerecord 3.2.14
[20:49:15] sfuentes: rails 3.2.14 has a dependency on activerecord 3.2.14
[20:49:55] sfuentes: dobry-den: https://rubygems.org/gems/rails/versions/3.2.14
[20:50:23] dobry-den: sfuentes: what happens when you just drop rails 3.2.14 in gemfile and then bundle?
[20:51:39] sfuentes: dobry-den: it fails as well
[20:52:17] elaptics: kara_sweets: which guide is that?
[20:52:43] kara_sweets: http://edgeguides.rubyonrails.org/working_with_javascript_in_rails.html
[20:53:00] davidcelis: lmao they forgot to release activerecord 3.2.14
[20:53:43] davidcelis: tthey haven't announced any sort of release for 3.2.14 at all, though
[20:53:48] sfuentes: dobry-den: https://gist.github.com/anonymous/6066070
[20:54:25] sfuentes: wait hold-on ... i need to delete the lock file
[20:54:28] davidcelis: sfuentes: It looks like 3.2.14 isn't fully released
[20:54:47] davidcelis: because activerecord 3.2.14 hasn't been released
[20:54:50] dobry-den: shouldnt have to delete lock file
[20:54:53] davidcelis: sfuentes: you need to stay on 3.2.13
[20:55:00] davidcelis: or use 3.2.14.rc2
[20:55:46] davidcelis: LOL https://rubygems.org/gems/ActiveRecord
[20:55:50] davidcelis: someone fucked up
[20:56:10] davidcelis: https://github.com/rubygems/rubygems.org/issues/584
[20:57:41] xybre: davidcelis: that is weird
[20:58:00] sfuentes: davidcelis: i see ... I did see that ActiveRecord 3.2.14 gem and was like wth
[21:00:40] dllama: I've noticed my delayed_job crashing here and there. anyone have a solution for auto restarting it?
[21:00:49] mantas322: good job today guys.
[21:00:59] mantas322: good work helping me learn this crap.
[21:03:32] elaptics: dllama: look into something like monit or god or bluepill
[21:03:52] joelteon: i can verify that they all suck
[21:05:15] elaptics: joelteon: what do you use?
[21:05:19] dllama: thanks elaptics, joelteon, is there a solution that you'd recommend?
[21:05:19] tubbo: joelteon: nagios? :)
[21:05:30] joelteon: elaptics: bluepill
[21:05:39] elaptics: joelteon: because it sucks the least? :)
[21:06:13] skinofstars: hi guys. is there a recommended way of using twitter bootstrap with rails? .... or is there another preferred template framework to use with rails?
[21:06:23] skinofstars: ACTION rails noob
[21:07:25] tbuehlmann: skinofstars, there's an example app for exactly that. see http://railsapps.github.io/rails-bootstrap/
[21:07:37] kaspergrubbe: skinofstars: we use this: https://github.com/thomas-mcdonald/bootstrap-sass
[21:18:29] platzhirsch: Help me to name a method in a controller: method loads necessary data to display from the database
[21:19:52] elaptics: platzhirsch: index or show - it's a restful controller, right?
[21:20:14] ssvo: 1lololol
[21:20:20] ssvo: my fuckin irssi was wiggin out
[21:20:22] ssvo: it was weird
[21:20:27] ssvo: all my channel names were blank
[21:20:32] platzhirsch: elaptics: oh, no. Actually it's a parent class controller to hold mutual controller methods
[21:20:43] ssvo: as soon sa i typed they all came back
[21:21:00] platzhirsch: just want to avoid redundant code, but maybe it will be the same?
[21:21:15] ssvo: but thank you elaptics for reminding me how much of a nub i am
[21:21:43] elaptics: ssvo: you're welcome :D
[21:21:57] ssvo: elaptics: tehe >.<
[21:24:45] Alkorn: Hey guys can you help me to fild list of sites who used rails, i saw it on official site but now i cann't find it and see nly 6 item
[21:26:38] bmsatierf: Any idea how could I accept well formed requests on my api domain (api.foo.com) and redirect to the main domain (www.foo.com) when the user access the api domain though a browser window? Ex: $ curl https://api.foo.com/v1/bar returns a json, but opening the same URL on a browser window would redirect the user to www.foo.com
[21:28:10] elaptics: bmsatierf: you can control that by checking on the request type, e.g. html, json by sending the appropriate headers - so your curl request would need to send 'application/json'
[21:28:28] elaptics: bmsatierf: then in rails you can respond differently based on the format
[21:28:42] bmsatierf: elaptics: nice! thank you =)
[21:37:47] Mikail_: Does anyone know if I can create an object during/in validation and send the object back to the controller
[21:38:59] elaptics: Mikail_: what are you actually trying to do?
[21:42:16] Mikail_: elaptics: Good question :) Trying to get my head around the thinking of Rails. I collect login/pass in a form, that passes normal validation. If ok I need the login pass to create a connection object for a 3rd party API and get the connection object back for further use in the controller.
[21:42:48] Mikail_: not sure if it is for the validation, another model, the controller ore someway else to handle this
[21:43:27] Mikail_: the object should last until the user quits his session
[21:44:02] lethjakman: Mikail_: do you understand session data?
[21:44:28] elaptics: Mikail_: well you'd need to save that object somewhere - probably the database because the web is stateless. Generally it's not good practice to store an object in the session, so you'd want to just store a reference to the object
[21:45:32] lethjakman: elaptics: that's exactly what I was going to suggest. I just wanted to make sure he understood sessions first.
[21:45:48] elaptics: Mikail_: generally in your controller you'd want to validate the user and in the positive path go off and do the 3rd party stuff and sticking the connection object details you get back somewhere like the session
[21:47:17] eladmeidar: rsl: report at once
[21:47:43] Mikail_: tried to store it in a session, but seems like I got some kind of serilization if I recall right.What I actually want with the object I get is to run methods and view the results
[21:48:11] rsl: eladmeidar: ping
[21:48:18] eladmeidar: rsl: leap motion?!?!
[21:48:26] eladmeidar: rsl: how long did it take you to get it?
[21:48:27] rsl: eladmeidar: yup
[21:48:31] eladmeidar: lucky bastard
[21:48:34] rsl: over a year
[21:48:39] rsl: ordered may 2012
[21:48:45] elaptics: Mikail_: what is this 3rd party api thing?
[21:48:57] eladmeidar: rsl: and i thought waiting 2 months is a long time :/
[21:49:06] rsl: yeah waiting on a pebble still too
[21:49:22] elaptics: Mikail_: also do you understand the web request/response cycle?
[21:49:56] eladmeidar: rsl: i hate living in this place, nothing gets here :)
[21:50:14] eladmeidar: rsl "no" == "i envyz"
[21:50:21] rsl: eladmeidar: heh it took forever on the leap motion
[21:50:27] rsl: gonna play with ruby and it this weekend
[21:50:30] Mikail_: elaptics: I try to build upon this : https://github.com/gstark/tesla-api and use module/classes from there to view various results from there
[21:51:18] Mikail_: elaptics: Cannot say I get how in this context? Implying I try to do stuff not suit for Rails?
[21:51:56] eladmeidar: rsl: pebble won't be here until 2015 i think
[21:52:17] rsl: i think they're in best buy already but i preordered an orange one
[21:52:21] rsl: don't want that black one
[21:52:21] Mikail_: hmm, I ordered the Leap Motion today - hav no clue on what to use it for :D
[21:52:40] elaptics: Mikail_: well it's not specifically to do with rails, each web request/response stands alone, we can only use cookies/sessions to maintain the appearance to the user that they're not logging in every time they make a request, but in reality that's what we're doing so you can't keep an object hanging around across requests
[21:52:56] rsl: Mikail_: it's pretty cool. and yeah i have no idea either but i will think of something.
[21:54:11] Mikail_: elaptics: even in an request?
[21:54:47] elaptics: Mikail_: in the request of course you have the object, but at the next request you have to start again
[21:56:16] Mikail_: elapsis: can I create my own connection model based off of both the API::Connection and ActiveModel::Base - is that a solution that could work ? The n I can save it to a database AND retrieve it to run methods on that instance later for the user.
[21:56:48] elaptics: Mikail_: probably
[21:57:06] eladmeidar: rsl: i ordered the red
[21:57:17] Mikail_: rsl: Hope i can control my mac pointing and looking silly. That would make it worth it :)
[21:57:19] rsl: eladmeidar: lol we're in the same boat then lol
[21:57:42] rsl: Mikail_: i didn't play a lot with the 'touch less' app that's designed to do just that but it's there
[21:57:43] rsl: and free
[21:58:51] Mikail_: elaptics: Any caveats inheriting from two classes?
[21:59:03] elaptics: Mikail_: in ruby, you can't
[21:59:10] eladmeidar: rsl: i'll have to kill someone what has it already
[21:59:29] elaptics: Mikail_: ruby doesn't have multiple inheritance, we use modules and mix them into classes instead
[21:59:58] Mikail_: elaptics:"mix" them?
[22:00:18] Mikail_: the API I'm using is a module with classes
[22:00:55] elaptics: Mikail_: the common term used is mixin. Essentially you just include the modules into the class, kind of like requiring multiple files
[22:01:13] elaptics: Mikail_: sounds like you need to read a bit about how ruby works
[22:01:13] Mikail_: module TeslaAPI
[22:01:14] Mikail_: class Connection
[22:01:14] Mikail_: include PrivateAPI
[22:01:25] helpa: Mikail_: Please do not paste code to the channel. It makes it hard to read and respond, especially if everyone does it. Use https://gist.github.com to share your code and errors. Thank you!
[22:01:25] eladmeidar: Mikail_: !paste
[22:01:43] eladmeidar: Mikail_: !google extend vs include ruby
[22:01:49] Mikail_: Willdo - sorrywas 3 lines :)
[22:02:30] elaptics: Mikail_: in that instance you just pasted, that's also using modules to namespace classes to avoid class name clashes
[22:03:31] elaptics: Mikail_: TeslaAPI is the namespace module, whilst in the class definition it's including another module called PrivateAPI, which means that all the methods in that module are available to that class just as if you defined them in there directly
[22:04:23] Mikail_: so include TeslaAPI in my class gives me all possibilities?
[22:05:51] davidcelis: http://weblog.rubyonrails.org/2013/7/23/Rails-3-2-14-has-been-released/
[22:06:00] davidcelis: OMG I'M ON THAT BLOG POST!!!!!!!!!!!!!!!!!!!!!!!
[22:06:25] eladmeidar: davidcelis: congrats
[22:06:38] webdestroya: davidcelis: cheers!
[22:06:44] parndt: thanks for fixing my images davidcelis
[22:07:04] davidcelis: parndt: 💛💜💙💚💗💛💙
[22:07:09] Paradox: anyone have a particular opinion on what options parsing library to use?
[22:07:16] parndt: Paradox: thor?
[22:07:26] Paradox: something with less overhead preferibly
[22:07:32] davidcelis: parndt: thor?
[22:07:35] rsl: davidcelis: grats
[22:07:35] davidcelis: Paradox: thor?
[22:07:36] Paradox: i could always use optparse
[22:07:39] elaptics: Paradox: optparse
[22:07:48] parndt: you *could* use optparse
[22:07:49] Paradox: but wanted to play with other ones
[22:07:52] Paradox: like trollop or whatever
[22:08:01] parndt: play with them :)
[22:08:01] davidcelis: more like trolollop
[22:08:47] parndt: Saw this dropbox clone but with 20GB space on signup: https://copy.com/?r=vNTGjY
[22:08:52] parndt: seems pretty nice to use
[22:09:34] parndt: ACTION is wary of Dropbox these days
[22:09:43] lethjakman: parndt: did you see that security breach they had?
[22:09:50] parndt: lethjakman: dropbox or copy?
[22:09:52] lethjakman: if you knew a username and the file name you could download it
[22:09:56] toretore: did you really just drop a ref url?
[22:10:00] parndt: yeah, unfortunate huh
[22:10:08] Mikail_: elaptics: Thank you! You pointed me away in a direction I can read up on to see if that goes somewhere in my project :) As a curiousity I havent been connected to an IRC server in approx 20 years - was surprised to se it alive actually :)
[22:10:10] parndt: toretore: yep, otherwise it's 15GB :P
[22:10:25] elaptics: Mikail_: we are very much alive and kicking :D
[22:10:37] apneic: I have a button on the front end of my site. I change the post url dynamically with some jquery. So if someone makes a selection somewhere else on the page, the url is altered. This works fine, but I find that after I submit, and if I press the back button, those changes are lost and the button points to the default url.
[22:10:57] apneic: Is that due to browser caching, or default behavior of buttons?
[22:11:13] elaptics: all of the above?
[22:11:13] eladmeidar: good answer :)
[22:11:56] elaptics: apneic: best solution? disable the back button :)
[22:12:05] apneic: I like that. Only forward progress.
[22:12:17] eladmeidar: quick, hide.
[22:12:28] parndt: eladmeidar: haha
[22:17:26] eladmeidar: my last commit to rails was in 2009 :)
[22:17:29] davidcelis: parndt: safer to just set up your own server to sync a folder with client-side encyrption
[22:17:32] eladmeidar: and in ActiveResource :)
[22:17:56] eladmeidar: never trust the cloud
[22:18:17] parndt: davidcelis: sure, that'd be the ultimate :P
[22:18:40] davidcelis: it's not hard
[22:18:46] davidcelis: but the main reason i use stuff like dropbox is to share the files
[22:18:54] davidcelis: so i've just been using cloudup
[22:19:06] parndt: that's why I use it
[22:24:00] n3lthon: any RubyMine user where?
[22:29:49] imaginationcoder: n3lthon: yes, I am
[22:30:16] n3lthon: imaginationcoder: are you using windows?
[22:32:07] n3lthon: imaginationcoder: im trying to connect rubymine to my debian vm, and it works, but when I use the bundle options of RubyMine it uses my windows project path in linux and I cant find where I can map both paths.
[22:32:30] eladmeidar: vanilla rails
[22:34:15] GMFlash: hello all. i'm trying to evaluate trusted ruby code in a limited context and here's what i have so far: ( https://gist.github.com/GMFlash/6066746 ~20LOC ) do you have any recommendations on how I can improve it? i'm not sure if i'm reinventing the wheel or not.
[22:34:24] imton: guys, could someone help me how I should handle errors across my app?
[22:34:33] imaginationcoder: n3lthon: never used that way. but, this might be some what helpful in your case: http://pivotallabs.com/intellij-modules-in-rubymine/
[22:35:01] imaginationcoder: that section where it talks about idea files, MAKE MODULES WORK IN RUBYMINE
[22:36:25] n3lthon: imaginationcoder: thanks
[22:42:12] tjbiddle: Hey guys - What's the best way to handle an old migration script that references a model that no longer exists when I build a project from scratch? (If that made sense)
[22:43:32] tjbiddle: The issue - I had a script in place to migrate data from one table to another - So I had calls to the models; however I've removed that model now so it will not work when building from scratch.
[22:44:45] GMFlash: tjbiddle: you don't always have to keep all of your migrations around. sometimes it's better to consolidate them: http://stackoverflow.com/questions/1486514/when-if-to-consolidate-activerecord-migrations
[22:50:01] vassy: any active admin user had a model named "ad"?
[22:50:11] tjbiddle: GMFlash: Thanks! Looks like if I want to replace the schema then it's best to essentially replace the content of an older migration up to where I want it with my schema so that it doesn't get re-run.
[22:51:58] vassy: I can't see the rows in the active admin list table because it has classes like #ad_1 with display: none
[23:07:24] Radar: YO WASSUP SC0RP10N MY BROTHER?
[23:07:38] Radar: ACTION stands with arms crossed gangsta style
[23:07:40] Sc0rp10n: hey how's it going brah!
[23:07:54] Radar: just crushing some code (yo)
[23:08:14] Sc0rp10n: me too homie!!
[23:08:18] blitz: in older versions of rails, what does the <%- do differently from <%
[23:09:56] Sc0rp10n: so what are you working on these days brah!! ?
[23:10:11] parndt: blitz: that's not Rails
[23:10:13] parndt: that's Ruby
[23:10:25] parndt: do you mean -%> vs %>
[23:10:35] parndt: if so it suppresses a new line
[23:11:18] Radar: Sc0rp10n: sorry bro was doing some reps
[23:11:27] gwillen: parndt: huh, that's handy
[23:11:29] Sc0rp10n: no problem bro
[23:11:30] Radar: Sc0rp10n: I CRUSH CODE for Spree Commerce
[23:11:41] Sc0rp10n: oh I know you brah
[23:11:47] Sc0rp10n: was reading your book the other day
[23:12:18] parndt: Sc0rp10n: I'm sorry to hear that
[23:12:53] Sc0rp10n: parndt: dont worry, just downloaded from torrents :P
[23:13:35] Radar: which book?
[23:13:35] parndt: Radar: sue him
[23:13:50] Radar: ACTION clicks fingers, points lawyers at Sc0rp10n 
[23:14:13] Sc0rp10n: was just checking out your old book brah, Radar
[23:14:24] helpa: If you type a few letters of another user's name and then press tab, if you have a proper client, it'll autocomplete towards their name. You might have to press tab more than once to get there though.
[23:14:24] parndt: !tabcomplete
[23:14:51] Sc0rp10n: parndt, thanks brah!!
[23:15:42] Sc0rp10n: Radar, what ya think of nodejs brah
[23:16:02] Sc0rp10n: got it, parndt
[23:16:12] sgsfhsdfh: I am getting a syntax error on this: before_filter {|controller| controller.can_see_project?(params[:project_id])}, only: :show. Can some one please explain how to pass the only option to the filter?
[23:16:28] Radar: Sc0rp10n: I'm going to drop the act now.
[23:16:41] Sc0rp10n: Radar, alright
[23:16:45] Radar: before_filter(only: show) { |controller| … }
[23:16:49] Radar: sgsfhsdfh:
[23:17:10] newtoruby: hey guys, how do you test ActiveRecord's methods, and are there good examples somewhere? I am trying to test 'self.first' and 'self.find_by_name("abc")' but have no idea how to set up the test
[23:17:25] parndt: is it not before_filter -> {|controller| foo }, only: show
[23:17:34] sgsfhsdfh: Thanks Radar.
[23:18:00] Radar: newtoruby: why are you testing that which is already tested?
[23:18:24] Sc0rp10n: yo Radar what do you think of node.js stack for web dev?
[23:18:39] parndt: what stack
[23:19:03] helpa: newtoruby: Do not PM members of the channel without first asking if that is OK.
[23:19:03] Radar: newtoruby: !rule12
[23:19:06] Sc0rp10n: like node, express, mongoose
[23:19:10] Radar: Sc0rp10n: we don't talk about that in here
[23:19:40] Sc0rp10n: Radar: why is that?
[23:20:00] Sc0rp10n: just asking for opinion on node vs rails for web dev
[23:20:06] Sc0rp10n: what are your thoughts
[23:20:07] Radar: Sc0rp10n: because this is the #rubyonrails channel and we don't compare epenises.
[23:21:37] Sc0rp10n: hey when is your new book coming out btw, Radar
[23:21:40] parndt: it's not like we're hanging out in #nodejs though is it
[23:21:42] Radar: Sc0rp10n: now please stop highlighting me because I have work to do.
[23:21:47] helpa: Sc0rp10n: Multitenancy With Rails - https://leanpub.com/multi-tenancy-rails - An excellent book that teaches you about building a Multitenanted Rails application. Written by Ryan Bigg.
[23:21:47] Radar: Sc0rp10n: !mtwr
[23:22:04] Sc0rp10n: so much self promotion, Radar
[23:22:07] luisjose: hi, is there a way to make ActiveRecord::Base.connection.execute return the type as they are in the database instead of everything as string?
[23:22:22] Radar: Sc0rp10n: I'm asking you nicely.
[23:22:45] newtoruby: how do I get better at writing Ruby test :?
[23:22:53] parndt: newtoruby: practice makes perfect
[23:22:56] parndt: -o parndt
[23:23:05] Radar: I actually have a client option to ignore highlights for certain people… lemme turn that on.
[23:23:09] parndt: newtoruby: http://iwanttolearnruby.com might have something on it
[23:23:19] davidcelis: i tried to op myself but it didn't work what gives parndt
[23:23:26] Sc0rp10n: nah I won't bother you anymore
[23:23:28] parndt: davidcelis: weird
[23:23:31] helpa: newtoruby: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Steve Klabnik, Ryan Bigg, Yehuda Katz
[23:23:31] Radar: newtoruby: !r4ia
[23:23:32] Radar: newtoruby: you read my book and it teaches you
[23:23:44] Sc0rp10n: you have a book to write
[23:25:23] Sc0rp10n: what are you upto dude
[23:25:31] parndt: I _was_ working
[23:26:04] fschuindt: err… why my /log folder is empty? Any idea?
[23:26:16] parndt: fschuindt: /log or RAILS_ROOT/log ?
[23:26:27] fschuindt: parndt RAILS_ROOT
[23:26:43] parndt: fschuindt: possibly permissions problem or your app hasn't tried to log or it's set to log somewhere else
[23:26:48] parndt: hard to say
[23:26:56] davidcelis: parndt: lol bro
[23:27:01] davidcelis: more like Rails.root.join('log')
[23:27:24] parndt: davidcelis: you're right bro sorry
[23:27:29] parndt: this is why you get paid the big bucks
[23:27:31] helpa: parndt: ❤
[23:27:44] davidcelis: ACTION makes pretty railses
[23:29:00] fschuindt: davidcelis sorry about my noobness, but where I put it? I have just formatted my mac, and after cloned my app does not have logs files anymore. :(
[23:29:24] parndt: log files don't come down with the clone
[23:29:48] davidcelis: fschuindt: log files are git ignored by default
[23:29:59] davidcelis: fschuindt: next time you run the app, it'll generate them and begin logging
[23:30:06] fschuindt: davidcelis: ok, the app is running...
[23:30:12] fschuindt: davidcelis: and still no files
[23:30:57] helpa: davidcelis: 💛💜💙💚💗💛💙
[23:30:57] parndt: davidcelis: !<3<3
[23:31:01] parndt: Radar: win
[23:31:11] davidcelis: fschuindt: i mean like
[23:31:14] davidcelis: fschuindt: have you visited any pages
[23:32:02] fschuindt: davidcelis: yeap
[23:32:16] davidcelis: sounds like logging's either disabled or set to log somewhere else, then, like parndt said
[23:32:26] davidcelis: fschuindt: i'd check your config files
[23:37:21] fschuindt: davidcelis I can't find any log path configuration os other things :/
[23:59:00] Paradox: i dont want to have to write raw sql
[23:59:13] Paradox: but my data import is pegging in at 50 hours!
[23:59:22] Paradox: i'll see how it runs