« Back to channel list

#RubyOnRails - 26 September 2013

« Back 1 day Forward 1 day »
[00:00:28] jstrong: Radar: DoctorMonocular: and realistically how many controllers would you have that log actions?
[00:00:30] yekta: jstrong: k, one sec
[00:00:46] foucist: Radar: derp moment.. what's model changes (as opposed to modifying a post in the db?)
[00:01:09] jstrong: yekta: do try to understand how it works though. we're using the CourseRequirement table as the the in-between table that connects programs to many courses
[00:01:17] jstrong: yekta: so that's what the through: does.
[00:01:48] Radar: foucist: model changes like a name field goes from "R" to "Ryan"
[00:01:52] Radar: foucist: that kind of stuff
[00:02:15] jstrong: would some sort of observer pattern work here or am I off the rails?
[00:02:22] yekta: jstrong: yes, very interesting
[00:02:37] yekta: jstrong: worked like a charm too
[00:02:43] jstrong: yekta: in your particular model since course requirement is attached to course and not program we needed a two throughs
[00:03:01] jstrong: yekta: throughs can be changed as many times as you want. so really what's happening is program -> course -> course requirements -> course
[00:03:10] foucist: Radar:yet audited gives an example like: @post = Post.create(params[:post]) ; @post.audits.last.user # => #<User name: "Steve">
[00:03:15] DoctorMonocular: how many, I'm not exactly sure, that's kind of why I'm trying to come up with a generic solution here... editing a bunch of different things would be logged, deleting all those things, restoring those things--so all those actions for maybe 9 models (so far)
[00:04:18] Radar: foucist: Not what he wants now.
[00:04:50] jstrong: DoctorMonocular: sure you could create something generic but you'd have to put a lot of effort into it.
[00:05:43] DoctorMonocular: I was hoping a relatively simple module/concern would do it without much fuss, but the whole logged in user thing throws a wrench in those works big time
[00:08:26] sml0820: does jquery-rails gem include jquery-ui? I am trying to remove jquery-ui from my javascript files
[00:09:02] jstrong: sml0820: it doesn't seem so
[00:09:10] Radar: https://github.com/rails/jquery-rails
[00:09:11] helpc: GitHub | rails/jquery-rails (443??? 214??? 6???) : A gem to automate using jQuery with Rails 3
[00:09:27] Radar: press "t", type "jquery" see that there is no jquery-ui
[00:09:46] foucist: sml0820: check for the jquery-ui line in the assets/javascripts/ dir, and remove the line completely (commenting it out doesn't work) perhaps
[00:10:33] yekta: jstrong: interesting stuff, so the Program always maps to a single Course, which is named the same as the Program, which then is a duplicated name but the benefit I'm is it will require less code later on.
[00:10:49] yekta: s/I'm/I'm told
[00:10:59] jstrong: yekta: if your db architect knows what he is doing then he knows what he is doing. was just wondering
[00:11:07] jstrong: yekta: because sometimes needless complexity is added in.
[00:11:07] sml0820: foucist: it is not there at all - i am very confused. when I search " jQuery UI - v1.10.3" nothing comes up
[00:11:28] sml0820: foucist: yet it is there when i click inspect source on my browser and go to javscript files
[00:11:29] jstrong: yekta: btw those has many throughs work just fine with joins and includes
[00:11:44] DoctorMonocular: waaaait a minute, audited keeps track of the logged in user, just like I want to. It does it from the model. I smell shenanigans
[00:11:49] foucist: sml0820: search for "jquery-ui" not "jQuery UI"
[00:11:50] yekta: jstrong: right, adding program_id to the courses seemed much simpler, but I guess I'll take his word for it this time
[00:12:05] jstrong: yekta: e.g. Program.joins(:required_courses) will doo all the necessary inner joins
[00:12:24] jstrong: yekta: if you use includes then that'll eager load your associations (or use left outer joins) to avoid multiple queries
[00:13:12] sml0820: foucist: no results when I search for it. I am baffled where it is coming from
[00:13:18] yekta: jstrong again, really appreciate the help and explanation.
[00:13:49] jstrong: no worries. I understand how mindbogglingly frustraitng rails associations can be for those who are just learning them
[00:14:00] jstrong: especially given you were trying to do something relatively complex
[00:14:08] jstrong: .. didn't mean to assume you're just learning rails but
[00:14:12] jstrong: you know what I mean.
[00:14:42] yekta: So is the class_name: Course bit in the CourseRequirements model needed because the column isn't called course_requirements_id?
[00:14:42] jstrong: and sorry for the incredible amount of typos
[00:15:06] jstrong: yekta: opposite
[00:15:17] jstrong: yekta: when you define a relationship rails by convention thinks the id is {{relationship_name}}_id
[00:15:30] jstrong: yekta: so if the relationship is course_requirements it'll look for course_requirement_id
[00:15:40] jstrong: yekta: or if it is required_course required_course_id
[00:15:42] foucist: sml0820: so it shows up in the source as <script type="text/javascript" src="site.com/jquery-ui.js"> or what? maybey ou need to clear cache, or deal with the precompiled thing, turn that off
[00:15:43] yekta: Right, that's how I had it - the db architect changed it
[00:15:47] jstrong: yekta: the issue is with the *model*
[00:15:53] jstrong: yekta: your model is named Course not RequiredCourse
[00:16:14] hadees: is there anyway to use an association in a validation? For example I have a shipping_cost model and I want to require some different fields when it's domestic shipping.
[00:16:16] jstrong: yekta: rails too converts your association name into a class name by convention. has_many :goats looks for a Goat class
[00:16:44] jstrong: yekta: since your required_course_id and relationship correspond to the Course model, we need to manually specify the relationship class using class_name
[00:17:18] V8Energy: i am trying to use CarrierWave to save an image from remote url. I followed the railscasts, but it doesn't work for some reason. I am not getting any errors. inside create/update action the :remote_image_url is set to the url, but after saving, the .image_url is nil. https://gist.github.com/anonymous/d212c43b4be9ea84c8ed
[00:17:28] hadees: The only way I have of knowing it is domestic is checking product.country == self.country but the product is coming back as nil even though i build the shipping_cost off it.
[00:18:08] jstrong: yekta: make sense?
[00:18:30] yekta: Yeah that makes sense
[00:18:54] jstrong: in short required_course looks for RequiredCourse. if you want a relationship required_course to point to a class called Course course_name must be used.
[00:19:08] RustyShackleford: I'm trying to make an appointment planner. I need a calendar view (weeks, days, months, etc)
[00:19:20] RustyShackleford: is there a package I can use, or will I need to roll my own
[00:20:46] jstrong: yekta: last but not least you can do the same thing but the other way around. belongs_to :course, foreign_key: "required_course_id"
[00:21:12] yekta: jstrong: Huh, I think I like that more.
[00:21:26] jstrong: yekta: well wait on a sec. not so fast
[00:21:36] jstrong: yekta: the problem is you ALSO have a course_id
[00:21:41] jstrong: yekta: and that's already being defined as belongs_to :course
[00:21:58] jstrong: yekta: so you can't put belongs_to :course twice for both ids without them colliding
[00:22:15] jstrong: yekta: if you want two relationships to the same class (Course) through two different FK's then the relationships must be named differently
[00:22:20] s2013: so if i want to use autocomplete and pull list of all customers from a database, would it be more efficient to just cache the list as an array somewhere? and do a rake task to update the customer list once a day
[00:22:22] yekta: Interesting
[00:22:37] jstrong: because defining a relationship really internally defines a number of methods on that active model object
[00:22:47] jstrong: one of those methods is "def course"
[00:22:58] jstrong: so putting belongs_to :course twice would define "def course" twice and one would override the other
[00:24:26] jstrong: yekta: also if you didn't know rails migraitons won't automatically define fk constraints for you so I strongly suggest you do that.
[00:25:10] yekta: jstrong: yeah, I ended up having to make use of the foreigner gem, turns out rails doesn't do that because of sqlite or something
[00:25:27] jstrong: yekta: k cool
[00:27:40] yekta: jstrong: thanks again, "I yield the floor to my other colleages" :)
[00:28:41] jstrong: RustyShackleford: I once used https://github.com/watu/table_builder
[00:28:41] helpc: GitHub | watu/table_builder (103??? 27??? 12???) : Rails builder for creating tables and calendars inspired by ActionView's FormBuilder.
[00:29:03] jstrong: RustyShackleford: but it's old and who knows if would work with latest rails
[00:29:21] RustyShackleford: I'm pretty green when it comes to web dev
[00:29:34] RustyShackleford: not really sure how i'd roll my own
[00:29:34] jstrong: calendars are always a PIA
[00:30:14] RustyShackleford: so I'm gonna need an html/css calendar display
[00:30:28] RustyShackleford: will I need to make a Calendar class in ruby too?
[00:31:06] jstrong: http://railscasts.com/episodes/213-calendars
[00:31:09] jstrong: super old but would help
[00:33:13] RustyShackleford: jstrong, cool I'll watch it
[00:33:44] chadwtaylor: In my ApplicationController, I have HTTP Authentication... but I want to ignore it for a specific controller. I'm aware I can ignore a METHOD, but not CONTROLLER#method (http_basic_authenticate_with name:xx, password:yy, :except => ["index"])
[00:34:13] jstrong: V8Energy: https://gist.github.com/anonymous/d212c43b4be9ea84c8ed#file-wish-rb-L11-L18
[00:34:15] chadwtaylor: how can I use :except in http_basic_authenticate_with to include a controller, not just a method.
[00:34:15] jstrong: why do you have that?
[00:34:23] jstrong: V8Energy: just trying to memoize it?
[00:34:33] chadwtaylor: Any help and guidance is greatly appreciated.
[00:34:58] V8Energy: jstrong: otherwise it complains remote_image_url is undefined method.. or something
[00:35:31] jstrong: V8Energy: OK so there's a problem. carrierwave should define that for you. just because you define the method doesn't mean carrierwave will start using it.
[00:36:53] foucist: chadwtaylor: skip_before_filter :http_basic_authenticate_with in that specific controller perhaps
[00:37:10] foucist: chadwtaylor: if it's already a before_filter in application controller
[00:37:18] V8Energy: jstrong: yes i removed the getter/setter and it works now but it complains :Image could not download file: 404 Not Found
[00:37:28] chadwtaylor: foucist: Going to try that now, thanks.
[00:37:35] V8Energy: jstrong: i am using this url: http://g-ec2.images-amazon.com/images/G/01/kindle/dp/2013/KT/kt-slate-01-lg-hover.jpgg-ec2.images-amazon.com/images/G/01/kindle/dp/2013/KT/kt-slate-01-lg-hover.jpg
[00:37:46] jstrong: V8Energy: 404 not found means exactly what it says
[00:37:53] jstrong: V8Energy: not found.
[00:38:05] jstrong: V8Energy: does that URL work for you?
[00:38:19] jstrong: V8Energy: does not for me
[00:38:53] chadwtaylor: foucist: Drat, that didn't work.
[00:39:00] chadwtaylor: I'll create a GIST to show what I'm trying to achieve, brb.
[00:39:01] V8Energy: jstrong: thank you. you helped me solve the real issue there :)
[00:39:18] jstrong: alright peeps well i've been on here way too long
[00:41:32] dopie: jstrong, got it working :)
[00:42:18] chadwtaylor: https://gist.github.com/chadwtaylor/6708300
[00:42:32] chadwtaylor: foucist: https://gist.github.com/chadwtaylor/6708300
[00:45:49] digitalcake: rspec-rails is not generating on rails g model ??? I'm using rails 4 and rspec 2 where should I start to look to figure this out?
[00:46:08] foucist: chadwtaylor: i added a comment https://gist.github.com/chadwtaylor/6708300 basically wrap it in a before_filter
[00:46:22] foucist: chadwtaylor: then you can do skip_before_filter :authenticate on the messages controller
[00:47:38] foucist: chadwtaylor: if that doesn't work, try the one from http://stackoverflow.com/questions/15662969/what-is-the-difference-between-http-basic-authenticate-with-and-authenticate-or
[00:48:27] chadwtaylor: Awesome, thanks foucist!
[00:49:22] chadwtaylor: foucist: Updated the gist: https://gist.github.com/chadwtaylor/6708300
[00:49:40] chadwtaylor: Appreciate your help!
[00:50:20] foucist: chadwtaylor: i guess def authenticate; http_basic_authenticate_with name:'xx', password:'yy'; end didn't work ?
[00:50:36] chadwtaylor: Yea, it didn't.
[00:50:47] chadwtaylor: that is only good outside a method.
[00:52:22] odigity: just to be clear, there's really no point in setting "default: nil" on a column, right? I mean, that's what happens in the absence of specifying a default anyway
[00:54:16] jstrong: Radar: So I'm sort of smoking something here but I was thinking about that logger discussion https://gist.github.com/laspluviosillas/a9e0b3e399c529fd5339
[00:54:43] jstrong: Radar: roughly (not going to invest too much time on that)
[00:54:59] Radar: You might need additional logic around the event logging
[00:55:08] jstrong: oh most definitely.
[00:55:13] Radar: i.e. in the PostsController if a user edits their own post, then that would trigger a different event than if a moderator edited it
[00:56:52] jstrong: which I guess kind of points to the fact that trying to standardize it app wide isn't that great of an idea.
[00:57:16] Radar: yes, that is what I said an hour ago :P
[00:57:38] godd2: I'm having a problem with nested attributes and strong parameters: https://gist.github.com/anonymous/6708399
[00:58:11] godd2: It doesn't seem to see the image attribute in the params hash even though I whitelisted it
[00:58:33] Radar: godd2: stacktrace for the error please
[00:59:11] godd2: Radar: application trace, framework trace or full trace?
[01:01:24] godd2: Here's all three from Rails: https://gist.github.com/anonymous/6708427
[01:02:49] Radar: godd2: your Image model doesn't have an attribute called image?
[01:04:09] godd2: oh, no Im using Paperclip and it has_attached_file :file
[01:04:24] godd2: Should I change its name? Ill try that and get back
[01:05:48] godd2: Got it. Thank you very much :)
[01:05:53] Radar: godd2: gg
[01:12:00] anime4christ: I have the weirdest thing going on: in development, I keep getting ActionController::InvalidAuthenticityToken exception whenever I try to submit any form (the only ones I've tried are sign in and sign up since others require you to be logged in already) while the same app, same revision works fine in production. This started happening just out of the blue today. I thought it might be some change, but changing
[01:12:00] anime4christ: back to an earlier revision and pushing the current one to production yields the same results: dev = useless; production = working. I'm using Rails 4.
[01:13:01] speakingcode: asked earlier but double checking, doc-only pull requests can go to Rails directly and not rails-doc, correct?
[01:13:09] godd2: If I set up the associations correctly, shouldn't it update both the gallery and image models when I update the parent Gallery model?: https://gist.github.com/anonymous/6708504
[01:13:35] speakingcode: godd2: use accepts_nested_attributes_for
[01:14:09] godd2: In gallery.rb in the gist you can see that I did on line 6: accepts_nested_attributes_for :image, reject_if: ->(t){t['image'].nil?}
[01:14:37] speakingcode: oh, sorry, i only saw your last message, wasn't here before ;)
[01:15:32] godd2: It doesn't seem to want to create an entry to my images table when I save a gallery
[01:16:03] speakingcode: yeah so the functionality of accepts_nested_attributes_for is kind of limited
[01:17:26] godd2: Do I have to manually save the Image in my create method for gallery?
[01:18:54] speakingcode: you sholdn't need to no
[01:19:19] speakingcode: but you need to check your permitted params if using strong params
[01:19:52] speakingcode: and you also need to ensure the child models have all required fields and meet all validations in model and db levels
[01:20:05] godd2: I used permit! so it should whitelist everything, even the nested params according to this: http://edgeguides.rubyonrails.org/action_controller_overview.html#strong-parameters
[01:20:35] godd2: "To whitelist an entire hash of parameters, the permit! method can be used. This will mark the parameters hash and any subhash of it permitted."
[01:20:40] godd2: 'and any subhash'
[01:21:34] speakingcode: ah yeah, didn't know about that one
[01:21:45] godd2: and according to this, I should be able to update an associated record at the same time with accepts_nested_attributes_for: http://api.rubyonrails.org/classes/ActiveRecord/NestedAttributes/ClassMethods.html
[01:21:47] speakingcode: assuming that works as expected then that should take care of that i reckon
[01:21:48] anime4christ: has anybody encountered an invalid authenticity token error only in development with same code working fine in production?
[01:22:15] speakingcode: godd2: indeed. so it's not working i presume? any errors or anything in logs that may indicate the issue?
[01:23:02] godd2: anime4christ: have you tried this? http://stackoverflow.com/questions/3364492/actioncontrollerinvalidauthenticitytoken
[01:23:32] godd2: speakingcode: I'm not getting any errors from the browser. It redirects right over to my gallery show page.
[01:23:59] godd2: but then when I go into the rails console and see if any new image entries in the images table have appeared, I get nothing
[01:24:27] speakingcode: godd2: i'd take a peek at the rails server log when the request comes in
[01:25:24] speakingcode: anime4christ: maybe u need to recreate a new secret token
[01:25:40] speakingcode: "rake secret"
[01:25:42] anime4christ: godd2: I suppose I could disable it, but it worked fine just yesterday with identical code. Also, why remove a layer of security from my whole website just because the development version stopped working?
[01:26:16] godd2: anime4christ: assuming it's happening only in development, I wouldn't exactly say you're losing security
[01:26:35] godd2: as you said, it works fine in production, yes?
[01:26:41] anime4christ: speakingcode: would that reset everyone's session in production after I upload the changes?
[01:26:48] speakingcode: anime4christ: not sure
[01:27:12] speakingcode: i'd put it in gitignore anyway. and it may not be the issue. google ur error message
[01:28:26] anime4christ: godd2: yes it does. One of the points of a development version is to test code you release into the wild in a local environment and authenticity token has worked for every app I've ever made in development
[01:28:37] odigity: just to be clear, there's really no point in setting "default: nil" on a column, right? I mean, that's what happens in the absence of specifying a default anyway
[01:29:33] bricker`LA: odigity: depends on the column type
[01:29:57] bricker`LA: odigity: text columns will have a default of "", varchar and integer is null (I believe)
[01:30:10] bricker`LA: odigity: for mysql anyways, not sure about others
[01:30:27] anime4christ: speakingcode: tried a different secret. no dice :(
[01:30:49] odigity: bricker`LA, I didn't know that, thanks. Is it db-dependant? Meaning, ActiveRecord doesn't supply it's own nil defaults in the absence of values being set?
[01:31:08] bricker`LA: odigity: as far as I know, AR leaves that up to the database if you don
[01:31:11] bricker`LA: don't set anything
[01:31:32] odigity: bricker`LA, well, I guess it doesn't really matter much to me if a text field has nil or "", other than for my OCD
[01:31:43] odigity: migration looks cleaner without it :)
[01:32:45] rehat: I'm new with webdev so I don't know if this is a rails thing or html but what does this mean inside of a form element "name="plan[name]""
[01:32:47] speakingcode: anime4christ: while technically godd2 is right, i agree that even taking the security measures out of development only is not the best approach at all, better to find the issue and solve it
[01:33:07] rehat: it looks like an array but I don't know where its coming from
[01:33:38] godd2: rehat: rails is naming the fields in the html so that it can grab them later in the params hash
[01:33:39] bricker`LA: rehat: think of it more like a hash, or an object
[01:34:30] rehat: ok so the plan is the object and name is the attribute inside of the brackets?
[01:35:58] godd2: nam="plan[name]" will be available in the params hash as params[:plan] == {:name => "whatever was put into the name field in the form"}
[01:36:35] anime4christ: speaking code and godd2: I found the issue. It's trying to set a cookie on the wrong domain in development. I had to do this in order to use the cookies across all subdomains. Funny how it took it a while to catch up however and start failing. I use pow and it sometimes has weird caching issues
[01:37:29] godd2: anime4christ: awesome! Ill keep that in mind if that ever comes up in a project :)
[01:37:55] speakingcode: good ole caching
[01:39:20] speakingcode: sevenseacat: i got one you probably know
[01:39:24] dopie: how would i route this , I want www.foobar.com/categories/foo to be www.foobar.com/foo
[01:40:11] helpa: dopie: http://guides.rubyonrails.org/routing.html - Rails Routing From the Outside In - Rails Guide - by Mike Gunderloy
[01:40:11] Radar: dopie: !routing
[01:40:50] odigity: !the_truth
[01:41:07] odigity: guess that request is a little too difficult
[01:41:21] pontiki: !will_set_you_free_but_not_until_it_is_done_with_you
[01:41:39] helpa: You can't handle the truth!
[01:41:59] odigity: helpa, Yes, I can.
[01:42:15] rehat: if I have a form that calls an ajax request to update the form based on the user's selection, is it best to have rails send back html to place in the form or json and have the javascript generate the form on the client end
[01:44:07] pontiki: like updating select options?
[01:44:40] pontiki: if the result is replacing existing or empty html, the former is rather trivial
[01:45:52] rehat: yeah the user selects an option and then a bunch of rows should show up to update all the associated models
[01:46:59] rehat: for mass updating objects, so result from that ajax would be for a form when there is no form in the first place
[01:51:14] pontiki: yeah, i'd go with the html
[01:51:58] pontiki: unless you are making a backbone.js or similar js framework app in the client
[01:52:55] rehat: nah, so if I wanted to send html back would I call render with some view partial?
[01:53:15] pontiki: you could render the partials, then insert it with a simple jQuery function
[01:53:56] rehat: ok cool thanks
[01:54:24] pontiki: best to have a landing place defined on your page already
[01:56:55] Flashmasterson: who is familiar with hartl's updated version of the ror tutorial?
[01:57:30] jrobeson: hello spontiki
[01:57:42] sevenseacat: enough to know i wouldnt use it
[01:58:19] sevenseacat: if you have questions, someone here can help you answer them.
[01:58:22] jrobeson: good morning sevenseacat
[01:58:28] foucist: SURVEY: does your phone have arrow keys?
[01:58:35] sevenseacat: jrobeson: hola
[01:58:47] sevenseacat: my phone doesnt have any physical keys.
[01:58:58] jrobeson: mine does, but i doubt my next one will
[01:59:02] pontiki: sevenseacat: why wouldn't you use it? it is recommended *EVERYWHER*
[01:59:16] pontiki: (note that i haven't seen it in any form)
[01:59:35] sevenseacat: pontiki: because it includes integration of a lot of dumb things like spork and bootstrap
[01:59:54] pontiki: too broad and not on point. okay.
[01:59:54] sevenseacat: and thats where people get bogged down, fighting bugs in those libraries instead of learning about rails basics
[01:59:56] jrobeson: i used it to get the hang of the differences between rails and other mvc frameworks, but i didn't actually go through it
[02:00:00] jrobeson: i used it as more of a review
[02:00:11] jrobeson: err overview
[02:00:21] Flashmasterson: sevenseacat: why wouldn't you use it? i'm very new to this so i'm just curious. 'wondering why i'm not getting the same results on my terminal as hartl is
[02:00:56] jrobeson: i've also used bootstrap before so that part was no big deal to me.. i ignored the spork part also :)
[02:01:27] foucist: sevenseacat: does the older version of hartl avoid spork/bootstrap etc ?
[02:01:32] pontiki: those things should not really be part of a rails tut though
[02:01:46] sevenseacat: the version i used (rails 3.0) didnt have them, yes
[02:02:36] jrobeson: i think one should have some sort of default stylings so the app doesn't look like total crap.. and not pollute the tutorial with teaching css
[02:02:47] pontiki: hartl's tut is intended for people starting from zero, yes?
[02:02:48] jrobeson: but rails has no default styles out of the box.. so.. something has to be chosen
[02:03:13] sevenseacat: pontiki: yep. section 1 talks about things like installing ruby and using git
[02:03:46] pontiki: personally, i'm disinclined to tell people to "jumprightinthewater'sfine"
[02:04:03] pontiki: there is *much* to know about writing webapps
[02:04:11] jrobeson: pontiki, me too..
[02:04:24] pontiki: and the frikken deep end of the rails pool has sharks and whirlpools
[02:04:27] sevenseacat: yeah i dont know how people would get started nowadays if they were totally new to web dev
[02:04:46] sevenseacat: the scope of web dev is about a million times broader than it was when i started
[02:04:49] jrobeson: yeah.. when i think of all the stuff you have to worry about.. i feel like even my years of knowledge isn't enough
[02:04:50] pontiki: or totally new to programming, which i seem to see a lot?
[02:04:57] jstrong: fuck this shit
[02:04:58] thebobmarley: Whoa! Frustrated? Try listening to some Bob Marley Music: http://www.youtube.com/watch?v=Oo4OnQpwjkc
[02:04:58] helpc: YouTube | Bob Marley-Don't worry be happy | 4:50
[02:05:18] jrobeson: well i suppose the world would do better with a little bit more marley in it..
[02:05:52] tobobo: hah. that's great.
[02:06:08] godd2: Im getting a new Paperclip error. It says permission denied to my_app/public/system how do I give Paperclip permission to create directories?
[02:06:20] pontiki: waitwait -- i thought DWBH was bobby mcferrin
[02:06:21] jrobeson: you don't give paperclip permission per se..
[02:06:25] foucist: yeah it's funny how much you need to know to be a half decent rails developer.. ssh/linux, git, some fancy editor (vim, sublime,whatever), plus all the odds and ends required for a site.. nginx, gems, etc
[02:06:38] foucist: shit's deep, and getting deeper
[02:06:42] jrobeson: foucist, that stuff is the easy part!
[02:06:56] jrobeson: and it's not just being a rails developer.. it's been any sort of web developer
[02:07:26] jrobeson: moving between frameworks isn't hard once you get the concepts right
[02:07:53] jstrong: wtf why doesn't this work
[02:07:54] thebobmarley: I'm sorry your stuff doesn't work. Here's some music to calm you down. http://www.youtube.com/watch?v=-JhwxTen6yA
[02:07:54] helpc: YouTube | Bob Marley - A lalala long | 3:46
[02:07:56] godd2: jrobeson: I need to give rails file permissions?
[02:08:01] foucist: jrobeson: yeah, well in comparison to basic php web dev, rails is a fuckload more stuff to know (it seems)
[02:08:15] foucist: not that i ever bothered learning php.. skipped that shit
[02:08:17] jrobeson: foucist, basic php web dev isn't enough for php web devs even :)
[02:08:24] pontiki: php is not a web app framework
[02:08:35] jrobeson: working with symfony2 is not much different than rails .. symfony2 is actually harder..
[02:08:38] pontiki: better comparisons would be to symfony
[02:08:45] pontiki: or cakephp
[02:08:46] jrobeson: they force you to do stuff with services right away.. and DI containers
[02:09:03] jrobeson: no simple activerecord callbacks.. no code clumping
[02:09:28] foucist: pontiki: yeah that's why i said "basic php web dev" :P
[02:09:44] foucist: pontiki: i mean a lot of web develoeprs seem to start there but yeah, nowadays that doesn't cut it
[02:09:46] jrobeson: foucist, that's be the same as just using ruby itself
[02:09:52] foucist: jrobeson: i know
[02:09:56] jrobeson: like sinatra, you could write an app just like that
[02:10:04] pontiki: i'm not sure about "doesn't cut it"
[02:10:12] pontiki: i guess that depends on what that actually means
[02:10:28] pontiki: there are still tons of opportunities for php dev work
[02:10:46] jrobeson: pontiki isn't a blind hater
[02:10:48] Flashmasterson: how do i create a new directory?
[02:10:56] pontiki: no, just deaf :)
[02:11:17] pontiki: Flashmasterson: that's a really broad question
[02:11:21] jrobeson: Flashmasterson, you really need to spend some time learning shell comands before jumping so deeply into rails
[02:11:43] jrobeson: that is my one problem with the hartl tutorial.. there's only so much one can do with limited knowledge to solve their own problems
[02:11:48] sevenseacat: or even just how to use your compuer :/ creating a directory isnt anything to do with rails
[02:11:51] jrobeson: Flashmasterson, that'se the kinda question that is more suited to google
[02:12:02] pontiki: the banal answer is `mkdir dirname`
[02:12:09] jrobeson: any question where the result would show up on the first page .. please ask google first
[02:12:23] jrobeson: this place is for after you've tried google and stackoverflow if at all possible
[02:12:58] jrobeson: pontiki, people are doing great stuff with php these days.. too bad the php-internals folks are so dumb :(
[02:13:17] jrobeson: no BDFL .. no small committee.. it's a total wreck up there
[02:13:30] jrobeson: and people who are stuck in the old ways
[02:13:39] brupeb: what's the best way to handle dynamic contents that needs translations? (example: a project entry that has an english and spanish version for each one of its fields ) . I created two columns (text_en and text_es ) and created a method_missing that verifies the current locale and verifies if the corresponding method exists ( ex: title -> [ current local = en ] -> title_en ). Is there a better alternative?
[02:14:01] jrobeson: hmm.. isn't there some sort of acts_as_translatable active record behaviour ?
[02:14:07] godd2: How do I figure out what 'user' is being used when Rails is running?
[02:14:09] jrobeson: not that i know what it's called, but try that..
[02:14:13] jrobeson: try searching for that i mean
[02:14:17] godd2: so that I can give that user permissions to create files
[02:14:51] jrobeson: brupeb, i haven't used anything like that, but that's my guess.. and you'd end up with some auto generated accessors by thsi behaviour without having to do it manually
[02:15:08] jrobeson: and it would know what to do with the queries so it would always return the right r esults
[02:15:29] Flashmasterson: jrobeson: and google is also the place to learn basic shell commands? man i thought that going by a tutorial for beginners to a new world would be something for beginners to a new world. every day it's 1 step forward 4 steps back
[02:15:31] jrobeson: some of you oldies help me out here :)
[02:15:33] rehat: I am kinda confused with the difference between 'render json: @some_object' and 'respond_to do |format| format.json { render json: @some_object}'
[02:15:46] jrobeson: Flashmasterson, dude.. i spent 9 years to know as much as i know.. it's a big field
[02:15:51] jrobeson: and i still don't know enough
[02:16:03] sevenseacat: ACTION has taken about fifteen years to get this far
[02:16:19] Flashmasterson: jrobeson: can i see some of your work?
[02:16:21] jrobeson: well if i count al my linux stuff.. and learning linux also
[02:16:30] pontiki: brupeb: that isn't a bad way of doing it
[02:16:34] jrobeson: it' d becloser to that
[02:16:46] jrobeson: i tink i started learning linux in 1999
[02:16:47] sevenseacat: i borrowed my first web dev book from the library just over 15 years ago
[02:17:10] sevenseacat: i do wish i still remembered what that book was called
[02:17:13] jrobeson: Flashmasterson, if you wanna see php code i guess
[02:17:33] jrobeson: i have a sintra app still in there that i haven't touched in 4 years :)
[02:17:34] pontiki: i don't even recall when i wrote my first perl/cgi script
[02:17:42] Flashmasterson: jrobeson: i guess what i'm asking for is an application
[02:18:02] jrobeson: i on't have a complete rails application published as of this moment
[02:18:04] Flashmasterson: jrobeson: i'm trying to build a kind of complicated website, unfortunately
[02:18:06] kazuuu: i started coding in 1995.. with PCBoard
[02:18:27] pontiki: Flashmasterson: check out http://railsapps.github.io/
[02:18:38] sevenseacat: Flashmasterson: want a complete rails app thats currently in production? :)
[02:18:59] Flashmasterson: sevenseacat: yes thanks, i'd like to see something tangible for a chance
[02:19:05] Flashmasterson: sevenseacat: *change
[02:19:16] godd2: jrobeson: Ive got linux to list the users which exist, but how do I know which one to give permission to create files for my rails app for what paperclip is trying to do?
[02:19:20] sevenseacat: https://github.com/Useful-Inc/big-help-mob-webapp is something i built, and the URL for the complete app is right in the description
[02:19:21] helpc: GitHub | Useful-Inc/big-help-mob-webapp (1??? 0??? 0???) : This is the Big Help Mob Application, build to connect volunteers and non-profit organisations.
[02:19:28] sevenseacat: thanks helpc.
[02:19:30] jrobeson: godd2, the same one who owns your logs
[02:19:35] brupeb: jrobeson: txz! When I first searched for that I didn't find the acts_as_translatable gem. It seems to be more flexible than the way I did it.
[02:19:56] jrobeson: brupeb, honestly i just made up the name.. i just figured something like that existed
[02:20:31] Radar: +q helpc!*@*
[02:21:06] sevenseacat: yeah i was surprised when i saw helpc had made its way here
[02:21:18] pontiki: i liked it.. :/
[02:21:31] jrobeson: who owned helpc ?
[02:21:34] danhunter: so i use model.send(:include, concern) to attach a user association to a class in a gem.. only, for some reason, despite it initially recognizing the user, at some point it seems to lose it.. and throws a 'no method error'
[02:21:48] danhunter: anyone know a possible reason why?
[02:22:08] godd2: jrobeson: it looks like root owns the apache error_log. If thats the case, why is there a permission problem?
[02:22:14] ftj: Anyone here use Knockout with Rails? Right now, I'm manually building my initial viewmodel array with erb and an each loop (like so: new Annotation(<%= "#{a.x_pos}, #{a.y_pos}, #{a.id}, 0" %>),), but I'm not sure that it's the best way to go.
[02:22:38] jrobeson: godd2, not those logs.. i meant the rails logs
[02:22:45] Flashmasterson: sevenseacat: how long did it take you to get this far?
[02:22:57] brupeb: jrobeson: haha.. there's a gem named exactly 'acts_as_translatable' . The table structure used is a bit more complex than my solution, maybe for my project it would be a little overkill
[02:23:02] Flashmasterson: sevenseacat: in big help mob
[02:24:05] godd2: jrobeson: root owns development.log in my_app/log/
[02:24:12] sevenseacat: Flashmasterson: i built that in about three months.
[02:24:14] jrobeson: oh.. and who starts your rails app? root?
[02:24:15] godd2: is that thr wrong file too?
[02:24:21] jrobeson: that's likely a bad idea
[02:24:30] godd2: jrobeson: I don't know how to find the information you're asking for
[02:24:37] jrobeson: i'm not sure what the convention is , but i'd go with creating a new user to run your rails app
[02:24:49] brupeb: pontiki: the one thing that bothered me was that I was duplicating every translatable column in the db, even if the record didn't have translation. But as in my project most of the items ( if not all ) will be translated, i think it is not a problem at all
[02:24:51] godd2: I submit that I shouldn't have root running it
[02:24:51] Flashmasterson: sevenseacat: it looks great. clean, inviting
[02:25:04] jrobeson: and start the app with that user.. and then change the owner of the public/system directory to also be that user
[02:25:07] godd2: but even if that's the case, why am I getting a file creation permission error?
[02:25:09] jrobeson: so it can write to it
[02:25:26] jrobeson: unless the files actually get uploaded some oher way.. i've never actually used paperclip
[02:25:29] godd2: shouldn't rot be able to create any file it pleases?
[02:25:31] jrobeson: that was just generic permission sadvice
[02:25:42] jrobeson: perhaps you're not actally running the pp in production as root
[02:25:49] jrobeson: if it's like via passenger ?
[02:25:55] jrobeson: in that case.. i have no idea
[02:26:01] Flashmasterson: sevenseacat: this brings hope to see this kind of tangible progress, what aspects of the web app are in the works right now?
[02:26:04] jrobeson: i'm sure hese otheres have more experience with that than i do
[02:26:16] godd2: alright, thank you for the guidance.
[02:26:29] godd2: and yea Im using passenger
[02:27:06] sevenseacat: Flashmasterson: the focus at the moment is expanding the league section to be more community-driven
[02:27:40] jrobeson: godd2, try doing a more direct google search about passenger and paperchip permissions
[02:27:43] jrobeson: err paperclip :)
[02:28:03] jrobeson: i'm sure i'll try out running passenger one of these days.. but that day is not in fact this day
[02:28:58] Flashmasterson: sevenseacat: so less to do with coding and aesthetic, more to do with the web apps ideology?
[02:29:10] kazuuu: Hey all!.. I have an rails app that doesn't have any test. And now i want to start doing tests.. TDD.. Should I start over a new app and rewrite everything with tests or would be easier i start writing tests for the code i've already written? What would you do?
[02:29:45] danhunter: kazuuu: destroy all screencasts did an interesting series of testing an untested app
[02:29:54] godd2: jrobeson: chmod 777 worked, and I know that's "bad", but it did work
[02:30:06] diegoviola: should i use raw() or #html_safe to unescape HTML from a yaml file? I'm working on locales atm
[02:30:06] kazuuu: danhunter: i'm doing that. ehhehe
[02:30:09] jrobeson: godd2, and who owns it?
[02:30:13] diegoviola: what's the difference?
[02:30:15] jrobeson: i mean who owns the files it made
[02:30:20] godd2: ls -la says root does
[02:30:31] jrobeson: perhaps your passenger setup is not correctly done then
[02:30:47] jrobeson: that just seems odd to me.. but once again.. i've never used it
[02:30:48] mbd2: kazuuu: i'd write tests for what you've already written. you can comment out your code then write a test. uncomment code to verify that it passes.
[02:30:51] jrobeson: any other passenger users here?
[02:31:15] godd2: jrobeson: Im still learning rails and linux and all that jazz, and its just my personal VPS, so I can reinstall if anything goes awry
[02:31:23] kazuuu: mbd2: nice idea... thx..
[02:31:44] jrobeson: godd2, so what you're saying is you want me to try to hack your system right now? :)
[02:31:59] jrobeson: and uhmm. r00t ur b0xen
[02:32:03] godd2: well it's not the gibson
[02:32:24] jrobeson: i meant b0x3n ..
[02:34:49] godd2: jrobeson: security through obscurity. I don't think anyone here knows the IP of my b0x0r
[02:39:43] jrobeson: godd2, that's pretty hax0riffic
[02:40:17] godd2: to teh m4x0riffic
[02:41:06] Flashmasterson: does anyone else have a web app that i can look through and observe the coding of?
[02:43:18] Jeena: I have a method in a controller where I'd like to use a different layout so I did layout false, only: [:foo] which worked nice but when I added a stylesheet_link_tag "foo" it doesn't get precompiled in production and thus can't be found. I can't find out how to handle stuff like this.
[02:43:27] Jeena: I have the same problem with the JavaScript
[02:43:53] sevenseacat: right, by default the only stylesheet that gets precompiled is application.css
[02:44:15] sevenseacat: see http://guides.rubyonrails.org/asset_pipeline.html#precompiling-assets for more info
[02:45:02] stepfresh: hey all, i use model.send(:include, concern) to attach a user association to a class in a gem.. only, for some reason, despite it initially recognizing the user, at some point it seems to lose it.. and throws a 'no method error'
[02:45:17] stepfresh: anyone have any idea why?
[02:45:43] sevenseacat: without any code? no
[02:45:47] sevenseacat: or any anything
[02:46:08] Flashmasterson: sevenseacat: that's ahead of my understanding right now but i'm bookmarking it. 'glad it has tons of other more elementary rails guides
[02:47:18] stepfresh: sevenseacat: good point, https://gist.github.com/danhunter/6709204
[02:48:00] sevenseacat: and what goes wrong?
[02:48:25] stepfresh: it throws a 'no method error' when calling media.user
[02:48:27] nettoweb: guys, I'm using rails 4 but sometimes the assets dont compile correctly, seems that are just some of js files??? then I reload the page and it works
[02:49:25] stepfresh: it initially works, but seemingly randomly throws the error, until a restart my local server again
[02:49:50] sevenseacat: may not be related, but why not just `include MediaConcern` in your Media model
[02:50:04] sevenseacat: also, models in the plural :/
[02:50:48] stepfresh: the media class is part of a gem
[02:51:03] stepfresh: i was trying to avoid editing the gem to add the include
[02:51:18] sevenseacat: why do you have to edit the gem?
[02:51:47] stepfresh: the media model is part of the gem
[02:52:07] stepfresh: extending the class didn't seem to work
[02:54:25] stepfresh: .. clearly i misunderstood something there
[03:00:33] n_blownapart: hi with this simple equation "a" * 5 on line 2, how could 6 be the minimum allowed password length; why couldn't this test pass with 3 or 4 characters? thanks: http://pastie.org/8356154
[03:01:21] sevenseacat: n_blownapart: going to take a wild guess and assume you're using devise, which has a minimum length restriction on password
[03:01:47] n_blownapart: sevenseacat: sorry is that a gem?
[03:01:59] sevenseacat: ok, so guess was wrong
[03:02:04] sevenseacat: whats the problem you're having
[03:02:17] sevenseacat: four lines of test code does not a problem explain
[03:03:24] n_blownapart: sevenseacat: its just the logic. this test won't allow a password less than six, but the syntax looks like as long as its not five characters it will pass.
[03:03:48] sevenseacat: the test will pass, yes, because the user will be invalid.
[03:04:04] s2013: so i start my first ever rails job tomorrow
[03:04:42] sevenseacat: s2013: good luck.
[03:04:48] s2013: i need it. thanks
[03:05:07] s2013: biggest issue i think is that the database is not rails specific
[03:05:52] s2013: most of their backend is python and C and so i dont think the database is following rails convention and stuff so its going to be a pain to figure everything out but it should be fine
[03:06:29] jameswatling: s2013 that sucks, not a problem though just not as good of a day to enjoy the power of ruby
[03:08:48] s2013: yeah. but hopefully it will be a good learning lesson for me
[03:08:52] n_blownapart: sevenseacat: so is it implicit to Rails somehow that the passwords needs to be longer than "a" * 5 ?
[03:08:59] sevenseacat: n_blownapart: no.
[03:09:21] sevenseacat: what have you written to put such a restriction in place?
[03:10:01] n_blownapart: nothing, that's what I mean . for example if the password is entered with 4 characters it seems to me it would be valid. sevenseacat
[03:10:17] sevenseacat: code for your user model?
[03:10:37] n_blownapart: sevenseacat: one sec.
[03:11:55] s2013: so i need some advice. one of my first task is to make an autocomplete search with all the customers name. im thinking of instead of querying the database each time, create a rake task that creates a json file with the customers name and update it once a day. it will put less strain on the database.
[03:11:59] s2013: is that a good idea?
[03:12:06] n_blownapart: here's the project sevenseacat https://github.com/varreli/wwsleep_clone thanks
[03:12:12] sevenseacat: s2013: uh... no
[03:12:22] s2013: so what would you suggest?
[03:12:30] sevenseacat: querying the database
[03:12:33] s2013: every time?
[03:12:58] s2013: customer list wont change often. it wil be once everyday at most but most likely couple of times a week
[03:13:06] sevenseacat: n_blownapart: so whats the exact error?
[03:13:58] sevenseacat: s2013: so you'd trade a database, which is built for searching and filtering, for a flat file to be completely loaded into memory and searched with ruby
[03:14:04] n_blownapart: no error. I just don't see how "a" * 5 can preclude using a password say 3 or 4 characters long, that's all. sevenseacat
[03:14:19] sevenseacat: n_blownapart: uh, it doesnt
[03:14:38] s2013: i was just thinking that it might put strain on the db
[03:14:58] s2013: well everytime
[03:15:00] sevenseacat: do you know how many you do when loading a single page?
[03:15:12] sevenseacat: (hint: its likely many more than one(
[03:15:47] s2013: not strain. iguess i meant there might be some lag. so if im typing Coca coca cola should popup asap but i thought there might be a lag if its querying a db everytime you are changing the company name
[03:16:54] sevenseacat: if you honestly think that, you should do some benchmarking and see which is quicker
[03:17:50] n_blownapart: sevenseacat: sorry one of those nights. here is the validation : validates :password, length: { minimum: 6 } -- So why wouldn't the test be "a" > 5 ?
[03:18:13] sevenseacat: right, that wasnt in the code you originally showed me
[03:18:21] sevenseacat: what does the description of the test say?
[03:18:37] jrobeson: s2013, if you want it fast.. use caching
[03:18:43] jrobeson: alternatively.. use redis
[03:19:40] rhizome: s2013: it's not a strain
[03:19:55] s2013: oh ok gotcha. thanks. ill try with sql.
[03:19:59] Senjai: Hello all
[03:21:11] rhizome: Physics tells us there will always be lag
[03:21:45] s2013: object in motion stays in motion
[03:22:03] rhizome: the speed of light
[03:22:17] ggolin: regarding migrations; i have a migration task that modified 10k redmine issues. after the 2k mark it gets very-very slow. what can i do to speed things up?
[03:22:30] sevenseacat: ggolin: and the code for this migration is?
[03:22:35] ggolin: the migration is in the redmine_backlogs plugin
[03:22:44] n_blownapart: "with a password that's too short" ... so "a" * 5 in the test just means any thing 5 or less is invalid? sevenseacat
[03:22:46] ggolin: sevenseacat, one moment, i will paste the link
[03:23:19] sevenseacat: n_blownapart: im not sure what you're not understanding here - you have a validation you want to test, so you test that it passes with valid data, and fails with invalid data
[03:24:11] n_blownapart: my question is that 4 is always invalid. so is 5 arbitrary as an invalid length?
[03:24:14] n_blownapart: sevenseacat: ^
[03:24:15] ggolin: https://github.com/backlogs/redmine_backlogs/tree/v1.0.5 this is the code in question. the task itself actually calls a method in this model: https://github.com/backlogs/redmine_backlogs/blob/v1.0.5/app/models/rb_issue_history.rb
[03:24:17] sevenseacat: your validation is length 6, so length 5 is obviously invalid data
[03:24:46] sevenseacat: you could have picked 5 or 4 or 3 or 2 or 1, bot 4/3/2/1 don't test that you specifically wrote 6 in the validation
[03:24:52] ggolin: we spent several hours today trying to speed things up with includes and what not.
[03:24:54] n_blownapart: so you could have "a" * 3 and that represents the same invalidation. sevenseacat
[03:25:12] sevenseacat: ggolin: and the code for this migration is?
[03:25:21] ggolin: sevenseacat, i pasted the urls
[03:25:39] sevenseacat: ggolin: and you didnt answer the question
[03:25:55] sevenseacat: that repo has 48 migrations
[03:26:02] ggolin: redmine:plugin:migrate
[03:26:59] mbd2: Anyone know how to debug rake assets:precompile errors? Specifically: "Caught Encoding::CompatibilityError..."
[03:28:28] ggolin: ./db/migrate/038_rb_add_history.rb
[03:28:35] ggolin: sevenseacat, ./db/migrate/038_rb_add_history.rb
[03:29:46] Duckily: our password recovery stopped working and we're using devise. can someone explain why the route generated: https://github.com/plataformatec/devise/blob/b1754074e5a74c2437cf7119730cbc35aeb9d0b8/lib/devise/rails/routes.rb#L52 is different than the route used in the view: https://github.com/plataformatec/devise/blob/master/app/views/devise/mailer/reset_password_instructions.html.erb#L5?
[03:30:12] sevenseacat: ggolin: looks like that RbIssueHistory.rebuild method should be a) finding in batched and b) eager loading
[03:30:26] ggolin: sevenseacat, and we implemented batches
[03:30:40] ggolin: as well as includes
[03:30:45] Duckily: meh i should've shortened those links
[03:30:58] ggolin: (this is not my plugin, im just trying to upgrade our instance)
[03:30:59] sevenseacat: ggolin: so when i asked you to show me the code, you were showing me not the code
[03:31:14] sevenseacat: ggolin: why are you wasting my time
[03:31:23] ggolin: ACTION rolls eyes
[03:31:42] Duckily: i won't waste your time!
[03:31:50] sevenseacat: thanks Duckily :)
[03:32:00] n_blownapart: sevenseacat: I never waste his time
[03:32:37] Duckily: is it because routes in namespaces views automatically have the user appended to them?
[03:32:47] sevenseacat: i set up devise in an app just yesterday, and i know it works, so this interests me
[03:33:08] Duckily: not user, but whatever the namespace is..
[03:36:47] sevenseacat: trying to figure out whats going on
[03:37:57] helpa: ggolin: Do not PM members of the channel without first asking if that is OK.
[03:37:57] sevenseacat: ggolin: !rule12
[03:38:21] ggolin: ACTION snorts
[03:38:39] ggolin: passive aggressive central tonight
[03:39:03] sevenseacat: me telling you not to waste my time isnt passive aggressive
[03:39:07] Duckily: sevenseacat: thanks, thats my best guess right now
[03:40:17] sevenseacat: Duckily: ah hah! http://rubydoc.info/github/plataformatec/devise/master/Devise/Controllers/UrlHelpers
[03:41:27] ggolin: so bottom line is that using batches does not speed things up. this model runs a recursive on_save.
[03:41:32] ggolin: wondering what else can be done
[03:41:56] Duckily: sevenseacat: thanks!
[03:42:15] Duckily: i was looking at rails instead of devise :-(
[03:44:19] sevenseacat: so if you have devise for multiple models, you can just use the same edit_password_url and it will work out which route to use by the object you give it.... was just trying to work out why devise would be doing that
[03:52:04] Duckily: sevenseacat: exactly or if you just have one model, but its not named user
[03:52:11] sevenseacat: ACTION nodnods
[03:54:09] Radar: https://github.com/rails/rails/issues/12367
[03:54:52] quazimodo: WHY ARE YOU MARRIED
[03:55:27] quazimodo: WHY ARENT WE MARRIED
[03:55:32] sevenseacat: ACTION does have a ring on it though
[03:55:46] quazimodo: god i'm so bored
[03:55:52] quazimodo: i think i'll go learn some clojure
[03:55:57] sevenseacat: get back to work!
[03:56:25] Duckily: sevenseacat: we decided to use the forgot subdomain to handle password recovery for aesthetic reasons and its more complicated than it seems
[03:56:46] sevenseacat: mmm ive heard subdomains arent fun in rails
[03:57:23] Duckily: i wish rather than constraints there was a way to tie a subdomain to a route so that when you used say, edit_password_url, it automatically appended the subdomain
[03:58:36] sevenseacat: boo, why cant i write `@current_user.should_not exist` in a test
[03:58:44] sevenseacat: ACTION patches
[03:58:48] Radar: sevenseacat: should_not be_exist
[03:59:00] Radar: expect(@current_user.exist?).to be_false
[03:59:14] sevenseacat: no, a User instance doesnt respond to exist? or exists?
[03:59:30] sevenseacat: it would have to be User.exists?(@current_user).should be_fakse
[03:59:40] optobear: should_not be_present, nah?
[04:01:11] sevenseacat: https://gist.github.com/karpah/6709735 fixedzor
[04:03:11] sevenseacat: wow, adding js: true to a single rspec feature takes it from 0.85sec to 3.8sec
[04:04:18] chendo: booting up js engines man
[04:04:21] rehat: how do I get a controller action to render a partial? I'm trying to use an ajax request for a dynamic part of my huge form
[04:04:34] sevenseacat: rehat: same way you would in a view
[04:05:26] rehat: sevenseacat: and that will return html back to the ajax request
[04:05:34] jrobeson: stupid password restrictions.. :( site was funny about it too .. passwords must be 6-12 characters in length. it's for your own good
[04:06:06] jrobeson: yeah a top length is 12 is for my own good.. luckily i won't care if people hack that account
[04:07:16] optimus55_: Question: what's the common way (architecture wise) to build large scalable applications these days? I'm starting a new rails app and I don't think future wise it makes sense to just have one giant app with models/controllers/etc. I'm thinking to start one rails app to serve as the API then query that from another rails/other language app that serves as the 'front-end'. Is this usual?
[04:07:39] sevenseacat: im not sure why you woulddo that
[04:07:56] optimus55_: Would anyone with experience in larger apps be able to answer, what's the best way to set myself up for success down the road and not have to re-write a lot
[04:08:00] sevenseacat: granted i havent built any 'large scalable applications' but splitting it up doesnt make sense to me
[04:08:06] sevenseacat: just means more overhead
[04:08:22] optimus55_: so you'd say put it all as one giant app?
[04:08:24] jrobeson: i think splitting it is a good idea, but not prematurely
[04:08:33] sevenseacat: define 'giant'
[04:08:51] jrobeson: it you look at spree for example.. it's spllit into 5 different installable gems .. one for api , one for frontend, and one for backend
[04:09:06] optimus55_: well in my understanding one rails app will run on one server so how am i supposed to split it up to run on multiple servers eventually?
[04:09:10] jrobeson: oh.. and the core. that they all share
[04:09:16] sevenseacat: optimus55_: load balancing?
[04:09:33] jrobeson: well just make sure they that the different parts aren't too coupled and you can split them up as needed later
[04:10:08] jrobeson: it's more of tradeoff, do you want to force yourself to consider how your parts will work seperately and making working with the parts in the now more annoying..
[04:10:09] sevenseacat: spree is a bit different because its a library, its parts need to be somewhat interchangeable
[04:10:12] optimus55_: sevenseacat: sure that sounds like the obvious way but is it? i've read a lot of stuff like how twitter made their architecture into a series of services essentually
[04:10:27] optimus55_: what's spree btw?
[04:10:32] sevenseacat: optimus55_: you're not building twitter
[04:10:33] optimus55_: i'll google it actually..
[04:10:54] Radar: optimus55_: http://github.com/spree/spree
[04:11:33] jrobeson: optimus55_, i would keep that consideration of splitting it in your mind, but not actually do it until you need to.. it sounds like you're prematurely optimizing
[04:12:26] optimus55_: sevenseacat: well that's the point, they're making all these changes now because the monolithic model didn't work. Let's suppose I build an application that gets rougly 5000 hits a month, definitely not twitter size. Should a single instance with some load balancers be enough?
[04:12:47] jrobeson: you don't even need a loadbalancer for that
[04:12:47] sevenseacat: you dont even need a LB for that
[04:13:08] sevenseacat: any rails app can handle 5000 hits a month with one hand tied behind its back
[04:13:50] sevenseacat: checking what kind of hits our main app gets
[04:13:56] jrobeson: 5000 hits a day without much effort.. just perhaps not 5000 hits a minute..
[04:13:56] Duckily: well loadbalancers serve the purpose of being a failsafe mechanism too
[04:14:13] Duckily: if you're running on one machine and it goes down, well...
[04:14:47] jrobeson: well is the cost of the site being down for 10 minutes at potentially some random point in the future justify spending extra time or money in the moment
[04:14:50] jrobeson: likely not for most
[04:15:12] optimus55_: well that's the thing. let's say for redundancy sake i want to have to servers serving my app, one in us and one in europe. If they're both the same code base and how is that supposed to work?
[04:15:22] optimus55_: what if i need to add a 3rd machine in asia somewhere?
[04:15:41] optimus55_: do i point to the same code but put databases at different locations?
[04:16:01] Duckily: jrobeson: you're lucky if it's only 10 minutes
[04:16:08] optimus55_: can rails do that (sorry if i'm asking a lot of questions, i'm still new to rails but experienced in other languages)
[04:16:27] sevenseacat: just heard that we get about 500k hits/month, and thats on an app that we have a load balancer in front of
[04:16:31] Duckily: jrobeson: we're hosting on rackspace and had a 40 min outage the other day??? it sucked??? majorly
[04:17:15] optimus55_: sevenseacat: nice, and that's a single app instance?
[04:17:31] Duckily: sophomorical: they only let us know 25 minutes into it...
[04:17:34] sevenseacat: web and api for mobile app
[04:17:49] Duckily: sevenseacat: what do you mean single app instance?
[04:18:00] sevenseacat: Duckily: not split out into multiple rails apps
[04:18:13] sevenseacat: eg. one for web, one for api, etc.
[04:18:16] Duckily: sevenseacat: ah, but using multiple instances of the same app i hope
[04:18:42] sevenseacat: i think it has several boxes on AWS
[04:18:54] sevenseacat: (its not my app, i dont know a lot of details about it)
[04:19:39] jrobeson: Duckily, there's no blanket statement you can make for that. if you're spending X extra dollars per month for the LB, and hosting other copies of the app costs more than the potential lost sales during that 40 minutes.. it's not worth it
[04:20:06] jrobeson: even gmail goes down sometimes .. and they spend millions
[04:20:07] Duckily: jrobeson: it depends on the site you're hosting
[04:20:16] optimus55_: that's a good way to judge the cost
[04:20:27] Duckily: jrobeson: i assure you google spares no expense at making user their site doesn't go down
[04:20:33] jrobeson: and yet it does
[04:20:43] jrobeson: twice this year
[04:20:55] Duckily: jrobeson: we're discussing a failsafe choice
[04:21:03] sophomorical: Duckily: is that normal for rackspace?
[04:21:05] jrobeson: and this week.. mails were delayed for long periods of time
[04:21:15] jrobeson: there is no true failsafe..
[04:21:20] Duckily: sophomorical: first time i think we experience faulty hardware
[04:21:21] pontiki: same can be said for AWS
[04:21:29] optimus55_: okay so let's say I want to run two instances of the same app, how do i get them to play nice together? some kind of proxy or LB routes requests to the instance automatically?
[04:21:31] pontiki: yet AWS outages are just a bit too common
[04:21:36] Duckily: pontiki: ^
[04:21:47] dopie: Hey I read over http://guides.rubyonrails.org/routing.html , and I dont see where it shows what im trying to do
[04:21:49] optimus55_: and they talk to duplicated databases?
[04:22:04] dopie: I want www.foo.com/categories/bar
[04:22:09] Duckily: jrobeson: i think we're missing each other here
[04:22:10] dopie: to be www.foo.com/bar
[04:22:10] pontiki: and then you discover half your DA resources are on the same region
[04:22:48] jrobeson: Duckily, i'm not missing you at all. it does depend on the site.. that is what i said.. if the costs of the extra stuff isn't worth what you lose, don't spend the money
[04:22:51] Duckily: optimus55_: generally you want to have a machine running a central database that the web instances can connect to
[04:23:10] Duckily: jrobeson: unless you're amazon, that is a very hard metric to calculate
[04:23:30] Duckily: there's loss of trust with existing customers if you have a saas
[04:23:31] jrobeson: i'd say it is.. most people know how many sales they make a week on an ecommerce site.. and such
[04:24:00] pontiki: and so a SaaS is not an E-Com site
[04:24:00] jrobeson: and google analytics at least gives a good idea of conversion ratios even for non direct sales sites
[04:24:01] Duckily: jrobeson: my reason for pointing out amazon is that they are an ecommerce site
[04:24:07] optimus55_: Duckiy: ahh okay so let's say 1 db machine, 2 app instances and a loadbalancer that routes the requests to each app, but they both talk to the same db? - is that a fair assumption of a modern-ish paradigm for a decent web app?
[04:24:08] pontiki: some things are more difficult to calculate
[04:24:17] pontiki: and the intagibles are different
[04:24:48] Duckily: optimus55_: yes, replicating db instances is much more tricky, you can't just spin up multiple databases
[04:24:55] pontiki: optimus55_: that was the setup basically on the last big one i worked on
[04:24:58] sevenseacat: dopie: look into setting the path, or just writing a custom route eg. get :foo => categories#show
[04:25:26] jrobeson: optimus55_, it really doesn't sound like you need something that complex.
[04:25:29] sevenseacat: sharding DBs is something i stay far far away from
[04:25:37] Duckily: optimus55_: from that setup you can also add db replication though. you also generally want worker instance as well
[04:25:49] optimus55_: Duckily, pontiki: awesome thanks that really helps
[04:25:59] Duckily: jrobeson: +1
[04:26:12] pontiki: but the one before that was 20 db servers, replicating Sybases, an aggregating Oracle cluster, 15 web servers, and a whole chunck of machines off on another datacenter running background processes
[04:26:23] Duckily: optimus55_: without hearing your use case, i'm going to guess you're overoptimizing
[04:26:24] optimus55_: yeah i'm planning out a new app and want to set it up right from the get go. It's a lot easier to change things now rather than in the future with live instances running
[04:26:33] pontiki: processing over 1M clicks/day
[04:26:37] Duckily: pontiki: :-o
[04:26:39] sevenseacat: its also a lot harder to know what you need, now
[04:26:54] optimus55_: well i'm not going to get the LB and second instance yet, but i'm just planning ahead and keeping it mind
[04:26:55] jrobeson: yep.. if you code your app nicely.. it'll be much easier
[04:27:00] jrobeson: focus on the rails coding and keeping it clean
[04:27:07] jrobeson: then you can split stuff out and do whatever
[04:27:16] dopie: get "/:id" => "categories#show"
[04:27:20] Duckily: optimus55_: everyone is giving you good advice
[04:27:28] optimus55_: for instance, i want to offer up an api for my data but i'm not sure if it should come from the same instance or a separate one, that's why i'm asking all these questions
[04:27:33] pontiki: devops planning and provisioning is not too early to start though. designing the deployment production environment is important as well
[04:28:03] Duckily: optimus55_: api can just be a web instance, no reason to make separate apps regardless of scale
[04:28:07] pontiki: optimus55_: is this a team effort?
[04:28:08] jrobeson: optimus55_, well it can come from the same instance initially, and then you can just proxy it to somewhere else
[04:28:13] dopie: No route matches [GET] "/1"
[04:28:43] Duckily: optimus55_: once you know what you're doing copying over the database to another instance is fairly easy
[04:28:57] optimus55_: okay great i'll keep it on the same web instance.
[04:28:58] jrobeson: especially if your api was on a subdomain, that atm just points to the same as your current app, then when you're ready.. copy the app to another instance, and then handle it there
[04:29:21] Duckily: pontiki: did you set that up?
[04:29:35] pontiki: Duckily: which? the earlier one? NOWAI
[04:29:37] optimus55_: pontiki: it's not for now, only me.
[04:29:57] sevenseacat: definitely preoptimization
[04:29:59] jrobeson: that setup is certainly beyond me :)
[04:30:08] pontiki: optimus55_: these are all interesting questions, but until you actually have an MVP, probably best left to ponder over beers
[04:30:12] Duckily: pontiki: not too early if you're building an adnetwork, but if you're building twitter...
[04:30:23] pontiki: crank up the prototypes and the first MVP on heroku or sommat
[04:30:24] jrobeson: build a twitter!
[04:30:26] pontiki: see what sticks
[04:30:32] sevenseacat: +1 to pontiki
[04:30:32] rehat: is there a way to use simple_form to build form partials? so it doesn't have the <form> tag but just the form components
[04:30:43] dopie: sevenseacat, rofl I had a different app opened for the routes
[04:30:43] Duckily: i will argue one exception
[04:30:47] dopie: i had that get command
[04:30:50] jrobeson: not forms_for ?
[04:30:54] jrobeson: fields_for *
[04:30:57] dopie: sevenseacat, Thank you
[04:31:05] sevenseacat: dopie: no probs :)
[04:31:18] jrobeson: i've tnever tried using fields_for outside of a form_for
[04:31:21] rehat: sevenseacat: so just create them manually? Is there a rails helper to create just form elements
[04:31:29] optimus55_: haha i wont build a twitter because twitter's already built :P
[04:31:31] Duckily: if there's massive processing involved that only needs to be handled during certain times. spooling up multiple instance can be necessary to cut costs
[04:31:40] optimus55_: but defnitely great advice, thanks for all the feedback guys
[04:31:42] jrobeson: rehat, yes it's all in the docs .. there's a guide for it
[04:31:45] sevenseacat: rehat: i dont know what you're trying to do so i will not offer any advice
[04:31:57] pontiki: optimus55_: no worries! this is the sort of thing that happens to all of us
[04:32:02] Duckily: thats what aws was built for initially
[04:32:10] pontiki: all the neat cool ideas, new things to think about, and so on
[04:32:14] pontiki: it's like NRE :)
[04:32:17] jrobeson: stupid cool ideas :(
[04:32:36] pontiki: "New App Energy" :>
[04:32:46] jrobeson: stop making me think pontiki :(
[04:32:52] Duckily: the rackspace gem is kind of pos
[04:32:55] pontiki: don't make me cry
[04:32:59] pontiki: i want you to think
[04:33:04] pontiki: it's the best thing in the world
[04:33:06] jrobeson: i doubt you cry so easily :)
[04:33:11] pontiki: actually, i do
[04:33:25] jrobeson: now.. if we were buds IRL.. perhaps
[04:33:32] jrobeson: do people ever say IRL anymore?
[04:33:41] pontiki: no, they just use the initialzzz
[04:34:01] pontiki: and ppl don't laugh, they just say "lol"
[04:34:12] sevenseacat: i have heard people say 'eye are ell' IRL
[04:34:21] pontiki: that's what i mean
[04:34:24] jrobeson: people online write lawl now
[04:34:36] pontiki: those aren't people
[04:34:39] pontiki: those are trolls
[04:34:45] pontiki: you can tell because of teh accent
[04:34:45] jrobeson: my friend joe does.. :)
[04:34:46] sevenseacat: lawl is definitelly trolly
[04:34:54] sevenseacat: anyway, lunchtime
[04:35:01] pontiki: nomnomnom?
[04:35:29] pontiki: everything in my real life is so frelling serious, like dire
[04:35:49] jrobeson: do you need a hug pontiki ?
[04:35:50] pontiki: aging parents
[04:36:00] pontiki: like nobody's business, jr
[04:36:05] jrobeson: ACTION hugs pontiki 
[04:36:09] pontiki: ACTION hugs back
[04:37:26] jrobeson: pontiki, any good news?
[04:37:42] pontiki: my daughter has applied for graduation for her masters
[04:37:50] pontiki: best news i've had in a while
[04:38:42] jrobeson: i'm definitely worried about when my parents get older. atm 64/54
[04:38:47] pontiki: my other daughter just promolgated these upon the world: http://cupcakeeprincess.blogspot.com/2013/09/salted-carmel-apple-cider-cupcakes.html
[04:39:09] jrobeson: your daugher is a cupcake princess?
[04:40:27] jrobeson: i mean is that her blog :)
[04:40:43] jrobeson: they look yums to me
[04:40:52] pontiki: her hubby is so lucky
[04:41:04] pontiki: i must drool from afar
[04:41:12] godd2: anyone know a good guide for how to create a new user on linux which can run my rails app more safely?
[04:41:27] jrobeson: They would be great on their own, but add in the creamy salted carmel filling and they rocket onto a whole new level of yum!
[04:41:30] pontiki: "Linux in a Nutshell"
[04:42:02] pontiki: jr: inorite?
[04:42:36] jrobeson: a whole new level of evil is more like it :)
[04:42:38] pontiki: this summer, i was visiting back in the bay area, we made these awesome graham-marshmallow-nuttella cupcakes
[04:42:42] pontiki: i was amazed
[04:43:04] pontiki: i can't bake worth crap
[04:43:07] pontiki: she's awesome
[04:43:28] jrobeson: you're a code baker .. not a food baker
[04:43:40] pontiki: my kitchen skills are quite good
[04:43:46] pontiki: just not in the baking arena
[04:44:31] dopie: how do i write an each do with 2 instances @categories and @subcategories since they are nested
[04:44:33] pontiki: but cooking up ratatouille is a lot more slight of hand and wrist than being exact
[04:44:55] jrobeson: so you're an artsy cook? :)
[04:45:18] jrobeson: i'm more of into the exacts
[04:45:21] pontiki: i would say "dramatic" :>
[04:45:30] jrobeson: how does one cook dramatically?
[04:45:42] pontiki: with flair and ??lan
[04:45:55] jrobeson: well you certainly have a flair for words :(
[04:46:12] godd2: dopie are the subcategories available by @categories.subcategories or...?
[04:46:13] jrobeson: no.. it's cool :)
[04:46:22] dopie: godd2, yes
[04:46:46] godd2: or does each category have its subcategories separately?
[04:46:49] jrobeson: pontiki, ??lan is actually part of an album title that i never looked up
[04:47:02] pontiki: if @categories is a collection, and subcategories is a belongs_to with Category, you just need to nest the each loops, no?
[04:47:21] dopie: godd2, first one
[04:47:24] godd2: you could do this: https://gist.github.com/anonymous/6709959
[04:47:46] jrobeson: ??lan vital is the name of the album
[04:48:31] jrobeson: sadly it was their last album :(
[04:49:19] godd2: this is a little more concrete of an example: https://gist.github.com/anonymous/6709973
[04:49:47] godd2: presuming album has_many photos and photo belongs_to album
[04:51:55] godd2: dopie: This can help with the concept of iteration in Ruby: http://www.codecademy.com/courses/ruby-beginner-en-F3loB/2/1
[04:52:10] godd2: and it has links to previous concepts if you aren't comfortable enough with the current lesson
[04:53:26] dopie: thank yeh
[04:58:41] dopie: godd2, i replied
[04:59:24] godd2: oh, youre welcome
[04:59:38] dopie: nono checkout your gist
[04:59:44] dopie: https://gist.github.com/staycreativedesign/6709990
[05:01:32] godd2: @categories = Category.find(params[:category_id]), usually if you pluralize a variable, that means there more than one thing inside
[05:01:39] crankharder: hmm, airbrake's login form submits over http. legit.
[05:01:50] godd2: but the find(params(:category_id) is only going to return one record
[05:01:56] crankharder: in other news, anyone familiar with an airbrake replacement other than errbit?
[05:02:04] godd2: the each method isn't defined for a single record
[05:02:06] crankharder: something i can serve myself, handles errors, looks pretty... oss
[05:02:06] sevenseacat: if that was the worst crime airbrake committed, they would be doing okay
[05:02:11] godd2: (unless you defind it yourself)
[05:02:38] dopie: godd2, ugh ok
[05:02:59] crankharder: sevenseacat: rablrablrablrabl
[05:03:20] godd2: so it should be @category = Category.find(params[:category_id]), and then @category.crimeheaders is how you would access the crimeheaders of that category in the view
[05:03:40] godd2: you don't need to make a separate variable @crimeheaders = @category.crimeheaders
[05:03:53] godd2: You can, but you don't need to
[05:05:22] godd2: Remember, when you say Category.find(:blah) youre asking ruby to make a ruby object out of an SQL record. Rails uses the Active Record gem to do this (along with some other tools)
[05:06:32] quazimodo: ACTION slaps everyone on the hinie XD
[05:06:37] godd2: feline facades notwithstanding
[05:06:37] gamov: hi. I'm removing autosave from associations to avoid extra updates of model with serialised attributes. I can't find how to save all associated records (has_many) cleanly. Do I have another solution than iterate over the collection and call .save on all of them?
[05:07:39] godd2: gamov: I think accept_nested_attributes_for MAY be what youre looking for
[05:07:46] godd2: you can read up on that here: http://api.rubyonrails.org/classes/ActiveRecord/NestedAttributes/ClassMethods.html
[05:08:10] godd2: and theres a handy rails cast on it here: http://railscasts.com/episodes/196-nested-model-form-part-1
[05:08:16] gamov: godd2: ok, thanks, will have a look. I thought it was only for form
[05:08:28] sevenseacat: aww i cant change my name to 7C????
[05:08:37] sevenseacat: ACTION did try
[05:10:29] dopie: godd2, sweet
[05:19:19] jstrong: I think it works now ....
[05:19:32] jstrong: wtf why does this shit not work
[05:19:33] thebobmarley: jstrong: Let me help you: http://www.youtube.com/watch?v=-JhwxTen6yA
[05:38:54] rakl: what's wrong with this scope :random, order: 'RAND()', limit: 1
[05:39:21] sevenseacat: you tell us, what makes you think theres something wrong with it?
[05:39:31] rakl: to_sql is `"SELECT \"posts\".* FROM \"posts\" ORDER BY RAND() LIMIT 1" `
[05:39:44] rakl: but sqlite says it is invalid sql
[05:39:49] optobear: rakl: need to order by a column?
[05:39:57] rakl: no such function: RAND: SELECT "posts".* FROM "posts" ORDER BY RAND() LIMIT 1
[05:40:04] sevenseacat: so sqlite doesnt use rand
[05:40:06] sevenseacat: look up what it does use
[05:40:12] rakl: ah gotcha
[05:40:13] sevenseacat: ps. lolsqlite
[05:40:34] optobear: d'oh. and ^
[05:47:54] dopie: Is there a better for my routes to work
[05:48:04] dopie: since i have 2 nested resources
[05:49:08] sevenseacat: better than what?
[05:49:22] dopie: Resources should never be nested more than 1 level deep.
[05:49:55] sevenseacat: why would you have /foos/12/bars/15 when you can just do /bars/15
[05:50:00] tagrudev: d00ds morning
[05:50:18] dopie: foo needs to be there
[05:50:23] obiwanchinobi: anyone ever try interceptors with poastageapp?
[05:50:39] dopie: client wants ie.
[05:50:49] sevenseacat: then if the client wants, then you do
[05:51:08] obiwanchinobi: i dont think they work as the postage app gem is overriding the core mail methods
[05:51:16] obiwanchinobi: but i am a n00b so who knows
[05:51:55] dopie: foo.com/theft-crimes/computer-crimes
[05:53:35] tubbo: dopie: you can always make a vanity route
[05:53:55] tubbo: like for example /users/1/projects/1 could be get '/:user_name/:project_name' => 'projects#show'
[05:54:09] tubbo: but you would still have /users/1/projects/1 as the API
[05:54:37] sevenseacat: having multiple routes for the same content isnt a good idea
[05:55:16] tubbo: sevenseacat: why?
[05:55:34] RustyShackleford: I want to make an appointment scheduler/calendar
[05:55:47] RustyShackleford: first of all, is rails the right tool?
[05:56:04] sevenseacat: why would you have two if you only want one?
[05:56:12] sevenseacat: RustyShackleford: maybe.
[05:56:24] tubbo: sevenseacat: one that's useful for humans, and one that's useful for machines
[05:56:29] RustyShackleford: ideally customers/patients could log in and make their appointments without needing to call
[05:56:38] dopie: http://weblog.jamisbuck.org/2007/2/5/nesting-resources
[05:56:43] dopie: would this work better?
[05:56:43] sevenseacat: why do you need separate URLs for that?
[05:56:57] sevenseacat: humans and machines can both use any URL
[05:56:58] tubbo: ideally, i guess i wouldn't
[05:57:51] tubbo: RustyShackleford: you can make that with a lot of things. rails could do what you're saying.
[05:57:53] sevenseacat: dopie: that article is completely irrelevant and out of date
[05:58:00] sevenseacat: its six years old and talks about rails 2
[05:58:21] dopie: i know that was the link in rails guide
[05:58:23] RustyShackleford: a less open-ended question: whats the best way to handle user authentication?
[05:58:25] sevenseacat: at least, i *think* its rails 2, it might be even older
[05:58:30] tubbo: RustyShackleford: my suggestion is to use some nice frontend stuff like jquery-fullcalendar
[05:58:41] RustyShackleford: my google searches are turning up lots of old posts
[05:59:08] tubbo: RustyShackleford: well devise is pretty easy, but so is rolling your own auth
[05:59:20] sevenseacat: ACTION plays with omniauth
[05:59:40] tubbo: i personally roll my own because i use ember.js on the frontend and devise + ember is hard.
[05:59:51] sevenseacat: i need an excuse to play with ember more
[06:00:01] tubbo: sevenseacat: do you like coffeescript?
[06:00:30] sevenseacat: its okay i guess
[06:00:37] rakl: another kind of silly question that probably has an easy answer
[06:00:41] tubbo: sevenseacat: http://emberscript.com/ and http://emblemjs.com
[06:00:44] rakl: get :show, id: post.id
[06:00:48] rakl: bad argument (expected URI object or URI string)
[06:01:14] sevenseacat: ive heard of emblem.js
[06:01:18] helpa: rakl: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[06:01:58] sevenseacat: the emberscript looks like abstracts a little bit too much away, and would likely break if ember gets updated
[06:02:10] tubbo: none of my apps have broken so far
[06:02:16] tubbo: there are just things that aren't supported yet
[06:02:29] tubbo: ember is pretty solid right now at 1.0
[06:02:50] sevenseacat: i just need an app to build with it lol, i did the todomvc tutorial and wasl ike whoa
[06:02:52] tubbo: ember-data is reaching 1.0, it's in 1.0.beta right now and ember-script doesn't have much to do with ember-data
[06:02:56] rakl: https://gist.github.com/anonymous/6710385
[06:03:10] rakl: throws bad argument (expected URI object or URI string)
[06:03:12] pipework: It's too much of a framework for me.
[06:03:17] pipework: I really prefer libraries.
[06:03:18] sevenseacat: rakl: wheres the error and trace
[06:03:20] macs: hi can anyone help me with my first rails app please. i think its probably a simple problem..
[06:03:41] tubbo: rakl: also show the controller
[06:04:00] tubbo: pipework: i am too much MAN for you
[06:04:15] pipework: tubbo: You also inject too much bullshit into my objects.
[06:04:23] tubbo: shittin all over ur codebaze
[06:04:32] pipework: Dat and rumtiemz
[06:04:43] tubbo: i like ember though
[06:05:00] sevenseacat: i do know enough about javascript to know that the sheer amount of hax and magic and wtfery inside ember must be enormous
[06:05:08] tubbo: i mean, regular ol' jQuery or even less is really the same thing, i just have to think less with ember.
[06:05:11] tubbo: kinda like rails.
[06:05:24] pipework: Ember seems to be trying to do activesupport in everything.
[06:05:35] pipework: "We shall extend and fiddle all objects."
[06:05:39] tubbo: it's more like rails on the frontend
[06:05:52] pipework: Please to maintain a modicum of self-control in my javascript runtime, yes?
[06:05:55] tubbo: like define a route, make a template file, boom you have a page.
[06:06:09] tubbo: you basically have to make all your views with ember, everything has to start with ember
[06:06:15] pipework: Infectious.
[06:06:24] pipework: Ember is not my application.
[06:06:46] rakl: https://gist.github.com/anonymous/6710410
[06:06:56] macs: hey yall if im trying to set up my first rails app and the command line stopped working for like 5 minutes after rails server what should i do
[06:07:06] macs: i mean after i typed rails server
[06:07:42] tubbo: alright i'm gonna go to bed
[06:08:01] tubbo: while node installs
[06:08:02] sevenseacat: macs: what do you mean, stopped working
[06:08:27] tubbo: that's what all the cool kids are doing these days i hear
[06:09:43] sevenseacat: i only have node installed to compile my assets
[06:10:02] pipework: I only have node installed as a dependency of things that I *have* to have. :(
[06:10:28] godd2: macs: what platform? are you on the machine you're running the commands on or are you porting to a remote server? is it linux/windows/mac?
[06:13:17] optobear: rakl: which line of your gist is ./spec/requests/posts_spec.rb:20:in `block (3 levels) in <top (required)>'
[06:13:45] rakl: optobear the one that reads `it "fetches a random post" do`
[06:14:02] rakl: it's fine. looks like get :show and get :index were not legit for some reason
[06:14:08] rakl: used get(posts_path)
[06:14:12] optobear: rakl: nuh-uh, which line throws the error
[06:14:12] rakl: and get(post_path(post))
[06:14:14] macs: godd2: I just realized that I might not even know it if everything was working right. I just know no rails yet, I am just setting up. So the last line my terminal shows is "Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms) ........ and then theres nothing else in the terminal. So unless your interpretation is to the contrary, I'll just assume all is well and get learning.
[06:14:31] sevenseacat: rakl: in a controller test you shouldnt be doing that
[06:14:38] rakl: under spec/requests/
[06:14:39] godd2: open a browser and go to localhost::3000
[06:14:47] godd2: localhost:3000 *
[06:14:49] rakl: it's fine. I moved on already
[06:14:54] sevenseacat: rakl: why are you writing controller specs in the requests folder
[06:15:16] godd2: macs or http://127.0.0.1:3000
[06:15:38] rakl: sevenseacat, what's the difference between request specs and controller specs
[06:15:38] godd2: yoru server is running and is awaiting requests from a user
[06:15:43] macs: godd2: yeah I did, I get the "welcome aboard" screen, I guess all is well then. haha
[06:15:56] godd2: yep :) You're up and running!
[06:16:13] sevenseacat: rakl: request specs are deprecated as of a while back, but they were meant more for an integration/acceptance type test
[06:16:18] macs: godd2: I just expected the command line to go back to the same working directory as before, that's all
[06:16:27] sevenseacat: now you would write feature specs instead and they are proper acceptance tests
[06:16:43] godd2: oh no it will continue to sit there and faithfully tell you everything that happens as requests come in
[06:16:45] rakl: sevenseacat oh they're deprecated? that's not good. feature specs are different though right
[06:16:56] rakl: feature specs start with tUI
[06:16:59] rakl: with the*
[06:17:03] godd2: in fact, it should already have a log of the request you made for that welcome aboard page
[06:17:13] sevenseacat: rakl: https://www.relishapp.com/rspec/rspec-rails/v/2-14/docs/request-specs/request-spec
[06:17:19] rakl: in this case I just want to test that some instance vars are assigned
[06:17:26] rakl: not really testing the ui
[06:17:27] rakl: just the api
[06:17:36] rakl: it made sense to call them "requests"
[06:17:38] sevenseacat: rakl: yes, you've written a controller test
[06:17:52] rakl: is spec/controllers/ a legit place to put that?
[06:18:02] godd2: macs: as your application gets more complicated, and you are making sql requests, your server will show what sql code is being used to get info from your database.
[06:18:03] rakl: that works for me
[06:18:13] macs: godd2: ok thanks.
[06:18:24] sevenseacat: rakl: see the docs on controller specs: https://www.relishapp.com/rspec/rspec-rails/v/2-14/docs/controller-specs
[06:19:21] rakl: sevenseacat ah in controllers folder get :index and get :show works too
[06:19:32] rakl: ACTION skimming docs now
[06:27:40] dopie: how to i tell rails to upper case the first letter of each word?
[06:28:11] optobear: dopie: titleize
[06:28:19] dopie: ahhh there we go
[06:28:21] dopie: thank you
[06:31:43] sevenseacat: Radar: party pooper
[06:31:56] sevenseacat: Radar: your logs need a search function
[06:32:04] Radar: sevenseacat: http://github.com/radar/logs
[06:32:05] Radar: patches welcome
[06:32:18] sevenseacat: why i gotta do all the work
[06:32:52] Radar: Open source
[06:34:10] sevenseacat: open source is overrated
[06:34:41] sevenseacat: i may look into it if i can be bothered
[06:36:34] sevenseacat: ACTION makes ember interface for viewing the logs
[06:37:17] okinomo: sevenseacat: can I msg you? That might be easier, saw your comment on stackoverflow
[06:37:33] sevenseacat: okinomo: wb :) and sure
[06:48:23] himsin: hi guys, I am using skip_callback to remove a callback and then use set_callback to restore it. But the issue is that it doesn't restore the conditions associated with the callbacks. for ex. before_save :check_mail if can_recieve_mail? , here set_callback won't restore the conditions. Can anyone suggest an alternative?
[06:52:27] thinkclay: does rails follow a cascading pattern for the asset pipeline?
[06:53:45] BrazenBraden: have a bit of issues in setting up a form for multiple users to set a role to each of multiple systems.. https://gist.github.com/brazenbraden/9d50cef60e46a7b86046
[06:54:24] _str: is there anyway to change database by "let" in rspec?
[06:54:47] _str: i'm testing my controllers and in one of them the "Model.all" is used and i'm creating object by let which is not changing db
[06:54:55] _str: and so "Model.all" returns nil
[06:55:03] _str: i want to affect database by "let"
[06:55:03] thinkclay: I'm trying to figure out how to override or extend assets like javascript: specifically I want to require my own custom js file in my gem by overriding or extending the JS asset in this gem: http://bitly.com/1aqBuvO
[06:55:08] _str: is there any way to do that?
[06:55:18] BrazenBraden: is it best to have a form per user? or one form for the entire thing?
[06:55:26] BrazenBraden: use form_for or form_tag?
[06:55:31] BrazenBraden: so much confusion
[06:58:50] BrazenBraden: thing is, when I remove the r. in r.collection_sort, the select box displays and i get no error.. but now the select box doesnt know much about the user or system. i would have though it would need something like id="user_id[role_id][system_id]" in order to properly identify the parameters when saving
[07:00:11] optobear: _str: if you pass a block to let that changes the DB, and if you call the thing created by let, you'll change the DB
[07:00:32] _str: optobear: tnx
[07:23:49] koopee: trying to bring up a rails 2.3 app to 3.0. I see a strange behaviour with fieldwitherrors. it seems that the error div generated around the input field generates wrong. Any suggestions where to start looking?
[07:34:16] Radar: koopee: define "wrong"
[07:35:01] koopee: the div does not end after the label, but extends over the next element
[07:51:44] Macaveli: How can I display that link as a real link instead of text? <%= content_tag(:p, t("user.email_settings.no_jobs") + link_to('Jobs', jobs_path) + t("user.email_settings.no_jobs_end") ) %>
[07:51:55] koopee: radar: Phew, thought I broke the damn thing totally. So the div extends too far from where it is supposed to. the error div for label contains the label div and the next div.
[07:58:58] koopee: radar: if I put the elements inside a table, then it seems to worl.
[08:15:37] maoko: Could someone tell me how ldap authenticates users?
[08:16:12] sevenseacat: thats an awfully broad and non-rails-related question
[08:18:23] maoko: For example, I may have a helpdesk system, which is connected to the ldap server directly. While being logged to the helpdesk I want to interact with the rails app, but rails app should know this current user. I'm just arguing with a friend, who tells me that we don't need to use an external parameter with username.
[08:18:50] defswork: maoko, you rails app wont know the current user unless you log in with it
[08:19:01] defswork: or tell it somehow
[08:19:02] sevenseacat: well you need to authenticate with the rails app somehow
[08:19:24] defswork: your rails app can authenticate via ldap though so you can use same user/pass
[08:19:33] universa1: maoko: now i would open up google, type in ldap and read up about it ;) and afterwards i would be able to answer your question
[08:19:44] jrobeson: or specifically rails ldap..
[08:19:54] universa1: but let's save the intermediate step... ;-)
[08:19:55] jrobeson: there must be a module that already exists
[08:20:10] defswork: I nicked the ldap auth code from redmine
[08:20:28] defswork: which uses net-ldap
[08:21:00] maoko: There is a gem for that, called ldap auth for devise, but it actually just authenticates the user without having a possibility to check if the %username% is logged in to the ldap server.
[08:21:12] maoko: Looking at the gif atm :)
[08:21:17] defswork: there is no "logged in" state on ldap
[08:21:26] BrazenBraden: silly little question.. when working in a controller and you are working with variables which you do not need to have in a view or anything, should one still make them instance variables? (i.e. @foo instead of just foo)
[08:21:46] sevenseacat: BrazenBraden: its not necessary.
[08:21:50] universa1: BrazenBraden: no.
[08:21:51] optobear: BrazenBraden: i'd avoid it
[08:21:52] defswork: maoko, you might be getting confused by windows trust accounts stuff
[08:22:23] BrazenBraden: ok... busy watching some railscasts and no matter whats happening, ryan always uses instance variables
[08:22:39] optobear: BrazenBraden: imho, it's good to look at them and know instantly they're not being passed to the view if they're not instance variables
[08:22:58] BrazenBraden: optobear: that was my thought..
[08:23:09] BrazenBraden: also, arent instance vars "heavier"?
[08:23:47] optobear: BrazenBraden: not significantly, implementation-wise. but cognitively, yeah
[08:24:10] optobear: i.e. the more there are, the harder to know what's important
[08:25:07] optobear: and with that, good evening :)
[08:26:27] Krishna_: in my nested attributes when i edit cache of nested model is doubled
[08:33:07] Krishna_: i am using accepts_nested_attributes_for working fine but when i edit i nested attributes model elements show multiple?
[08:33:35] helpa: Krishna_: 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.
[08:33:35] universa1: Krishna_: !code
[08:36:03] Macaveli: What's the difference between params["personal_info"]["SEX"] and with_params["personal_info"]["SEX"]
[08:36:15] sevenseacat: how can i make omniauth be quiet during a test run? i wrote an rspec feature to test login failure, and it feels the need to tell me about it, as in .........................E, ERROR -- omniauth: (facebook) Authentication failure! permission_error encountered..F.............
[08:36:53] universa1: Macaveli: what is with_params?
[08:37:27] defswork: sounds like some third party params allowing thing
[08:38:00] Macaveli: looks like some has been writing code behind my back haha
[08:38:06] Macaveli: I'm going to use the blame button
[08:38:12] universa1: ok, nothing on the first page of google for me about it ;) so i'm clueless
[08:38:32] Macaveli: def validate_personal_info!(with_params = {})
[08:38:32] Macaveli: user = User.new
[08:38:32] Macaveli: user.personal_info = with_params["personal_info"]
[08:38:38] Macaveli: sorry for not using Gist
[08:39:08] elaptics: Macaveli: so it's just the name of a local variable in that method
[08:39:22] Macaveli: elaptics indeed
[08:44:54] Krishna_: <universa1> code https://gist.github.com/anonymous/6711528
[08:49:35] universa1: Krishna_: next time please paste your code correctly formatted and in multiple files like this: https://gist.github.com/universal/6711549
[08:49:41] universa1: makes it a hell lot easier to read your code
[08:50:06] sheeny: Hi all, Not sure if this is possible for me to do with code or if its just an issue.. I have an online file system, people upload documents, when they upload a .docx file it tries to download as a .zip file. I know a docx is a zipped doc file. but is there anyway i can make it understand what it is?
[08:50:18] Krishna_: <universa1> Okay
[08:50:56] defswork: sheeny, mime types ?
[08:51:15] universa1: Krishna_: so you're loading multiple users in @use and that's most likely why you're getting multiple instances in your nested form.
[08:51:33] sheeny: defswork: i tried adding a mime type for it
[08:52:14] defswork: sheeny, knowing nothing about your online file system we really have little to go on
[08:52:19] universa1: sheeny: send_file "some_file", type: "..."
[08:52:43] sheeny: defswork: just using paperclip to upload files which are stored in s3
[08:52:51] defswork: sheeny, do you store the content type based upon what was submitted on the original upload ?
[08:53:43] sheeny: defswork: ah maybe that is the issue.. just checked the file type and it says zip
[08:53:56] sheeny: defswork: so maybe paperclip doesnt understand my mime
[08:54:03] defswork: if you do (paperclip does by default) then you are initially relying on the client that uploaded it
[08:54:17] defswork: sheeny, no - the client tells the server the content-type
[08:54:57] defswork: you can override this by interrogating the file (or naively looking at the filename extension)
[08:55:33] sheeny: defswork: So paperclip doesnt understand it? i thought it would realise the document type and save that in its "type" column?
[08:55:46] defswork: paperclip doesnt know anything about files
[08:56:04] defswork: it just gets the content type from the http headers on the initial upload
[08:56:09] Krishna_: <universa1> @use is increenting dynamically, but when i save project it saves correctly in projects and members,but when i edit project i struggled with https://gist.github.com/universal/6711549 project_controller 11 th line,suppose @use is 3 values a b c if i checked a b and save project it is fine,but when i edit project i see 3 times a, 3 times b, 3 times c as check boxes and updated data is not saved
[08:57:04] sheeny: defswork: ah okay, makes sense then i guess. So if i check the file myself and overwrite the type then go that way?
[08:57:43] universa1: Krishna_: ohh i see now, you're doing it wrong. i suggest you have a look at the nested model form railscast at: http://railscasts.com/episodes/196-nested-model-form-revised
[08:59:09] Krishna_: <universa1> yeah i saw it ,i am using rails4
[08:59:35] universa1: Krishna_: it hasn't changed for rails 4.
[09:02:18] sheeny: defswork: hmm it doesnt seem to be an issue with that. i have changed the type forcefully but the error persists, im not thinking it must be to do with S3 as that is where the file is coming from
[09:02:23] Krishna_: <universal> i followed the same
[09:04:37] universa1: Krishna_: no you didn't ;)
[09:06:07] universa1: Krishna_: f.fields_for :members looks in the form's object members method, and creates the fields for each instance it finds in there
[09:06:21] universa1: Krishna_: and you're looping over @use, so you're doing that multiple times
[09:07:23] universa1: Krishna_: what you should be doin in your controller is to correctly prepopulate the @project.members association, and in your form remove the @use.each do loop
[09:08:41] Krishna_: <universa1> if i remove i don't get check boxes, means @use.each data that is checkboxes stored in member model
[09:09:36] pimeys: a bug in 3.2 or am I doing something wrong: model.update_attributes(attrs) returning false, model.valid? returns false, model.errors is empty
[09:09:42] pimeys: in a nested model we have a validation error
[09:09:59] pimeys: model.nested_model.valid? is false and it's errors is not empty
[09:10:00] workmad3: pimeys: do you have validate_associated in the model?
[09:10:06] pimeys: tried that already
[09:10:17] workmad3: pimeys: is that a 'yes we do have it'?
[09:10:32] workmad3: pimeys: right, then that's what stops the save
[09:10:34] pimeys: if valid? for the model is false, it really validates the nested models
[09:10:48] pimeys: but, we don't have error messages for the model
[09:10:50] pimeys: only for the nested one
[09:11:03] pimeys: and it makes the display a bit tricky in a view
[09:11:04] ljarvis: that's expected
[09:11:05] workmad3: pimeys: yes, validates_associated will fail the validation if any nested models aren't valid
[09:11:15] workmad3: pimeys: that's kinda the entire point of it
[09:11:20] pimeys: it's ok if it works like that
[09:11:26] pimeys: but I would love to have the errors in the model
[09:11:29] tobago: I tried to extend some of my models by: https://gist.github.com/trinibago/6711731
[09:11:33] ljarvis: they're in the model
[09:11:36] ljarvis: the associated model
[09:11:38] pimeys: model.errors should not be empty if model.submodel.errors is not
[09:11:42] tobago: though it was included, the validators are blank.
[09:11:51] ljarvis: pimeys: that makes no sense
[09:12:04] pimeys: well, we have a form which edits the model and the associations
[09:12:07] ljarvis: pimeys: your initial model is valid, having errors on it is misleading
[09:12:28] pimeys: ok, so is there a nice trick in the view to just display the association errors also
[09:12:42] pimeys: or should I just loop through all the associations and display the errors if any
[09:12:59] pimeys: not so hard to do, I want something beautiful :)
[09:13:27] workmad3: pimeys: well, you're outputting forms for the association, using fields_for I guess?
[09:13:51] pimeys: let's see, just fixing a bug here, not my code really
[09:13:58] pimeys: yup, looks like it
[09:14:09] ljarvis: I see a lot of people adding association error messages to base of parent model in custom validators too
[09:14:28] ljarvis: so that's an option, probably not something I'd do though
[09:14:31] workmad3: pimeys: right, so you can spit out the errors for the particular model as part of that fields_for :)
[09:14:42] pimeys: this form is ugly :P
[09:15:02] pimeys: why is it always that the internal admin interface has to contain this kind of megaforms
[09:16:00] pimeys: well, thank you
[09:16:49] kreantos: hi having a activemodel class XY: "XY.new nil" what is the nil parameter for
[09:17:36] kreantos: test were passing on ruby 1.9.2 but failing on 1.9.3
[09:18:32] kreantos: unfortunately i did not write the app but have to upgrade it tu 1.9.3, so i have no clue what the coders intention was
[09:19:11] omarqureshi: nil is an initialization parameter
[09:19:27] omarqureshi: try it in the console it may make more sense?
[09:26:04] kreantos: omarqureshi, here a gist of my code https://gist.github.com/anonymous/91a1579b9023be3f3948
[09:26:44] uuuuh: Is there a place where I can check what "be_success" and "be_redirect" on a response actually check?
[09:27:04] pimeys: is it in shoulda validators?
[09:27:09] pimeys: smells like it at least
[09:27:16] kreantos: line 16 was ok on ruby 1.9.2 but now failing on 1.9.3, omarqureshi
[09:27:21] ljarvis: uuuuh: they check response codes
[09:27:22] elaptics: uuuuh: be_success is anything that returns a status code of 2xx
[09:27:25] pimeys: shoulda matchers I mean
[09:27:36] elaptics: uuuuh: and be_redirect is anything that returns 3xx
[09:27:36] uuuuh: yes, it's shoulda matchers, but is there a documentation
[09:27:43] omarqureshi: kreantos: what did it do in 1.9.2?
[09:27:50] omarqureshi: object with no attributes?
[09:27:56] elaptics: uuuuh: http://httpstatus.es
[09:28:37] uuuuh: ok but If I first send a DELETE request ( that I know works), my test fails to pass a "response.should be_success". And I am pretty sure that the delete works, cause User.count changes
[09:28:51] kreantos: omarqureshi: unfortunately this is not my app, but i have to upgrade it to 1.9.3, so i have no clue about what it was meant for :-/
[09:28:53] defswork: kreantos, your unless .... blank? are kinda pointless
[09:30:31] tobago: I tried to extend some of my models by: https://gist.github.com/trinibago/6711731
[09:30:38] tobago: though it was included, the validators are blank.
[09:30:56] omarqureshi: kreantos: figure it out?
[09:31:01] omarqureshi: try it in the console.
[09:31:02] tobago: what am I missing?
[09:31:55] helpa: uuuuh: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[09:31:55] elaptics: uuuuh: !gist
[09:33:04] tobago: elaptics, mean me? it is syntax highlighted.
[09:33:42] elaptics: tobago: no, it was directed to uuuuh
[09:33:56] uuuuh: elaptics: on the way!
[09:33:58] uuuuh: helpa: on the way!
[09:35:34] helpa: uuuuh: 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.
[09:35:34] elaptics: uuuuh: !auto
[09:37:08] uuuuh: https://gist.github.com/git-toni/6711956
[09:38:27] uuuuh: "can destroy others", none of the tests(commented nor uncommented) pass
[09:40:44] universa1: uuuuh: test output?
[09:41:13] universa1: uuuuh: controller code?
[09:41:40] certainty: you demand too much
[09:44:06] uuuuh: https://gist.github.com/git-toni/6711956
[09:45:51] workmad3: uuuuh: right, so your test is failing because you wrote it to expect that destroy action to not redirect
[09:45:55] kreantos: omarqureshi: it was used to initialize the object
[09:46:01] workmad3: uuuuh: and then wrote the destroy action so that the only thing it can do is redirect...
[09:46:14] universa1: uuuuh: first of all: your formatting makes it hard to read + gist has a multiple files thing + what workmad3 said ;)
[09:46:46] uuuuh: I am new to gist + all you both said makes sense
[09:46:54] kreantos: initializing worked as i said on 1.9.2 but it doesn't on 1.9.3
[09:47:00] uuuuh: but then, 'be_success' also doesnt pass cause of the same reason?
[09:47:31] kreantos: my question is, how this can be done in 1.9.3
[09:47:47] omarqureshi: kreantos: you need to understand what the nil offered
[09:47:53] omarqureshi: did it offer anything in 1.9.2?
[09:48:01] omarqureshi: or was it just bullshit
[09:48:18] omarqureshi: this is what im trying to get at
[09:48:23] omarqureshi: i never used 1.9.2 so i cant say
[09:48:32] omarqureshi: nor would i ever initialize an activemodel object with nil
[09:48:54] omarqureshi: so, either there is some hidden gem by using nil
[09:49:01] omarqureshi: or someone is trying to fuck with you
[09:56:32] uuuuh: universal: therefore, if I need that redirect_to in my controller. The only way to test the sucess of a deletion is by expect change in User.count, right?
[09:58:51] elaptics: uuuuh: correct,but this is a controller spec right? So it shouldn't really care whether the user was actually deleted or not, that's the user model's job
[09:59:44] elaptics: uuuuh: you should just be testing the controller is doing the right thing and stubbing out the user to return a successful or unsuccessful deletion if that is what the controller is supposed to act on
[10:01:28] uuuuh: what does 'stubbing out the user' to return a successful deletion mean in practise? I am not sure I understand what you mean
[10:01:30] elaptics: uuuuh: given your controller code there the only things you can test is that #find is called followed by #destroy, that a flash success message is set and the redirect has occurred
[10:02:05] elaptics: you're not even checking the response from #destroy to know if it was actually successful or not
[10:02:25] uuuuh: yes! so that means i need to stick with 'be_success', cause those are the ones that test responses?
[10:02:53] Krishna_: how to write the if conditon for urls
[10:02:59] uuuuh: however, If I redirect to users_path, isnt that a 2XX HTTP response, and therefore be_success should pass?
[10:05:22] uuuuh: I am not so into checking whether a flash sucess message appeared, cause that is very dependent on the message "User destroyed"
[10:06:16] uuuuh: I would be happy enough testing the appropiate redirection
[10:09:45] elaptics: uuuuh: no, be_redirect tests the responses too and is what you'd want here since that's what you're doing in the controller
[10:10:13] workmad3: uuuuh: a redirect isn't a 2xx response
[10:10:15] elaptics: uuuuh: testing the flash should just test that flash[:success] is set, you don't need to test the actual value in there since that might change
[10:10:18] workmad3: uuuuh: it's a 3xx response
[10:10:53] uuuuh: I like the idea of testing just that flas[:success] is set!
[10:11:07] elaptics: uuuuh: if you're using the shoulda matchers then it has a set_the_flash matcher
[10:11:14] mikecmpbll: some crazy wild ideas flowing in here this morning.
[10:11:21] elaptics: uuuuh: e.g. it {should set_the_flash }
[10:11:22] uuuuh: Then, if I do redirect_to users_path, what test should pass
[10:11:25] workmad3: mikecmpbll: morning :)
[10:11:34] uuuuh: considering it's a 3XX response
[10:11:55] Krishna_: how to give the url if condition
[10:12:09] elaptics: uuuuh: using shoulda matchers the spec would be it { should respond_with(:redirect) }
[10:12:12] workmad3: uuuuh: 'expect(response).to redirect_to(users_path)' should pass ;)
[10:12:34] elaptics: uuuuh: I use workmad3's format ^ myself though :)
[10:12:42] uuuuh: they both make sense : D
[10:13:01] elaptics: well it's the same thing basically, just written differently
[10:13:06] uuuuh: and then, where should I test the actualy change in User.count? at spec/models/user_spec.rb ?
[10:14:06] uuuuh: because I a following Michael Hartl's tutorial, and the spec/models/user_spec.rb is only 'supposed' to test email formats, existence of passwords,etc
[10:14:11] workmad3: uuuuh: I'd probably hit that from a step further out personally
[10:14:22] uuuuh: is this a misguiding by the tutorial?
[10:14:30] workmad3: uuuuh: testing that User.destroy changes the database is a lot like testing rails works
[10:14:51] workmad3: uuuuh: what I'd much rather test is that after I hit the destroy action for a user, that user can no longer be logged in
[10:15:27] uuuuh: ok, so you're saying I am not supposed to do that, the where are expect{delete user_path(user)}.to change(User,:count).by(-1) appropiate to do?
[10:15:30] workmad3: uuuuh: because, when it comes right down to it, you probably don't really care if the user is deleted, soft deleted, marked as inactive, whatever in the dtabase :)
[10:15:40] WeirdThall: Good morning. Anyone around that can help me with a ruby IRC bot?
[10:15:43] workmad3: uuuuh: end of the day though, it's whatever tests you're happy with
[10:16:00] workmad3: uuuuh: I can give you advice based on what tests I'd be happy with, and why I'd be happy with them
[10:16:32] uuuuh: that's indeed true. THen you are basically saying that you never do tests of the kind expect.to change(User,:count) ?
[10:16:34] workmad3: uuuuh: but if you feel you'd much rather write some tests that also test that changes are made in the database, then go for it :)
[10:16:50] elaptics: uuuuh: to me, those would be higher level acceptance tests
[10:17:01] workmad3: uuuuh: not quite what I'm saying... I'm saying I wouldn't write that test in this circumstance
[10:17:11] elaptics: doing a full end-to-end test
[10:17:50] elaptics: here you're just testing the controller - it's not within the controllers responsibility to be checking that the user model actually did it's job
[10:18:12] elaptics: it just relies on the user model telling it that it did it so you can do the right thing in the controller
[10:18:16] workmad3: it's all down to layers of testing (which is why I said I'd step further out)
[10:18:21] uuuuh: that is true, indeed, and I believe that this tutorial im following is a bit misguiding in this
[10:18:35] uuuuh: cause he is testing User model changes in controller test files
[10:18:41] workmad3: uuuuh: the tutorial is getting you familiar with the syntax and feel of a rails app
[10:18:49] WeirdThall: Good morning. Anyone around that can help me with a ruby IRC bot?
[10:18:53] workmad3: uuuuh: and that sort of test is easy to write, and helps get you into the habit of testing
[10:19:02] mikecmpbll: WeirdThall: no
[10:19:14] elaptics: uuuuh: it's a good sign that you're actively thinking about this though :)
[10:19:46] uuuuh: good point. So if I ultimately say "i wanna test the user model change or die", where should I conventionally place such test? spec/model/user_spec.rb rather than spec/requests/user_pages.rb, right?
[10:20:27] workmad3: uuuuh: if you really wanted to test that User.destroy worked, that would probably be in spec/model/user_spec.rb
[10:20:39] pehlert: Hey folks. If I have a controller that returns some JSON and I want to test it, would that rather be a controller or integration spec?
[10:21:04] mikecmpbll: but you wouldn't.
[10:21:18] workmad3: uuuuh: you likely wouldn't want to do that unless you were doing something extra in that though (such as implementing a soft delete system and testing that User#destroy changes the count of a scope by 1, but not the full count)
[10:21:44] stoffus: I'm looking for a way to extract all column names from a collection (including columns from joined tables). "columns_hash" only provides the columns belonging to the originating model.
[10:21:46] uuuuh: you guys helped me hugely. I will be sure to be around this channel, this is constant learning!
[10:21:56] workmad3: uuuuh: basically, you wouldn't test something unless you've turned it into your behaviour rather than rails' behaviour :)
[10:22:21] workmad3: uuuuh: or you had a suspicion that rails wasn't working correctly or could break in an upgrade....
[10:22:58] uuuuh: ah, ok, so you mean you recommend to test my applications design/interaction response rather than the actual rails core
[10:23:08] mikecmpbll: uuuuh: rails has a test suite y'know.
[10:23:24] Krishna_: <uuuuh> is nested attributes is working in rails4
[10:23:44] universa1: Krishna_: nested attributes works in rails 4.
[10:23:44] Advocation: How would I do nested resources without having the controller name in either?
[10:23:52] Advocation: I have the normal resource - match "/:id", to: 'clients#show', via: :get, as: :client
[10:23:53] workmad3: uuuuh: yes, that's it exactly :)
[10:24:03] uuuuh: I mean, it's not my intention to test rails. It just feels so "physical" and intuitive to check whether a User is deleted or not, when looking at the destroying behavior
[10:24:23] workmad3: uuuuh: that's true with the interaction with any library... you want to test your integration with the library, and your app, not the library
[10:24:45] universa1: Advocation: get "/:user_id/:id, to: 'projects#show' ?
[10:25:03] Advocation: universa1: thanks, I'll try that.
[10:25:15] Krishna_: <universa1> i strucked a lot but y i dont know
[10:25:31] universa1: Krishna_: you did what?
[10:25:54] workmad3: mikecmpbll: yeah, I know it does :) I'm thinking more of if you're relying on a feature that you aren't sure is stable
[10:26:02] uuuuh: I agree, although I also believe that checking ( or rather say referencing) to the rails correct functioning, can help debug the way in which my designed behaviour is not working
[10:26:05] Krishna_: i follow the same structure of railscast 196
[10:26:14] Krishna_: for nested attributes
[10:26:16] uuuuh: I will keep all that in mind, thanks a bunch!
[10:26:17] helpa: Krishna_: 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:26:17] universa1: Krishna_: !code
[10:26:35] mikecmpbll: wouldn't it be covered in some acceptance test? (qualification: i know shit all about testing)
[10:26:40] nettoweb: guys, can someone help me with this problem trying to upgrade rails ? https://github.com/stefankroes/ancestry/issues/156
[10:26:42] Krishna_: <helpa>https://gist.github.com/universal/6711549
[10:27:04] universa1: Krishna_: i already told you what the problem is with that code
[10:27:54] universa1: nettoweb: ancestry might depend on a newer activesupport
[10:28:03] Krishna_: <universal> i have to give the permission for selecting the check box how any other way?
[10:28:14] universa1: nettoweb: so you might need to specify an older / rails2 compatible version
[10:28:24] mikecmpbll: nettoweb: ancestry requires activerecord >= 3.0.0
[10:28:32] mikecmpbll: yeah, which requires active support ..
[10:28:45] universa1: Krishna_: you need to prepoluate the @project.members association correctly and not loop over @use.
[10:29:03] universa1: Krishna_: in the railscast code there is no @use.each or alike loop.
[10:31:14] Krishna_: <universa1>i just modified some code for my requirements so how can i do it for working properly
[10:31:38] universa1: Krishna_: i just told you.
[10:32:01] universa1: Krishna_: show the changes you made and what you tried.
[10:32:23] universa1: Krishna_: or tell me what you don't understand from my answer :-)
[10:33:21] nettoweb: mikecmpbll: take a look please: https://github.com/stefankroes/ancestry/blob/1-3-stable/ancestry.gemspec
[10:33:31] nettoweb: mikecmpbll: >= 2.3.14
[10:33:54] universa1: nettoweb: did you specify version 1.3 ?
[10:34:11] Krishna_: in the gist i need to create a project means save according to the checkboxs some of i have selected ok it is fine, my check boxes are increasing when user is created, so for the just created user i need to add to the project so through the check box i am doing
[10:36:55] nettoweb: universa1: I did what they tell me: https://github.com/stefankroes/ancestry/tree/1-3-stable
[10:37:08] nettoweb: universa1: Add to config/environment.rb: config.gem ???ancestry???
[10:37:26] universa1: nettoweb: you need to specify that you want version 1.3
[10:38:09] nettoweb: but in the docs tells: just add config.gem ???ancestry??? in environment.rb and then rake gems:install
[10:38:37] universa1: nettoweb: the docs are most likely from the time, when 1.3 was the newest version.
[10:38:57] mikecmpbll: the instructions are just "here's how you install a gem in rails 2:"
[10:38:58] nettoweb: universa1: how I specify the version in this case? because I think I dont can put in Gemfile ause the compability
[10:39:16] universa1: nettoweb: google tells me: config.gem 'gem_name', :version => ">=0.1" -- http://stackoverflow.com/questions/6495464/ruby-on-rails-2-3-8-how-do-i-require-a-specifc-version-of-a-gem
[10:39:49] universa1: nettoweb: bundler should work with rails 2.3 and 1.8.7
[10:40:01] workmad3: you need to do a bit of extra work with them though
[10:40:36] universa1: yyep, but the bundler docs cover that nicely imho ;)
[10:41:14] nettoweb: universa1: thank you, I'll try
[10:41:39] nettoweb: I'm trying to upgrade my rails 2 app to rails 3
[10:41:48] Krishna_: what is use of redis server
[10:42:56] mikecmpbll: Krishna_: it's fast, i think that's the draw.
[10:44:46] universa1: Krishna_: to solve your problem with the nested form: remove the @use.each loop, and just use f.simple_fields_for :members
[10:45:00] nettoweb: universa1: I specify: config.gem "ancestry", :version => "1.3.0" but when try to install give the same error
[10:45:05] universa1: Krishna_: and in your controller build / load the correct members for the project
[10:45:43] koopee: I'm trying to make a custom action. My routes are set, I have a working custom_path helper but then as I try to use the link, I get Unknown action
[10:45:43] koopee: The action '246' could not be found for CustomersController
[10:45:52] universa1: nettoweb: gem install ancestry --version 1.3.0 and then whatever the rake task was maybe
[10:46:08] koopee: btw nettoweb I think we are in a same boat
[10:46:38] Advocation: gah, just got bitten by a space bug :/
[10:46:40] helpa: koopee: 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:46:40] universa1: koopee: !code
[10:46:48] universa1: or maybe even:
[10:46:49] helpa: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[10:46:58] Advocation: form_for[@client, @user] should have been form_for [@client, @user] :(
[10:47:11] workmad3: Advocation: heh :) yup
[10:47:27] Advocation: All part of the learning process!
[10:47:30] nettoweb: universa1: https://gist.github.com/osnysantos/5f61618fce2702fc99f9
[10:47:48] Krishna_: <universa1> even i removed that @use.each loop when i edit the same again doubled
[10:48:08] universa1: Krishna_: and in your controller build / load the correct members for the project
[10:48:14] universa1: Krishna_: show how you did that.
[10:49:38] universa1: Krishna_: do you have ar 2.3.14 installed?
[10:49:49] universa1: Krishna_: maybe try 1.2.5 ;)
[10:50:07] universa1: ohh wrong highlight, sorry Krishna_
[10:50:10] universa1: nettoweb: http://rubygems.org/gems/ancestry/versions/1.3.0
[10:50:17] universa1: and see the above lines ;)
[10:51:05] Krishna_: <universa1>do you have ar 2.3.14 installed? is this for me?
[10:51:24] universa1: Krishna_: nope.
[10:51:51] nettoweb: universa1: ok, so must I setup it in Gemfile and can remove from environment.rb?
[10:52:08] universa1: nettoweb: no.
[10:52:51] universa1: nettoweb: 1.3.0 depends on activerecord >= 2.3.14, if you don't have 2.3.14 installed it most likely tries the most current version, which is 4.0, which requires ruby 1.9.3
[10:52:54] Krishna_: <universa1>i just changed like this for testing even edit it is doubling <%= f.fields_for :members do |s| %> <%= s.check_box :user_id, {}, 3 %><%= 3 %> <% end %>
[10:53:34] workmad3: Krishna_: what version of rails are you on?
[10:53:36] universa1: nettoweb: so you need to upgrade your rails 2.3 app to 2.3.14, then ancestry 1.3.0 should use that to fullfil it's dependency
[10:53:47] nettoweb: I have 2.3.14 installed
[10:53:50] Krishna_: <workmad3> rails4
[10:54:28] universa1: nettoweb: gem list ? and config/environment.rb says 2.3.14 ? iirc it was in some config file
[10:54:33] nettoweb: universa1: https://gist.github.com/osnysantos/5f61618fce2702fc99f9
[10:55:09] universa1: nettoweb: tried ancenstry 1.2.5 ?
[10:55:29] universa1: but probably easier if you move to bundler ;)
[10:55:31] nettoweb: universa1: lists of gems : https://gist.github.com/osnysantos/5f61618fce2702fc99f9
[10:55:39] universa1: Krishna_: full code in a nicely formatted gist
[10:57:50] nettoweb: universa1: well, its crazy, take a look at this output: https://gist.github.com/osnysantos/5f61618fce2702fc99f9#file-gistfile3-txt every try fail, any version
[10:58:34] universa1: nettoweb: tried removing the rails 3 gems?
[10:58:46] universa1: nettoweb: are you using rvm?
[10:59:13] workmad3: nettoweb: yeah, the ancestry gem's dependencies are too lenient
[10:59:34] workmad3: nettoweb: they merely state they need activerecord >= 2.3.14, which includes rails 4
[10:59:58] workmad3: nettoweb: and the rubygem dependency resolution will just look for the latest version that matches that... and rails 4 can't be installed on ruby 1.8
[11:00:24] workmad3: nettoweb: this is exactly the sort of issue that bundler is intended to resolve
[11:00:35] Krishna_: <universal> https://gist.github.com/anonymous/6712678
[11:01:09] workmad3: nettoweb: you could also run 'gem install ancestry -v "1.3.0" --ignore-dependencies
[11:01:21] universa1: Krishna_: what is u.id ? you don't even have a u
[11:01:28] universa1: Krishna_: at https://gist.github.com/anonymous/6712678#file-new-html-erb-L12
[11:03:35] nettoweb: universa1: yep, im using rvm
[11:03:44] nettoweb: universa1: workmad3: https://gist.github.com/osnysantos/5f61618fce2702fc99f9#file-gistfile4-txt
[11:04:00] workmad3: nettoweb: that's great
[11:04:06] workmad3: nettoweb: next time you could try reading
[11:04:26] nettoweb: workmad3: ? Im trying what you ay
[11:04:31] workmad3: nettoweb: err, no you're not
[11:04:42] workmad3: nettoweb: as I said, try reading
[11:04:53] universa1: Krishna_: https://gist.github.com/universal/6712688/revisions
[11:05:35] nettoweb: workmad3: I dont understand, I'm reading and trying to fix like you two are saying
[11:05:45] workmad3: nettoweb: look at what I said to run
[11:06:07] workmad3: nettoweb: or did you think the argument '--ignore-dependencies' to the gem install was something to just ignore?
[11:06:36] workmad3: nettoweb: so as I said, try reading
[11:07:10] nettoweb: workmad3: worked, but I'm afraid something broke cause dependencies. what do you think about it?
[11:07:22] tobago: I wonder why the module is included into the model (returns 'included' in the console), but the validators are blank? https://gist.github.com/trinibago/6711731
[11:07:25] workmad3: nettoweb: not a fucking clue if you don't say what broke
[11:07:34] nettoweb: workmad3: When I try 'rake gems:install' it still fall
[11:08:40] universa1: nettoweb: another thing i'd try is creating an empty gemset: install just rails 2.3.14 and then try installing ancestry
[11:08:54] nettoweb: workmad3: please take a look at the last file added: https://gist.github.com/osnysantos/5f61618fce2702fc99f9#file-gistfile5-txt
[11:09:38] nettoweb: universa1: ok
[11:09:38] mikecmpbll: nettoweb: what version of rubygems?
[11:10:34] nettoweb: mikecmpbll: 1.4.2
[11:10:49] mikecmpbll: nettoweb: upgrade rubygems? dependency resolution has probably improved since then? /shrugs.
[11:10:57] Krishna_: <universal> what is s.object.name
[11:13:33] nettoweb: mikecmpbll: I'm trying??? seem very old version
[11:17:28] koopee: Ok, now: https://gist.github.com/koopee/6712780
[11:18:22] Krishna_: <universa1> what is <%= s.object.name %> ???
[11:18:48] BrazenBraden: silly little ajax type question. trying to load a partial into a div on a button submit: https://gist.github.com/brazenbraden/5dbc4ce976c8133c1eb9
[11:18:49] universa1: Krishna_: it's wrong btw. it should have been s.object.user.name
[11:19:16] universa1: Krishna_: s.object references the currently model instance the fields_for is generating fields for
[11:19:46] tobago: aaah got it. by myself. it was a typo....
[11:20:12] mikecmpbll: BrazenBraden: what rails version?
[11:20:22] Krishna_: <universa1> but wmen run the code shows no method error in projects#new
[11:20:49] universa1: Krishna_: did you make the changes in the controller?
[11:20:54] mikecmpbll: BrazenBraden: i don't think there's any such method as replace_html, but I could be wrong.
[11:21:31] Krishna_: <universal> yes what you sent me the reviewed the chenaged those things
[11:21:32] BrazenBraden: mikecmpbll: hmm. ok. found that code on stackoverflow.. is there something similar in rails 4 that you know of? or do I turn to JS?
[11:21:52] mikecmpbll: BrazenBraden: just render a JS view which replaces the content of the div ..
[11:22:02] universa1: Krishna_: show your current code.
[11:22:35] BrazenBraden: mikecmpbll: ok will look into that... thanks
[11:22:37] universa1: Krishna_: did you check that those lines actually do what they're supposed to do in the console? i'm browser coding here
[11:23:04] mikecmpbll: if you're using jquery: $("#roles_content").html("<%= escape_javascript(render :edit_roles, object: @users) %>")
[11:23:05] mikecmpbll: or something.
[11:23:34] mikecmpbll: save that as edit_roles.js.erb
[11:23:35] nettoweb: mikecmpbll: thank you, ancestry installed but after updating rubygems-update I was start ther server and get this: https://gist.github.com/osnysantos/5f61618fce2702fc99f9#file-gistfile6-txt I dont know if you can help me fix this. my app is so old. maybe any old code
[11:23:36] BrazenBraden: cool. thanks mikecmpbll
[11:23:49] Krishna_: <universa1> ActionView::Template::Error (undefined method `name' for #<Member:0x000000054
[11:23:52] nettoweb: universa1: workmad3: thank you guys
[11:23:55] jrobeson: i was looking up on how to validate that at least two associated records exist in my has_many relation. so this exists validates :my_association, :length => { :minimum => Fixnum}, but a lot of people were saying one should instead use a custom validation, but with no explanation on why not to use the former
[11:24:00] jrobeson: anybody have any ideas on that?
[11:24:10] universa1: Krishna_: s.object.user.name it should be
[11:24:21] BrazenBraden: mikecmpbll: and that .js.erb file goes into my views folder?
[11:24:38] mikecmpbll: BrazenBraden: views/users/ yep.
[11:24:50] mikecmpbll: BrazenBraden: you'll need to telly our controller to respond with JS.
[11:24:58] mikecmpbll: tell* action*
[11:25:02] BrazenBraden: mikecmpbll: right, got you
[11:26:50] mikecmpbll: nettoweb: i'm not sure if the latest rubygems is compatible with rails 2.3 tbh, so that may be the problem. try downgrade rubygems to 1.7.2: http://stackoverflow.com/questions/5215981/what-is-the-stable-rubygems-version-for-rails-2-3-11
[11:27:29] Krishna_: <universa1> undefined method `user' for #<Member:0x00000005a7fc60>
[11:28:36] universa1: Krishna_: https://gist.github.com/universal/6712688/ea5315d7f9588a865076ec1cd101510193912d54#file-member-rb-L3
[11:28:44] universa1: Krishna_: this should be belongs_to :user
[11:32:05] Krishna_: <universal> i changed that again it shows undefined method `name' for nil:NilClass
[11:32:41] BrazenBraden: mikecmpbll: having edit_roles.js.erb wont matter if the rest of my files are .haml will it?
[11:33:17] mikecmpbll: uh, i dunno, i don't use haml. don't think so?
[11:33:25] BrazenBraden: mikecmpbll: okie
[11:33:46] mikecmpbll: you can use .js.haml if you want though
[11:34:03] BrazenBraden: mikecmpbll: ok.. dont really mind, not now anyway
[11:36:23] BrazenBraden: mikecmpbll: it works :) brilliant.. but is it necessary to have a while file with just one line of code in that loads another partial file?
[11:36:32] krz: whats a good read for noobs wanting to create their own gem?
[11:36:38] krz: http://guides.rubygems.org/make-your-own-gem/ ?
[11:36:48] workmad3: krz: sounds reasonable to me
[11:38:03] mikecmpbll: BrazenBraden: there might be an alternative, i don't know it off the top of my head though
[11:38:25] Krishna_: <universa1>error shows undefined method `user' because user is local for controller but we are calling in view
[11:38:28] BrazenBraden: mikecmpbll: okie thanks. will investigate into possible refactoring once I have stuff working :)
[11:38:37] universa1: Krishna_: did you fix your association?
[11:38:53] universa1: Krishna_: members.rb -> line 4 or so: belongs_to :user instead of :users ?
[11:38:55] Krishna_: <universal>yes i fix
[11:39:00] nettoweb: mikecmpbll: Im trying to fix, but its difficult https://gist.github.com/osnysantos/5f61618fce2702fc99f9#file-gistfile7-txt
[11:39:15] universa1: Krishna_: then s.object.user shouldn't raise an error
[11:39:45] universa1: Krishna_: add/replace it with <%= s.object.inspect %> please and gist the output
[11:40:11] mikecmpbll: nettoweb: seeing as you're using RVM, try what the commenter suggested on that SO question: rvm rubygems 1.7.2
[11:44:23] Krishna_: <universal> it takes all the nil values for output https://gist.github.com/anonymous/6713006
[11:44:59] universa1: Krishna_: show your controller code please.
[11:46:58] koopee: universal: You were usint rvm, right? I had an issue, where the rvm had it's own global gems, which interfered my application gems.
[11:47:06] krz: in active record what is validates ?
[11:47:09] krz: a method?
[11:47:24] krz: what is validates being defined as?
[11:47:35] krz: a method that accepts a block
[11:47:59] Krishna_: <universal>https://gist.github.com/anonymous/6713048
[11:48:04] universa1: koopee: not enough information to even guess what's wrong at your end ;)
[11:48:19] krz: or something else?
[11:48:39] defswork: krz, something else ?
[11:49:08] universa1: Krishna_: sorry, the user / user_id shouldn't be blank then.
[11:49:34] universa1: Krishna_: so i'm clueless.
[11:50:07] koopee: universal: duh, was supposed to go to nettoweb...
[11:50:14] universa1: Krishna_: did you reload the page or is this after a post?
[11:50:36] koopee: universal: duh, was supposed to go to nettoweb... :)
[11:51:35] Krishna_: <universal> even i reload the page it shows same error
[11:52:30] universa1: Krishna_: so open up a rails console
[11:52:44] universa1: Krishna_: load a project and do the users - members build thing there
[11:52:58] universa1: Krishna_: and then look at the members if they have the user set.
[11:54:59] Krishna_: <universa1> members does not have user set and when i click edit again it is doubled
[11:55:16] universa1: Krishna_: show please what you did in the console
[11:55:44] nettoweb: mikecmpbll: hey, I'm now with rubygems 1.8.10, but again running "rake gems:install" the ancestry tell "Error installing ancestry: thread_safe requires atomic (>= 0)"
[11:58:03] mikecmpbll: nettoweb: gem list | grep atomic
[11:58:17] Krishna_: <universa1> https://gist.github.com/anonymous/6713129
[11:58:36] universa1: Krishna_: o0
[11:58:42] nettoweb: mikecmpbll: atomic (1.1.14, 1.1.13)
[11:59:55] patie: hi, its possible to set default value for f.input ? something like f.inputvalue :default ? thx
[12:00:00] Krishna_: <universal> this is web page https://gist.github.com/anonymous/52f4686d52c9707b073a
[12:00:07] patie: simple_form*
[12:00:13] universa1: Krishna_: you were supposed to do: project = Project.new; users = User.where(flag: [1,2]); users.each{|user| @project.members.build user: user}; project.members.inspect
[12:00:36] bastilian: patie: you mean a placeholder or a actuall value?
[12:01:01] patie: bastilian: no placeholder, value if its nil
[12:02:12] Krishna_: <universal> when i add project.members.inspect at edit action shows error undefined local variable or method `project' for
[12:02:21] koopee: nettoweb: I think you might have a similar problem with rvm.
[12:02:49] nettoweb: koopee: nops
[12:02:50] bastilian: patie: try somehting like "<%= f.input :remember_me, input_html: { value: '1' } %>"
[12:03:10] universa1: Krishna_: go to your console: enter rails c
[12:03:19] koopee: nettoweb: the rvm uses some global gems and I had to remove some of the global gems to get it working
[12:03:20] patie: bastilian: i know this, but after unsucessful validation - this remove my input with this
[12:03:29] universa1: Krishna_: then enter/copy&paste the code i just gave you
[12:03:34] universa1: Krishna_: and then gist the output.
[12:03:38] mikecmpbll: nettoweb: try uninstall both versions of atomic and try again
[12:05:30] Krishna_: <universal> at console https://gist.github.com/anonymous/6713223
[12:05:30] bastilian: patie: hm... can you paste you controller code and view in a gist?
[12:05:34] mikecmpbll: i don't think 1.x.x matches >= 0 constraint, but I always forget how they work.
[12:06:06] universa1: Krishna_: o0, just o0
[12:06:17] universa1: Krishna_: ok then: replace user: with user_id ...
[12:06:24] nettoweb: mikecmpbll: ok, but to get my app running (script/server) it ask me run "rake gems:install" and it tell me again: activesupport requires Ruby version >= 1.9.3.
[12:06:37] nettoweb: I'll try something that the folks here answer me
[12:06:47] mikecmpbll: ACTION shrugs
[12:07:01] mikecmpbll: probably easier to just upgrade rails and use bundler and all the shiny stuff that makes shit work.
[12:07:09] nettoweb: caus the ancestry has already been installed
[12:08:47] universa1: Krishna_: and btw. you get double/triple/... entries because you already created a big number of double entries
[12:09:20] Krishna_: <universa1> where
[12:09:56] universa1: Krishna_: https://gist.github.com/anonymous/6713223#file-console-L6
[12:10:14] universa1: see that line, which user_id's are not allowed? see how they're all the same...
[12:10:48] universa1: Krishna_: and if you get a warning about: https://gist.github.com/anonymous/6713223#file-console-L13 -- please tell the person who's trying to help you.
[12:12:28] nettoweb: workmad3: I installed with --ignore-dependencies with success but when I try to start my app, it tells me "Missing these required gems: ancestry = 1.3.0" and ask me to run: rake gems:install, but if I run this I go back to that problem: activesupport requires Ruby version >= 1.9.3
[12:12:46] Krishna_: <universa1> what to do
[12:13:25] universa1: Krishna_: read and actually follow what i write.
[12:13:37] universa1: Krishna_: replace user: user with user_id: user.id
[12:13:52] universa1: Krishna_: in project.members.build...
[12:19:01] koopee: nettoweb: try running rvm @global do gem list
[12:19:05] Krishna_: <universal>i changed what you tell but again in viewMembers #<Member id: nil, project_id: nil, created_at: nil, updated_at: nil, user_id: nil>
[12:21:51] koopee: nettoweb: I had a global gem that required activesupport, which required some other ruby... If only I remembered what did I do to get it working
[12:22:25] tweeeaks: anyone read this book? http://ruby.railstutorial.org/ruby-on-rails-tutorial-book -- seems legit, the site just looks a bit "affiliate markety" and I wanted to make sure before investing time in it.. i like the fact its been updated for 4.0
[12:23:02] shevy: tweeeaks advertising?
[12:24:32] tweeeaks: shevy, me? no, i'm looking for a book written for 4.0... really need a good resource for creating a web app from a-z that isn't the typical blog tut. this one looks good, just wanted a second opinion
[12:26:16] Krishna_: <universal>i changed what you tell but again in viewMembers #<Member id: nil, project_id: nil, created_at: nil, updated_at: nil, user_id: nil>
[12:27:35] tweeeaks: shevy, any suggestions?
[12:27:48] koopee: got my stuff working. Had there a route for post, but the request was get... oh well.
[12:28:19] shevy: tweeeaks not really, I was too disappointed with the rails books years ago and stopped reading any of them, I mostly just stick to IRC and trying out things on my own + the official rails API
[12:28:59] tweeeaks: gotcha, cool thanks
[12:34:22] renklaf: tweeeaks: http://ruby.railstutorial.org/ is a good resource for learning how to make a Rails 4.0 app from scrath - and it goes beyond your typical Blog app
[12:45:55] krz: why do most ORM/ODM's include modules instead of inherit from a class?
[12:46:04] krz: AR for example inherits
[12:46:20] krz: mongoid/rethinkdb/mongomapper all include modules
[12:49:51] jrobeson: i think those are all bad patterns :)
[12:50:16] Scient: inheriting seems like the logical choice
[12:50:33] Scient: including modules would make sense with something like ActiveModel, where you mix in different functionality
[12:50:47] Scient: i hate that some AM stuff has to be included and some extended though, seems somehow inconsistent
[12:51:07] jrobeson: one shoudln't have to inherit just to use the orm
[12:51:45] jrobeson: seems like ruby object manager will work like that
[12:51:52] jrobeson: whenevver it supports rdbms :)
[12:51:54] Scient: considering how much "magic" you get when inheriting, its okay
[12:52:16] Scient: i mean you can always explicitly use a singleton or factory for your ORM access and work with that
[12:52:19] Scient: but thats just awkward
[12:52:41] jrobeson: i'm pretty used to the datamapper pattern (not the ruby orm)
[12:52:47] jrobeson: due to seperation of concerns
[12:53:11] jrobeson: em.persist(Object.new(attrs..))
[12:53:20] Scient: well i would say that an AR model is pretty database specific and there are no concerns to separate
[12:53:26] Scient: perhaps just deeper business logic
[12:53:43] jrobeson: i would prefer POROs..
[12:54:04] jrobeson: it just makes me feel wird that the object its persisting itself like that
[12:54:08] Scient: yes and no
[12:54:50] clocKwize: talking restful.. If I have a resource, which is Collections and I want to be able to be able to set a flag saying its public or not
[12:54:57] clocKwize: what would be the best way to express tht?
[12:55:11] krz: perhaps they include as to allow the developer to inherit from their own class?
[12:55:35] krz: so the developer can inherit from another class of their own
[12:55:36] auxbuss: Hi, I have a rails 4 question about accessing link table attributes with has_many :through. I asked on SO, but it didn't anywhere. Is it cool to post that link here to describe the problem?
[12:55:53] krz: including a module doesnt get in the way of that
[12:56:23] krz: once a class inherits from an ODM/ORM, it feels like the ORM/ODM owns that class completely
[12:56:34] krz: as per including, its just a part of it
[12:56:40] krz: could that be the reason?
[12:56:48] Scient: i feel that it just gets augmented with certain functionality and thats it :)
[12:57:05] Scient: all in all the end result is pretty much the same, you get a bunch of new stuff in your class
[12:57:44] jlebrech: i'm have an engine and it has a template in the gem that i want to be overriden by the app if the template is present, is there a way for the app to check in itself first? the controller is in the engine tho.
[12:59:45] auxbuss: My question is: How do you access join table attributes with has_many :through : on rails4? I describe the against rails3 here: http://stackoverflow.com/questions/18799934/has-many-through-how-do-you-access-join-table-attributes
[13:05:07] jlebrech: so engines look for template in their own codebase first, but look for partials in the apps codebase?
[13:06:07] BrazenBraden: easier way to do this? https://gist.github.com/brazenbraden/598f5220af3af9a60183
[13:06:34] patie: http://stackoverflow.com/questions/19029129/default-value-for-input-with-simple-form
[13:06:56] universa1: BrazenBraden: use i18n? ;-)
[13:07:05] defswork: BrazenBraden, make it a helper first
[13:07:54] BrazenBraden: universa1: no idea what i18n is lol.. will check it out
[13:08:12] helpa: BrazenBraden: http://guides.rubyonrails.org/i18n.html - Guide on i18n by Sven Fuchs and Karel Mina????k
[13:08:12] universa1: BrazenBraden: !i18n
[13:08:24] BrazenBraden: universa1: already there ;)
[13:08:30] universa1: BrazenBraden: there's also: "user".pluralize iirc
[13:08:55] crunch-choco: can we install gem rails 4 on any webserver or are some servers forcing us to use rails 3.2? (sorry for the newbie question)
[13:09:01] BrazenBraden: but "user".pluralize wont know if it should be single or plural
[13:09:15] defswork: it will if you stick it in a helper....
[13:09:45] defswork: def plurification(s, c) c>1 ? s.pluralize : s ; end
[13:09:49] BrazenBraden: defswork: but is a helper the "right way"?
[13:09:54] tbuehlmann_: http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#method-i-pluralize
[13:10:12] defswork: there you go - already exists ;)
[13:10:32] defswork: has the overhead of inflections though
[13:10:32] tbuehlmann_: but I'd also stick to i18n
[13:11:08] BrazenBraden: well, temp fix then... will make a note to convert to i18n later
[13:11:37] obiwanchinobi: ACTION i am patching a gem but i am unsure how to write an assertion to test my fix: https://gist.github.com/obiwanchinobi/9075051b677adba3c070 
[13:12:41] obiwanchinobi: the gem is using testunit
[13:14:06] pipework: First, ensure there's a test that calls << if the setting Mail::TestMailer
[13:14:30] pipework: Then add another for when it isn't.
[13:15:08] obiwanchinobi: sorry, i should've been more specific
[13:15:17] obiwanchinobi: this method already has full test coverage
[13:15:30] pipework: That doesn't really nail anything down.
[13:15:32] obiwanchinobi: i just changed the 'else' condition
[13:15:42] obiwanchinobi: how do i test that though?
[13:15:49] pipework: What I suggested is still what you should test.
[13:15:49] obiwanchinobi: self.send if perform_deliveries
[13:15:59] jlebrech: how do you use a method instead of writing a scope? and is that the new way to do thing? aren't scopes in general going to be phased out in favour of class methods?
[13:16:20] Hates_: jlebrech: just define a class method
[13:16:20] obiwanchinobi: sorry, i thought i understood what you were suggesting pipework but i don't think i did
[13:16:39] jlebrech: or an instance method even
[13:16:59] pipework: jlebrech: You write a class method that returns an arel object. def all_things; Things.all; end; might be an example.
[13:17:16] pipework: You just need to return an arel object. The thing before you call #to_a
[13:17:34] tbuehlmann_: there's a difference between class methods and scopes. I personally tend to use scopes, because I'm lazy. using a class method, you might have to think of an "else" branch and return .none
[13:17:54] pipework: There doesn't have to be a difference though.
[13:18:19] Hates_: jlebrech: every scope can be made into a class method
[13:18:19] tbuehlmann_: of course not, but these two aren't identical
[13:18:29] pipework: A scope is just fancy talk for a class method that definitely returns a chainable arel object.
[13:18:52] tbuehlmann_: wouldn't call it fancy, but that's the essence
[13:18:57] Hates_: tbuehlmann_: no one said they were
[13:19:32] pipework: tbuehlmann_: 'fancy' as in the hick way of saying it. Not genuinely all that interesting or cool.
[13:19:52] tbuehlmann_: http://blog.plataformatec.com.br/2013/02/active-record-scopes-vs-class-methods/ sums it up pretty good
[13:19:59] mikecmpbll: i call chainable class methods scopes :[
[13:20:08] pipework: I call them chainable class methods.
[13:20:11] sevenseacat: good blog post that one.
[13:20:24] ReBa_: I am receiving the error that my file can't be found... I don't get why? Is there a relative path not right maybe? https://gist.github.com/RemiSpot/da30b10bd06a329400ac has all information with error and file location structure etc.
[13:20:31] mikecmpbll: is your code as verbose as your speech?
[13:20:56] pipework: mikecmpbll: It would be if you'd stfu. :p
[13:21:28] jlebrech: pipework: so when you just do a "where" in an instance method, where will return the arel object? so it's just like a scope
[13:21:29] pipework: it 'do' { things }
[13:21:38] pipework: jlebrech: In a class method.
[13:21:52] pipework: We've been saying class method the whole time. No one has said instance method.
[13:22:10] pipework: Yup, that's the gist of it though. You return a chainable object.
[13:22:19] pipework: Specifically, an arel object.
[13:22:20] jlebrech: ok, so it's in a class method.
[13:22:44] foucist: ReBa_: you could do File.read(Rails.root.join('country_files/countries_numeric_no_alpha_2.csv')) if you run that with rails
[13:22:48] jlebrech: hence this blog post http://www.railway.at/2010/03/09/named-scopes-are-dead/
[13:23:01] pipework: jlebrech: If you abide by their implicit contract, I think you aren't allowed to return anything but a chainable arel object. Not nil or something else.
[13:23:01] foucist: ReBa_:er, don't need the 'join'
[13:23:37] ReBa_: foucist: Okay! I will try it :)
[13:25:38] ReBa_: foucist: It sais 'root': wrong number of arguments (1 for 0)
[13:26:05] ReBa_: as I did: csv_text = File.read(Rails.root('bin/country_files/countries_numeric_no_alpha_2.csv')) and csv_text = File.read(Rails.root('country_files/countries_numeric_no_alpha_2.csv'))
[13:26:13] mikecmpbll: did he say that ...
[13:26:37] foucist: ReBa_: you could try RAILS_ROOT + 'bin/country_files/countries_numeric_no_alpha_2.csv'
[13:26:42] mikecmpbll: oh, yeah he did.
[13:28:34] denym_: How to find @user=User.all with a column:integer greater than 100?
[13:28:57] mikecmpbll: denym_: use .where()
[13:29:12] tbuehlmann_: you might want User.where('integer > ?', 100)
[13:30:24] ReBa_: foucist: Okay, I've got it working, at least the reading of the file, by doing: File.read(Rails.root + '/bin/country_files/countries_numeric_no_alpha_2.csv'). Thank you very much :)
[13:31:27] foucist: ReBa_: i guess you did need the .join, oh wells
[13:31:43] ReBa_: In any case, it works :P
[13:32:02] foucist: insufficient!
[13:34:30] jarr0dsz: hi everyone i have a user with profile, where profile has user_id field
[13:34:55] jarr0dsz: sometimes on issues with code the increment of this user_id column is messed up and make it unable to build correct new records, what would be best way to tackle this?
[13:35:16] mikecmpbll: jarr0dsz: :/ fix the issues with code
[13:38:15] pipework: Fix the code with alcohol.
[13:38:46] mikecmpbll: sounds like he's got a has_one association and is incrementing the foreign key rather than associating the records in rails, luls
[13:41:10] mikecmpbll: i already want rid of this new chrome landing page..
[13:42:01] mikecmpbll: it's completely pointless, people use the address bar to search..
[13:42:03] pipework: Forget it exists.
[13:42:16] pipework: That's what I do when I don't like someone or something.
[13:42:25] mikecmpbll: pipework: i'll give it a go.
[13:42:49] pipework: Then I'm all, "oh. I forgot you even existed. Gosh, what have you been up to?" then I start forgetting again.
[13:45:48] madnificent: interesting, switching from sqlite to mysql for the test environment almost doubled the time it takes to run our test suite.
[13:49:01] pipework: Are you planning on deploying sqlite into production?
[13:49:39] dopie: anyone here use redactor/?
[13:50:26] sheeny: whois dopie
[13:50:35] sheeny: redactor?
[13:50:41] sheeny: is that a WYSIWYG?
[13:50:51] sheeny: then no :(
[13:51:18] pipework: Lol, their "Lightning fast" section.
[13:51:18] sheeny: you dont use it to drag on drop stuff do you?
[14:10:06] levberlin: Hi Guys, if anyone wants more personalized Rails help, I'm doing free videochat/screenshare sessions. Just visit https://onscreenexpert.com and search "lev" or "rails". It's free, but feedback on the site is welcome :)
[14:12:39] defswork: levberlin, awesome
[14:12:59] levberlin: thanks defswork :)
[14:14:36] defswork: levberlin, 2 way video ?
[14:15:41] levberlin: defswork we use google hangouts, so we have videochat, regular text chat, screen share and remote desktop
[14:15:52] defswork: aah right - cool
[14:16:06] levberlin: remote desktop is a little wonky, but it's pretty good overall
[14:16:21] pipework: I'm pretty happy with never remoting in.
[14:16:26] obiwanchinobi: hey pipework. thanks for your tip before. Made me think about my change and i refactored it resulting in a clear test. Thanks :)
[14:16:38] pipework: But when pairing is needed, I use tmux.
[14:16:51] clocKwize: with rspec, I want shared examples to operate against an object, not something in the scope of my test??? I want to do expect(x).to behave_like("a y")
[14:16:56] clocKwize: anyone know how I can do tha?T
[14:17:11] justanotherjason: /msg nickserv help
[14:17:32] madnificent: pipework: was that 'deploying sqlite for production' geared towards me?
[14:18:25] pipework: Not so much geared as directed.
[14:27:32] justanotherjason: anyone available for some mongo help?
[14:27:49] justanotherjason: using mongoid and having a hard time querying date time fields
[14:27:56] justanotherjason: http://pastie.org/8357430
[14:28:58] sevenseacat: well those two datetimes arent the same
[14:29:06] sevenseacat: there's nearly a minute between them
[14:29:16] justanotherjason: oops, copy and pasted wrong, it doesn't work even if they are
[14:29:39] sevenseacat: probably not, there's probably fractions of a second that arent visible
[14:29:50] sevenseacat: two datetimes are never equal
[14:30:18] jstrong: ah the classic datetime date confusion
[14:30:44] foucist: i'll make them equal dammit! /me builds a timemachine
[14:30:50] jstrong: justanotherjason: you need to query using dates not datetime. I believe rails is pretty good at handling the comparisons automatically though
[14:30:57] jstrong: where(date_field: date_time) usually works
[14:32:48] lexi87: I have a very noob question guys as I am not that experience with rails. I want to show all data from a table. I received a undefined method `each' for nil that is from the view at <% @animal.each do |a| %>. All code can be found here https://gist.github.com/anonymous/6715014
[14:33:31] lexi87: At first I was thinking @animal from the controller needs to be plural but that also did not fix it.
[14:33:33] ivanskie: good morning, good afternoon, good evening everyone
[14:33:37] defswork: lexi87, if animal contains multiple - make it plural - it's so much easier to read
[14:34:11] justanotherjason: strong.. i need to differentiate between different export_at times that are on the same date but different times, type date only has the current day, not time, correct?
[14:34:31] defswork: lexi87, you code as pasted will not result in @animal being nil
[14:34:40] defswork: lexi87, at worst it will be []
[14:34:55] defswork: lexi87, so methinks there is something missing
[14:35:39] jstrong: justanother: correct. thus if you want to differentiate times then date objects will never ever do the job
[14:35:43] justanotherjason: and i have never had problems with DateTime when using postgres, only mongo
[14:36:06] jstrong: ugh mongodb
[14:36:11] ivanskie: hey jstrong
[14:36:52] ivanskie: so hum, i get this interesting error when i run my bad code.. but interesting part is, it doesn't get to the bad code yet..
[14:36:52] ivanskie: it errors out on require 'CSV'
[14:36:52] ivanskie: https://gist.github.com/i5okie/6707426
[14:37:52] ivanskie: i thought maybe i should move this rb file to within my rails app folder..
[14:37:56] ivanskie: but that didn't change a thing
[14:38:35] EminenceHC: Does anyone use Ajaxified Ransack?
[14:38:45] jarib: ivanskie: try replacing "cat transform.rb" with "echo transform.rb"
[14:38:46] sevenseacat: ivanskie: you are doing way too much in that one line of shell code, because it thinks your ruby file is a filename
[14:38:58] sevenseacat: *thinks the contents of your ruby file
[14:39:11] jarib: although, transform.rb isn't a csv file
[14:39:20] jarib: yeah, sevenseacat is right.
[14:40:25] madnificent: pipework: for test runs, i sometimes use sqlite. but the test suite doesn't test concurrent access at all. so no, i wouldn't see this as a hint that sqlite is a good thing for production, it's a vastly different scenario. yet still, i didn't expect mysql to be much slower than sqlite in the scenario of the tests.
[14:41:16] pipework: madnificent: I asked about production though.
[14:41:29] pipework: What's the point of testing on a database you aren't going to actually use in production?
[14:41:41] jstrong: EminenceHD doesn't sound too complicated
[14:41:52] lexi87: defswork: Local Variables from error as following???local_assigns = {}, output_buffer = nil,
[14:41:52] lexi87: _old_virtual_path = nil, _old_output_buffer = nil, @_assigns = {"_routes"=>nil, "_db_runtime"=>0}. I am not sure if any of that text helps find out what went wrong.
[14:42:53] madnificent: pipework: activerecord makes an abstraction of most things in there. and even the custom SQL queries which I need in this project are nothing outside of the standard. but yeah sure, if you don't trust the SQL implementation on the server, there's nothing wrong with testing against it.
[14:43:29] madnificent: pipework: it really boils down to the amount of time it takes to run the tests, the amount of time it takes to write them and the security that gives you that the application runs correctly.
[14:43:42] pipework: madnificent: So does ruby. It's a C abstraction.
[14:44:12] pipework: madnificent: Run sqlite througha tmpfs, your test suite will run super fast, but it won't be anything similar to production.
[14:44:21] pipework: So the mental masturbation of it seems pretty pointless.
[14:44:21] madnificent: pipework: i'm not sure where you want to go with this
[14:44:38] madnificent: pipework: ah, i get it now
[14:45:49] madnificent: pipework: well, it's not speed masturbation. i find it annoying when a test suite takes a long time to run. when you're refactoring code you may suddenly break quite a lot of tests. a test suite which runs fast makes it quicker to find where things are going wrong and thereby makes the refactoring itself more fun. at least, in my experience.
[14:46:02] sevenseacat: thats why i hate when people get all like 'lets run our tests on a sqlite in-memory database!'
[14:46:20] sevenseacat: 'it'll be fast!' 'yes but your production server isnt running on an in-memory sqlite database'
[14:46:26] pipework: madnificent: Write better tests, don't change the environment to not match production as close as possible.
[14:46:55] pipework: Have a solid understanding of testing. Unit tests, integration tests, and functional tests.
[14:47:03] epochwolf: sevenseacat: I think that's a valid solution. Rails tests are slow.
[14:47:19] pipework: It relaly isn't.
[14:47:38] epochwolf: pipework: anything integration testing is slow
[14:47:44] epochwolf: unit tests are fast
[14:47:56] pipework: Integration tests are fasts.
[14:48:01] epochwolf: capybara? It's more like FatDyingWarthog
[14:48:05] madnificent: pipework: it's an optimization. a faster test suite which might possibly have some hole in it is well worth the speed for me. i will write more tests and thus have better overall coverage. for performance testing, it's obviously completely different and when you release a new version there may well be benefits of running against a very similar setup to the production setup. i'm not running on the server hardware e
[14:48:12] jstrong: ugh capybara
[14:48:19] epochwolf: jstrong: love capy
[14:48:24] pipework: capybara involves functional testing.
[14:48:32] sevenseacat: what good is a fast test suite if you cant have confidence that its working as it should
[14:48:40] pipework: madnificent: It's a choice. It's a wrong choice, but it's a choice.
[14:48:57] jstrong: optimize your tests the hard way
[14:49:04] jstrong: because that's the right way
[14:49:24] madnificent: pipework: it is not wrong. it is an optimization. i choose to spend more time writing good tests than spend time running them.
[14:49:31] pipework: It's wrong.
[14:49:36] madnificent: pipework: in a world where my time is worth exactly 0 cents, it would indeed be wrong.
[14:49:48] jstrong: madnificent: if a test fails sometimes just delete it
[14:49:49] pipework: Who cares if your test suite runs fast against an environment you don't run?
[14:50:05] jstrong: madnificent: it does you no good to have a test that sort of works, that creates false positives, false negatives, false confidence, etcf.
[14:50:08] pipework: madnificent: There are other tools and solutions to a fast test suite to sate your desire.
[14:50:15] madnificent: pipework: because the test suite will still catch 99.999% of the issues that the test suite in the correct environment would catch.
[14:50:23] pipework: I doubt it.
[14:50:24] ivanskie: member:sevenseacat: what do u mean?
[14:50:31] ivanskie: jstrong: echo didn't change really
[14:50:32] madnificent: pipework: enlighten me, i may not have all of them running :)
[14:50:42] cauffe: So how is the RoR job market these days?
[14:50:57] workmad3: cauffe: I had to sell my kidneys to afford coffee :(
[14:50:58] DoctorMonocular: I want to pass a variable from a create form to an AR model, but that var isn't persisted. I want to access my variable in after_initialize -- how can I do that?
[14:51:04] gavinjoyce: hi, is there such a thing as a beta gem for 4.1 active record?
[14:51:08] jstrong: cauffe: as usual. if you're good you can get a job if you can't you'll have a hard time
[14:51:14] gavinjoyce: there's a bug fix that I'd like to use
[14:51:15] jstrong: if you're not*
[14:51:22] cauffe: workmad3: why sell "your" kidneys when there is such a vast supply around you?
[14:51:23] pipework: madnificent: Distribution of work, isolation of concerns, and matching production as close as possible.
[14:51:36] madnificent: pipework: that's not an answer. that's your setup.
[14:51:40] workmad3: cauffe: dammit, I wish I'd thought of that before I got the scalpels
[14:51:42] madnificent: pipework: it's not even a setup.
[14:51:43] pipework: madnificent: No, that's an answer.
[14:51:50] cauffe: jstrong: so if im kind of a shity programer I should stick to PHP?
[14:52:03] tesmar: hi anyone, is there a gem out there for doing item packing into boxes for optimal fit?
[14:52:07] jstrong: cauffe: nope you should become a good programmer!
[14:52:20] cauffe: jstrong: not enough money for adderall atm...
[14:52:29] workmad3: gavinjoyce: not yet... but you can always use edge-rails directly from github
[14:52:31] pipework: Distribution of work, that's where you don't run your shit serially
[14:52:44] madnificent: pipework: i'm expecting something like: "i run the relevant tests automatically through guard on a remote server and it reports inside my editor"
[14:52:55] vanev: Quick question about model callbacks: I'd like to check to see if the "published" attribute on my model changed `after_save`. What's the best practice for doing this, since `self.published_changed?` returns false after_save.
[14:52:57] jstrong: cauffe: programming is one of the most results oriented fields I've ever seen, unless you're in some huge corporate structure.
[14:53:07] pipework: madnificent: You can use tools all you like, I'm sure you could look them up if you cared.
[14:53:08] gavinjoyce: @workmad3, thanks. I'm just using the activerecord gem though
[14:53:11] cauffe: jstrong: any tips for becoming a real programer?
[14:53:12] madnificent: pipework: because right now, i think you're saying what you want to have. not what you have.
[14:53:24] pipework: madnificent: You're confusing me for someone who has something to prove.
[14:53:27] madnificent: pipework: i do care! but i may be missing things (and that is honest)
[14:53:27] jstrong: cauffe: do something that you love and release it open source
[14:53:27] workmad3: gavinjoyce: you could always checkout the rails repo and build the gem manually then :)
[14:53:48] gavinjoyce: @workmad3, thanks. that's what i'll do so
[14:53:59] jstrong: cauffe: lol thanks for the funny pretend convo
[14:54:15] defswork: cauffe, real programmers copy and paste from mailling lists
[14:54:17] cauffe: im not trolling bro
[14:54:22] madnificent: pipework: no, you're telling my i'm doing something *wrong*. and when you say that here, i expect you to at least inform me how to do it *right*. because in my reality, you've completely ignored time in the equasion of develompent. and in my reality, time is kind-of important.
[14:54:31] cauffe: im really a PHP dev wanting to jump into RoR
[14:54:35] workmad3: defswork: pfft, that was 5 years ago
[14:54:45] workmad3: defswork: nowadays, real coders copy and past from twitter and facebook!
[14:54:51] jstrong: cauffe: ah!
[14:54:56] defswork: workmad3, you subscribe to rails mailing list ?
[14:55:03] defswork: it's rife on there
[14:55:07] workmad3: defswork: no... I should probably do that some time
[14:55:18] madnificent: cauffe: agile web development with rails used to be an awesome book to get started with, and i seriously doubt that the quality has changed. :-)
[14:55:19] jstrong: cauffe: if you want to learn learn ruby and rails, not just ruby on rails
[14:55:32] defswork: bit like BrazenBraden is doing on here ;)
[14:55:35] jstrong: cauffe: people start with rails and learn the surface but don't understand how the language works and that's a path down frustration
[14:55:37] sevenseacat: AWDWR is a horrible book
[14:55:38] pipework: madnificent: They're high level concepts. Sometimes, people might have a hard time understanding their implications and implementations. Some people use guard, I don't. I've used https://github.com/hashrocket/specjour a few times.
[14:55:40] sevenseacat: do not read it
[14:55:44] amarraja: Hi. How can I change a devise login template dynamically? Example here: http://pastebin.com/N8hnxXiC
[14:55:51] workmad3: sevenseacat: thank god I'm not the only one thinking that :)
[14:56:02] ivanskie: okay so i gone away from piping the initial file into my code..
[14:56:08] ivanskie: and now i this is what i get
[14:56:09] ivanskie: https://gist.github.com/i5okie/6707426
[14:56:09] helpa: cauffe: For a *FREE*, online book on learning Ruby On Rails, please see http://ruby.railstutorial.org/ruby-on-rails-tutorial-book
[14:56:09] workmad3: cauffe: !railstutorial
[14:56:31] cauffe: jstrong: madnificent: I've been living off two iOS apps for the last year and 1/2, but probably need to get a real job again soon. I know when I send my PHP portfolio out I get spammed with interview request... but I kind of hate how messy PHP is and how it doesn't adhere to any sort of MVC, and then the new DBO conventions are going to drive me batty
[14:56:35] amarraja: redone in pastie: http://pastie.org/8357496
[14:56:39] ivanskie: looks like convert_headers is not doing me anygood
[14:56:40] helpa: 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
[14:56:44] madnificent: pipework: any other gems i should look at?
[14:56:52] jstrong: cauffe: ruby will be a breath of fresh air then :)
[14:57:24] pipework: madnificent: if your'e into rspec, rspec-fire is nice for keeping mocks up to date.
[14:57:31] jstrong: cauffe: look there's no beating around the bush. the PHP market is something far bigger than the rails market,
[14:57:36] madnificent: kpipework: also, guard is handy if you want to run a limited set of tests automatically based on the changed files so you can quickly see what is still failing. at first sight (
[14:57:42] jstrong: cauffe: like, way bigger.
[14:57:44] sheeny: amarraja: if something render "something" else render "something" end
[14:57:46] cauffe: jstrong: but im a shit programer and I can get a PHP job easy, it sounds like you have to be good to get a ruy job?
[14:57:56] cauffe: and thanks workmad3 :) will look that over
[14:58:07] madnificent: pipework: sec phone
[14:58:23] pipework: I'm not a fan of it.
[14:58:28] sevenseacat: solution: stop being a shit programmer
[14:58:52] jstrong: when I look for jobs all the ruby/rails jobs are always more interesting.
[14:59:07] cauffe: much more interesting
[14:59:07] jstrong: so the job market is a bit more upscale and niche I'd say, ironically.
[14:59:34] cauffe: and its gotten to the point where you're going to have to start learning something like Node.js to combine with your PHP
[14:59:41] jstrong: ugh node.js
[14:59:47] cauffe: PHP just has no way to handle real time server events
[14:59:49] vanev: Quick question about model callbacks: I'd like to check to see if the "published" attribute on my model changed `after_save`. What's the best practice for doing this, since `self.published_changed?` returns false after_save.
[14:59:52] jstrong: Reinventing Threading Since 2012
[14:59:53] amarraja: sheeny: Thanks. I get "Render and/or redirect were called multiple times in this action" -- the super calls respond_with
[15:00:23] amarraja: sheeny: I can skip that call, but will lose the other stuff the devise controller does, no?
[15:00:25] madnificent: pipework: to continue the last statement which suddenly included a spurious <return>. it seems like you could integrate it with specjour which could be a nice setup.
[15:00:27] DoctorMonocular: vanev: you could do it before_save instead
[15:00:29] jstrong: nodejs is like apple, they're re-inventing the invention.
[15:00:33] cauffe: And I don't want to learn mongo DB
[15:00:47] vanev: DoctorMonocular: and then just make sure the model actually saved?
[15:00:47] cauffe: or any sort of nosql for that matter
[15:00:48] defswork: jstrong, I thought all the cool kids were doing node
[15:00:55] madnificent: pipework: any other gems i should look into?
[15:01:02] jstrong: defswork: of course! nodejs is web sscale
[15:01:06] cauffe: defswork: they moved on to Meteor js
[15:01:20] madnificent: defswork: you mean cool kids as in 'methheads'?
[15:01:29] jstrong: node js is bad ass rock star tech
[15:01:30] DoctorMonocular: vanev: I don't know what you're doing or if you need to check that it saved, but I do know that checking *_changed? will work before_save but not after_save
[15:01:32] cauffe: crack heads
[15:01:37] cauffe: meth heads stick to their PHP
[15:01:56] pipework: madnificent: I prefer to run my tests using more than a filesystem event.
[15:02:25] madnificent: cauffe: i think they should use Haskell (not that I dislike that). but haskel is *strongly* typed, and it warns the meth heads about anything that could happen, which is great if your paranoid.
[15:02:28] sheeny: amarraja: if you put 'super' at the top of the method and then just try putting render "something" and return that should work i think.. unless i think you can use return on renders
[15:02:29] BrazenBraden: defswork: you rang?
[15:02:39] madnificent: pipework: as in: you prefer to manually launch them?
[15:02:52] defswork: vanev, check the old_ value
[15:02:55] cauffe: madnificent: I actually learned a bit of Haskell to mod my xMonad interface in ArchLinux
[15:03:25] pipework: madnificent: I use my editor, mostly.
[15:03:27] madnificent: cauffe: same here. some time after that i switched to stumpwm and Common Lisp :)
[15:03:28] pipework: I'm a vimtard.
[15:03:34] amarraja: sheeny: nah, get the same thing
[15:03:39] cauffe: But yeah jstrong, my next iOS I was going to make a real time web-chat, and there was just no way to do it in PHP with out writing a lot of Perl or Node in the back end. I thought learning RoR instead of Perl or Node would be more sensable.
[15:04:00] jstrong: real time web chat with rails, hmmmm...
[15:04:01] defswork: vanev - published_was
[15:04:22] cauffe: madnificent: oh, hmm... The Stump looks really nice
[15:04:41] madnificent: pipework: emacs nerd here. i kind-of get that. i tend to let guard run it automatically so i can always see where I'm at. before i tag something, i tend to run the suite. (guard is smart enough to run the entire suite if a test failed initially that stopped failing)
[15:04:50] pipework: I used to be very much about using all the neat tools to get my tests running in multiple cores for multiple builds concurrently because I pressed save twice in 5 seconds, and getting feedback and cutting paths through my code depending on what my tests returned, but it's not worth it. It's constant stimulation, a mere primal stimulant. Intent is more powerful than reaction.
[15:05:16] vanev: DoctorMonocular: I need to uncache some pages if the article's published state has changed. I think I've got it now. Thanks everyone!
[15:05:23] jstrong: my tests right now run at 7 minutes locally
[15:05:24] pipework: ACTION is printed in the Continuous Testing with Ruby book. They renamed it to include Javascript too.
[15:05:25] jstrong: it's a total nightmare
[15:05:40] sheeny: amarraja: oh hmm
[15:05:45] sevenseacat: pipework: i saw :)
[15:05:48] cauffe: jstrong: there appears to be some decent web-socket handling in RoR , which seems to be the only way to do web chat these days
[15:05:49] madnificent: cauffe: i think we should now bring up a rails window manager before we get banned from the channel. stump works for me because i know lisp by heart and so it's relatively easy to get it to what i want it to do.
[15:06:02] cauffe: is there one?
[15:06:02] sevenseacat: ACTION only got printed in the seven databases book
[15:06:33] madnificent: pipework: highly dependent on the way the reporting happens, but i mostly concur
[15:06:52] workmad3: sevenseacat: by 'printed' do you mean mentioned somewhere?
[15:07:01] amarraja: sheeny: basically, you can log in on the site, or via a lightbox pop out (loads in an iframe) so I need two login templates. I think this is the right way of going around it?
[15:07:08] sevenseacat: yeah, in the acknowledgements. i did some technical reviewing while it was in beta.
[15:07:08] bobbobbins: hey, does staging have caching on by default?
[15:07:16] speakingcode-wor: random question: is rails the largest open source ruby project?
[15:07:16] workmad3: sevenseacat: ah, I'm in the r3ia book for that :)
[15:07:21] cauffe: Anyone here done any chat apps in RoR?
[15:07:25] sevenseacat: just like pipework in the continuous testing book
[15:07:31] pipework: madnificent: I used to use toast-like tools, a separate ptty, a gutter in vim, they're all :( because you're really just feeding a need for stimulation. That seems a bit sad to me.
[15:08:20] ivanskie: okay so I got it to spit out stuff..
[15:08:22] ivanskie: but its not right
[15:08:25] ivanskie: https://gist.github.com/i5okie/6707426
[15:08:26] mikecmpbll: i'm not in a book.
[15:08:45] sevenseacat: mikecmpbll: try harder!
[15:08:53] pipework: I prefer to make cogent and conscious steps forward with intents and thoughts, not be driven by some mad lust for the blinky lights to give me something to do.
[15:08:54] sheeny: amarraja: ah okay, it seems you need to just specify the layout.. like.. http://stackoverflow.com/questions/4412018/rails-devise-how-to-render-login-page-without-a-layout
[15:09:07] boytoy: Is there a way to mangle my HTML/CSS classes and IDs like Google does?
[15:09:08] sheeny: amarraja: so you would have layout :layout then a layout method which has that logic in it
[15:09:17] mikecmpbll: i've set myself a target of at least one book mention by 2015.
[15:09:29] jstrong: cauffe: ironically that's one of those cases where ??? node is actually kind of okay.
[15:09:29] pipework: boytoy: how do they?
[15:09:42] amarraja: sheeny: need to change the page as well as the layout though
[15:09:56] sevenseacat: ACTION puts in another pragprog order
[15:09:59] cauffe: the authentication in Node is kind of poor right now
[15:10:05] amarraja: sheeny: could just have an if statement in the new.html.erb and render the two templates as partials
[15:10:09] workmad3: ivanskie: no, it's not right... because you're echoing out ruby hashs as strings, not writing out a CSV file
[15:10:09] madnificent: pipework: i have guard running in a separate buffer which i can jump to if needed. and there's a tool (which doesn't work great) which tells me how many tests have failed in the modeline (where the time is etc, so it doesn't distract you when the few pixels change to list a different number). it's enough to tell me something went haywire. anything that jumps in my eye would indeed be terrible. attention is a fragi
[15:10:11] pipework: sevenseacat: Whatcha gonna get?
[15:10:17] boytoy: pipework: eh?
[15:10:22] sevenseacat: seven web frameworks in seven weeks, for a start
[15:10:31] sevenseacat: probably seven languages as well, i dont have that one
[15:10:35] madnificent: pipework: if you have other gems or things of the like, feel free to share them.
[15:10:37] pipework: I was thinking about the frameworks one.
[15:11:04] pipework: madnificent: These days, I'm mostly spending my testing efforts on a different approach I previously disliked.
[15:11:08] sevenseacat: oh damn there's a crafting rails apps for rails 4 now
[15:11:41] sheeny: amarraja: yep
[15:11:51] sevenseacat: tempted to get the erlang and clojure books but i'd never read them
[15:12:04] workmad3: sevenseacat: just like me with my scala book
[15:12:04] pipework: madnificent: Functional testing where your input is text and your output is text. Very unix-like. All about composability in a service oriented architecture.
[15:12:10] sevenseacat: oh yeah scala too.
[15:12:23] workmad3: my scala book was a freebie though
[15:12:24] tubbo: eff erlang
[15:12:28] tubbo: we have elixir
[15:12:32] ivanskie: workmad3: i tried doing item row.to_csv but that's not good either
[15:12:36] madnificent: pipework: how does that fit in rails development?
[15:12:38] pipework: You test inputs give expected outputs, and however you arrive at that point is just however you get there. The only things that matter are expected outputs and speed.
[15:12:43] ivanskie: rather it complained that it didn't know what to_csv is
[15:12:50] workmad3: ivanskie: did you consider using the CSV gem to write out a CSV file?
[15:13:01] workmad3: ivanskie: you know... like it's been created to do...
[15:13:06] tubbo: workmad3: csv...gem?
[15:13:13] madnificent: pipework: i once wrote is-right (for common lisp) which helped in such testing in an interactive manner. :)
[15:13:13] tubbo: isn't CSV just part of the stdlib now?
[15:13:13] elaptics: workmad3: s/gem/standard library
[15:13:14] workmad3: tubbo: sorry, csv library :)
[15:13:16] pipework: madnificent: A request is a textual input, a response is a textual output.
[15:13:29] tubbo: been a while since i worked w/CSV just wanted to be sure
[15:13:34] ivanskie: i just need to transform a CSV file, and replace one of the column's values with cross-referenced column from another CSV file
[15:13:40] ivanskie: before.. i import it into my rails app
[15:13:47] workmad3: ivanskie: yes
[15:13:47] pipework: It requires you set reasonable bounds for a given system.
[15:13:49] defswork: ivanskie, nawk ftw
[15:13:59] workmad3: ivanskie: I'm well aware of what you're doing ;)
[15:14:04] madnificent: pipework: and any change breaks the test, or do you search for a string in the response?
[15:14:17] ivanskie: I'm sure everyone is after last week and few days
[15:14:25] workmad3: ivanskie: and I'm saying... use CSV to write your new CSV file, don't just echo some random crap out and pipe it into a file
[15:14:26] elaptics: tubbo: think csv has long been part of stdlib but for 1.9 the faster csv gem replaced the old csv library but continued to be just 'csv'
[15:14:39] pipework: madnificent: Any change won't break the test unless it affects output.
[15:14:40] workmad3: elaptics: pretty much :)
[15:14:54] pipework: madnificent: Programming is just coming up with increasingly complex ways to output strings.
[15:15:04] madnificent: pipework: right. i was thinking about adding some indentation to a layout file.
[15:15:19] ivanskie: well if I'm going to use a CSV gem??? that means i'll have to rewrite this code into a controller somewhere..
[15:15:24] justanotherjason: strong.. so my date time problem i partially have figured out.. this works??? thanks to your nanosecond suggestion.. how can i write this better? http://pastie.org/8357544
[15:15:32] ivanskie: which brings me back to doing the swap of clumns during import right?
[15:15:36] ivanskie: probably not
[15:15:53] ivanskie: man this can't be this difficult lol.
[15:15:54] workmad3: ivanskie: you're already using the CSV library to read the file
[15:16:00] workmad3: ivanskie: use the same library to write a new one
[15:16:08] pipework: madnificent: We would catch that and show you the diff inline with red highlighting just the one line with the whitespace. "+ <red whitespace here><original code>"
[15:16:10] ivanskie: which is where i tried to_csv
[15:16:14] pipework: The + indicates additions.
[15:16:16] workmad3: ivanskie: try reading the docs instead
[15:16:18] ivanskie: which i assumed to be from the same library
[15:16:32] mlegacy: you know guys, i really hate server administration...lol
[15:17:07] madnificent: pipework: not bad. is there a gem published on it? not that i'm going to try it right away, but it could be a good approach to revisit later.
[15:18:00] pipework: madnificent: I can look at our setup and see if we can gem it up. It's currently a shared setup that hasn't been codified.
[15:19:09] ivanskie: i was doing CSV.open[], but someone suggested that it's not the way to write csv to a file in this case
[15:19:18] madnificent: pipework: do you have a channel on which you'd announce such a thing? for me personally, it's not worth publishing it right away as i'll likely not look into it in the first 2 months or so, but i'd like to keep track.
[15:19:22] ivanskie: I'm not sure if it ever worked for me actually
[15:19:42] pipework: madnificent: http://github.com/Spaceghost probably.
[15:21:10] madnificent: pipework: thanks
[15:23:06] ivanskie: i think I'm about to make it work
[15:23:12] ivanskie: its sthinking
[15:23:43] mlegacy: if anyone could help with this: http://stackoverflow.com/questions/19031687/trying-to-get-my-ror-site-up-and-running-getting-a-404
[15:23:48] mlegacy: that would be amazing...
[15:25:05] mikecmpbll: where's your vhost.conf file located?
[15:25:29] ivanskie: okay that was good hope
[15:25:42] ivanskie: but i stopped the process to find the end file empty
[15:26:26] ivanskie: i kinda wish it worked, cause i just cleaned up the code a little, and it looks beautiful
[15:26:28] ivanskie: https://gist.github.com/i5okie/6707426
[15:26:34] ivanskie: but nope :(
[15:27:07] mlegacy: mikecmpbll: /var/www/vhosts/gregorymurray.com
[15:27:08] mlegacy: httpd.conf is obviously located /etc/httpd/conf
[15:27:11] mlegacy: mikecmpbll: /var/www/vhosts/gregorymurray.com
[15:27:13] workmad3: ivanskie: you know a lot of file-reading and writing is buffered in ruby, and killing it probably meant it was never flushed out to the file... right?
[15:27:38] mikecmpbll: mlegacy: i think the ghosts are meant to be in the apache directory somewhere
[15:27:39] ivanskie: i need to sniff inside, so gonna escape the saving to file for a se
[15:27:44] mikecmpbll: vhosts* nice spell checker, nice.
[15:27:48] ivanskie: and see if that hash is actually doing what i want it to do
[15:27:49] godd2: mlegacy: can you pm me? I have Rails running on CentOS on a VPS with Passenger, I can probably help
[15:27:51] ivanskie: or have rather
[15:27:57] workmad3: ivanskie: also, you'll want to open the file outside the CSV loop
[15:28:01] mikecmpbll: oh, pm godd2, i don't even use apache.
[15:28:20] mlegacy: awesome thanks
[15:28:24] workmad3: ivanskie: i.e. move line 16 to above line 14 of that gist
[15:28:42] workmad3: ivanskie: as it currently stands, you re-open the output file each time you read a new row from the source CSV
[15:28:52] workmad3: ivanskie: and you're opening it with 'w', so it gets truncated and replaced
[15:29:01] ivanskie: yah makes sense
[15:29:31] ivanskie: okay i just looked into the output file.
[15:29:34] ivanskie: it's working
[15:29:54] ivanskie: instead of giving me vendor id, its inserting this: "{""15""=>0.0}"
[15:30:24] ivanskie: so gotta look at that code
[15:31:07] workmad3: ivanskie: yeah, you've screwed up line 11 ;)
[15:31:39] ivanskie: vendors[row.fields[1]] = Hash[row[0], row[1]]
[15:31:41] workmad3: ivanskie: you want 'vendors[row[0]] = row[1].to_i ' there
[15:31:43] ivanskie: this didn't fix it..
[15:32:48] ivanskie: that didn't work
[15:32:55] ivanskie: it's not outputting id
[15:33:01] ivanskie: its actually not outputting anything
[15:34:01] workmad3: ivanskie: ah, sorry, vendors[row[1]] = row[0].to_i
[15:34:22] workmad3: ivanskie: although you should have noticed that my original version was using the ID as a key and trying to cast the name to an integer as the value :P
[15:34:47] ivanskie: got distracted
[15:34:48] workmad3: ivanskie: then why didn't you change it? :P
[15:34:57] ivanskie: or some sort of an excuse like that
[15:35:23] scriabin: https://gist.github.com/chewmanfoo/6715914 - what do I need to think about to make a find function chainable?
[15:35:29] scriabin: anybody done this?
[15:36:33] workmad3: scriabin: for starters, you need to wrap your first set of results up in another ServersFileEngine and return that
[15:36:54] workmad3: scriabin: currently, you're returning a plain array from your #find, and the find on an array has a different signature to your own version
[15:36:58] scriabin: that's what I thought but it seemed like a lot of heavy lifting
[15:37:33] workmad3: scriabin: unless you're going to modify the internal array and return the same object, that's what you need to do
[15:37:57] workmad3: ivanskie: finally :P
[15:38:07] ivanskie: oh its been yeaars
[15:38:23] ivanskie: decades that been trying to get this going
[15:38:30] ivanskie: thanks guys, workmad3
[15:39:31] ivanskie: this has been a great learning experience hha :)
[15:39:47] ivanskie: next on the list, is paginating 297k items into the index.html.erb lol
[15:39:57] jstrong: just use kaminair
[15:40:11] jstrong: https://github.com/amatsuda/kaminari
[15:40:59] ivanskie: oh yeaaa. I'm gonna try that
[15:41:52] ivanskie: u know what i just realized
[15:42:13] ivanskie: all this work, and I'm still going and clicking select file and clicking Import on my app??? *palmface*
[15:42:19] thoraxe: config.autoload_paths += %W(#{config.root}/extras) <-- does this load files that would be in approot/config/extras/ ?
[15:43:20] ivanskie: pgadmin here i come with my little friiieend, csv file
[15:43:26] jstrong: thoraxe: nope!
[15:43:29] jstrong: approot/extras
[15:43:40] thoraxe: oh i read that wrong
[15:43:52] thoraxe: config.root i read as "config root" and not "look for the root in config"
[15:44:09] jstrong: Rails.root.join("config", "extras")
[15:44:29] workmad3: jstrong: you can do Rails.root + "config/extras" btw :)
[15:44:40] jstrong: but I like join more!
[15:44:42] thoraxe: hmm, it doesn't seem to be working though
[15:44:45] jstrong: *defiant face*
[15:44:58] scriabin: workmad3:thanks that's perfect
[15:45:21] pipework: "#{Rails.root}config/extras"
[15:45:32] pipework: So many ways
[15:45:39] jstrong: and you chose the ugliest of them all
[15:45:54] pipework: Naw, I bet I could do worse.
[15:46:01] pipework: Something with String.new and lots of <<
[15:46:17] workmad3: jstrong: nah, the ugliest would be "#{RAILS_ROOT + File.join("config", "extras")}"
[15:46:18] ivanskie: well pgadmin is not as magical as i expected
[15:46:46] ivanskie: it found an extra column, and it freaked out at me.. and now it has this error in my face, and i can't even click ok??? how rudee
[15:47:15] pipework: String.new("#{RAILS_ROOT + File.join('config', 'extras')})
[15:47:16] ivanskie: k ima go clean up my csv file
[15:47:24] ivanskie: wand insert the missing timestamps
[15:47:50] thoraxe: http://pastie.org/8357631
[15:48:13] thoraxe: i set what i think should be autoloading files from extras but it doesn't appear to be loading that file
[15:48:28] thoraxe: unless rails 3 is so drastically different that that mamas boy routine won't work now
[15:50:19] jcromartie: when I run my app in production mode, all of my asset links (i.e. from my layout) are to "/assets/???", but precompiled assets are in "/public/assets/..."
[15:50:39] workmad3: jcromartie: correct
[15:50:46] jcromartie: so, how is it supposed to work?
[15:50:54] workmad3: jcromartie: because urls != file system paths
[15:50:56] jcromartie: I mean, that's how it's supposed to work, but the app is broken
[15:51:08] workmad3: jcromartie: are you trying to run with 'rails s production'?
[15:51:11] thoraxe: jcromartie: did you rake assets:precompile ?
[15:51:18] jcromartie: I did precompile
[15:51:33] jcromartie: RAILS_ENV=production rails s
[15:51:34] workmad3: jcromartie: because the default rails config turns off static file serving
[15:51:41] workmad3: jcromartie: when in production
[15:51:44] jcromartie: so the default rails config doesn't work?
[15:51:46] jcromartie: nice defauls
[15:51:48] workmad3: jcromartie: it does
[15:51:50] thoraxe: jcromartie: so when you say the thing doesn't work, what specifically isn't working? are assets not being loaded?
[15:51:58] workmad3: jcromartie: the defaults are intended for serving behind a web server
[15:52:06] jcromartie: I mean the path "/assets/foo.js???" is a 404
[15:52:08] workmad3: jcromartie: because serving static files up from a rails app is ridiculous
[15:52:21] thoraxe: jcromartie: are you talking to the app directly on its port? (webrick, thin, etc)
[15:52:30] thoraxe: there's your problem
[15:52:32] jcromartie: so the defaults require URL rewriting
[15:52:36] workmad3: jcromartie: no
[15:52:45] thoraxe: no, the defaults expect a different server configuration
[15:52:47] workmad3: jcromartie: it wouldn't work even if you did public/assets/...
[15:52:54] thoraxe: i.e. apache proxying connections into your app and static serviing the content
[15:53:20] jcromartie: so the web server must be configured to serve requests to "/assets/..." from the public/assets/ directory
[15:53:26] workmad3: jcromartie: yes
[15:53:29] thoraxe: so you must either configure apache appropriately or modify your default "production" configuration if you intend to speak directly to webrick
[15:53:44] jcromartie: that makes sense, but I wish I could just run "rails server" in production config with webrick
[15:53:46] thoraxe: s/apache/$YOURWEBSERVER
[15:53:49] ivanskie: whats the correct way to insert timestamp into a csv file??? Time.now, or?
[15:54:03] ivanskie: how does rails store these in db
[15:54:13] thoraxe: you can just run "rails server" in production with webrick, if you're front-ending it with a properly configured apache
[15:54:18] thoraxe: i.e. in a realistic production scenario
[15:54:21] workmad3: ivanskie: I'd probably do 'DateTime.now.iso8601' to get them in
[15:54:48] workmad3: ivanskie: you might need to do 'require "date" ' for that to work ;)
[15:54:53] thoraxe: a) using webrick in production isn't all that realistic to begin with and b) you can probably just modify one config file to fix the behavior you're expecting for
[15:54:55] ivanskie: oh that looks more like it, do i still require 'time'.. ah
[15:55:23] thoraxe: http://pastie.org/8357631 any thoughts on why my module stuff doesn't appear to be being loaded by the autoloader?
[15:56:06] thoraxe: jcromartie: do you intend, in "production", for consumers of your application to be talking directly to webrick on its port?
[15:57:26] thoraxe: hmm, i just created a simple function that returns "42" and placed it in config.root/extras and it still seems like it's not being loaded
[15:57:42] workmad3: thoraxe: because autoloading != eagerloading
[15:57:42] workmad3: thoraxe: autoloaded stuff is lazilly autoloaded when the constant is first used
[15:57:42] workmad3: thoraxe: and depends on following rails naming conventions... two things you aren't doing there ;)
[15:57:57] jcromartie: thoraxe of course not
[15:58:01] workmad3: thoraxe: correct... because you never reference anything that would cause that file to be loaded
[15:58:13] jcromartie: I'm just trying to get a handle on a precompiled asset issue
[15:58:16] workmad3: thoraxe: remember... *lazy* auto-loading
[15:58:18] thoraxe: jcromartie: so then why are you worried that "rails s production" doesn't "work right"?
[15:58:55] thoraxe: workmad3: i guess i don't understand the lazy part. how would anything ever get lazy loaded then? i'm asking for a function that's declared in one of those files
[15:59:12] thoraxe: workmad3: sounds like it's all a convention problem on my part?
[15:59:19] thoraxe: i guess I need to be eager loading the extras folder?
[15:59:26] workmad3: thoraxe: lets say you had a file... say, 'app/models/foo_bar.rb' and it declared a class or module called FooBar
[15:59:59] workmad3: thoraxe: the first time you tried to reference FooBar, the autoloading would kick in, find the file 'foo_bar.rb' and load it, then pass you back the FooBar constant
[16:00:12] workmad3: thoraxe: that's the lazy part, and the autoloading part
[16:00:48] workmad3: thoraxe: as opposed to eager loading, which would pre-emptively go through all files and load them as soon as possible
[16:00:58] thoraxe: ok, but in this case I'm actually extending some of rails defaults, so i will need to be eager loading that stuff
[16:01:35] workmad3: thoraxe: correct, or manually requiring the file in an initializer to avoid differences between dev and production with autoloading and eager loading
[16:01:41] thoraxe: becuase when it tries to load up the model that contains the reference to what's in my stuff (acts_as_mamas_boy foo), it hasn't loaded those extensions yet, but also doesn't know that it's supposed to load them, it seems
[16:01:51] thoraxe: ah, never thought of that (initializer)
[16:01:51] workmad3: thoraxe: correct
[16:02:04] thoraxe: could I just shove all that code in an initializer, or would that not be considered "correct"?
[16:02:14] ivanskie: I'm getting extra data after last expected column
[16:02:18] ivanskie: whats it talking about !?
[16:02:19] workmad3: thoraxe: I'd personally put the code in lib/ and require it in an initializer
[16:02:43] jcromartie: when I set config.assets.prefix to any value, my asset link URLs suddenly go from e.g. "/assets/application-0728066adf371f5c557fa51cadede844.css" to "/stylesheets/application.css"
[16:02:51] jcromartie: it doesn't matter what I set config.assets.prefix to
[16:04:07] ivanskie: easy fix tho
[16:04:35] baggypants: hi guys???if i have a method in my ApplicationController called def signed_in????how can i call that in rspec? i keep getting undefined local variable or method
[16:04:44] jcromartie: I'm reading conflicting documentation on this??? "??? config.assets.prefix. By default, this is the public/assets directory" vs. "the location specified in config.assets.prefix ('/assets' by default)"
[16:04:58] workmad3: jcromartie: what are you trying to set it to?
[16:05:05] thoraxe: workmad3: forgive me for being ruby/rails dumb here. what would that require line look like? is it literally just require "%W(#{config.root}/lib/foo.rb" ?
[16:05:09] jcromartie: public/assets
[16:05:19] ivanskie: that COPY is instanteneous
[16:05:26] ivanskie: u guys weren't kidding haha
[16:05:28] workmad3: jcromartie: if you really want that, then set it to '/public/assets'
[16:05:30] jcromartie: I don't know why it changes the behavior of the URL generation like that
[16:05:46] workmad3: jcromartie: because you're setting it to a relative prefix... I have no idea how that will screw things up
[16:05:56] jcromartie: the CSS URL is still /stylesheets/application.css
[16:06:15] workmad3: jcromartie: you'll also need to redo the precompile after changeing that
[16:06:16] thoraxe: jcromartie: did you restart the server?
[16:06:33] jcromartie: yeah, but I didn't precompile assets
[16:06:41] jcromartie: now that I did, it gives a more sane URL
[16:06:54] jcromartie: to /public/assets/application-0728066adf371f5c557fa51cadede844.css
[16:07:07] workmad3: jcromartie: right... and that'll be in the folder public/public/assets/
[16:07:10] workmad3: in your rails app
[16:07:29] jcromartie: OK I'm going to stop fighting this
[16:08:10] workmad3: jcromartie: and as I said, it wouldn't matter if your url was /public/assets or not... in the default production settings, your rails stack won't serve static files
[16:08:22] jcromartie: yeah :| I got it
[16:08:22] ivanskie: so i see kaminari paginates pages??? but how can i use bootstrap pagination by the table?
[16:08:26] workmad3: jcromartie: that means it won't even look at the public directory for files to serve... it just *won't* serve them
[16:08:29] ivanskie: or its the same?
[16:08:58] workmad3: jcromartie: however, if you were paying attention when playing with your environment settings, you may have noticed the line you wanted to tweak in there :P
[16:09:04] workmad3: jcromartie: it's just not advised
[16:10:46] ivanskie: time to branch out into pagination world
[16:11:40] thoraxe: require "#{RAILS_ROOT}/lib/acts_as_mamas_boy" <-- with this in my initializer, i get an unknown constant RAILS_ROOT
[16:11:51] workmad3: thoraxe: lib/ is already on your load path
[16:12:00] ftj: Anyone here use knockout with Rails? I want to use it for just one view in a very complex form in an admin panel (three related models, one of which has a number of instances on one page), and I'm not sure where to get started. Right now, I'm initializing my viewmodel with erb, but that seems hacky and wrong. (For example: new Annotation(<%= "#{a.x_pos}, #{a.y_pos}, #{a.id}, 0" %>))
[16:12:03] workmad3: thoraxe: you only need to do 'require "acts_as_mamas_boy" '
[16:12:07] ftj: If anyone could give me a bit o guidance, it'd be much appreciated.
[16:13:13] thoraxe: workmad3: well there you go. thanks for that
[16:17:24] elaptics: thoraxe: also it's now Rails.root
[16:17:43] elaptics: for future reference :)
[16:18:31] Zesty: This is probably a stupid question but is it possible to run a capistrano task on the server itself? I'm using capistrano-unicorn which works beautifully, but I'm trying to figure out how to monitor the unicorns. i was going to use monit
[16:18:42] Zesty: but this is only a capistrano deploy hook. im not sure how to utilize this gem to also monitor
[16:21:51] justanotherjason: anyone know how to make 2013-09-26 16:03:52 UTC = 2013-09-26T16:03:52.998Z ISODate
[16:23:08] ivanskie: pagination works..
[16:24:42] jcromartie: justanotherjason: look at Time.iso8601
[16:27:28] jcromartie: but it leaves off the Z
[16:27:31] ivanskie: guys, search gem?
[16:28:01] ivanskie: i got kaminari working. wondering how to get a search field.. maybe with instant results as i type?
[16:28:14] ivanskie: would like to at least get a search going
[16:28:21] ivanskie: then leave ajax stuff for last
[16:28:30] elaptics: ivanskie: take a look at the ransack gem
[16:28:59] bbloom: I have a static javascript-app in a zip. What's the easiest way to integrate such a zip in to the asset pipeline?
[16:29:39] bbloom: My app has images, styles, etc, but they are all cleanly namespaced, so it should be safe to host the app in a div as long as i can require & call the javascript's main method
[16:30:53] dbcclarke: how do I change the default page for my app?
[16:31:08] dbcclarke: I know its in routes...but what do I do?
[16:31:19] elaptics: dbcclarke: you mean the root route?
[16:31:52] elaptics: dbcclarke: you just change/set it, e.g. :root, :to => "controller#action"
[16:31:52] mbd2: Hi all. I'm trying to troubleshoot a assets:precompile error on a server. Assets compile on dev box. Any tips? I've no idea how to troubleshoot...
[16:32:12] dbcclarke: relaptics: right now its "welcome#index"
[16:32:26] dbcclarke: elaptics: right now its right now its "welcome#index"
[16:32:37] ftj: dbcclarke What do you want to change it to?
[16:33:20] ftj: ACTION dbcclarke If it's the "edit" action in your "posts" controller, for example, you should have:root, :to => "posts#edit"
[16:33:34] ftj: dbcclarkeOops: :root, :to => "posts#edit"
[16:33:41] ftj: Ah shit. Sorry, folks.
[16:33:48] ftj: dbcclarke :root, :to => "posts#edit"
[16:35:09] uuuuh: Hello, I'm using shoulda-matchers in order to be able to 'it { should set_the_flash }' , however there seems to be an error i cant trace https://gist.github.com/git-toni/6716685
[16:36:42] DoctorMonocular: well, that's annoying
[16:36:48] dbcclarke: ftj: I want to change it to "book#show"...
[16:36:58] DoctorMonocular: model and controller concerns collide with each other
[16:37:01] DoctorMonocular: they have to named differently
[16:37:18] dbcclarke: why do I have to erase the index.html file in order to change the root?
[16:37:59] DoctorMonocular: dbcclarke: anything in the public directory get presidence over routes
[16:38:17] dbcclarke: Ahhh ok..i didnt know that. Thanks DoctorMonocular
[16:38:27] DoctorMonocular: rails checks the directory for anything that matches, THEN checks routes
[16:42:51] uuuuh: Hello, I'm using shoulda-matchers in order to be able to 'it { should set_the_flash }' , however there seems to be an error i cant trace https://gist.github.com/git-toni/6716685
[16:44:27] uuuuh: I do have 'gem shoulda-matchers' in my Gemfile, and I'm using rspec-rails -v 2.10
[16:45:36] dbcclarke: When I changed my app root route... I got a Mysql2 error... "unknown database" - how do I make the database? I thought I made it correctly.
[16:46:25] DoctorMonocular: your mysql service has to be running, your database config file has to be correct, and you probably need to run db:create db:migrate before it'll all work
[16:46:37] dllama: anyone here familiar with nginx?
[16:46:47] dllama: or rather debugging nginx/unicorn
[16:46:47] bobbobbins: i'd imagine most people here are
[16:47:05] dllama: getting an upstream prematurely closed connection error :/
[16:47:29] dllama: never seen this before. and google mostly points @ php, but this is with unicorn
[16:48:22] roymiloh: did anyone here switch from django to rails?
[16:49:15] foucist: roymiloh: maybe it's just better to ask a specific question instead
[16:49:49] uuuuh: Using shoulda-matchers in order to be able to 'it { should set_the_flash }' , there seems to be an error i cant trace https://gist.github.com/git-toni/6716685
[16:50:07] uuuuh: I tried with different versions of 'rspec-rails'
[16:50:44] ivanskie: ok search looks too complicated for now.
[16:50:56] roymiloh: foucist: well, I have heard that there are some similarities between the frameworks and between the languages so it would be easier to start learning.
[16:51:26] foucist: roymiloh: sounds like the kind of thing somebody would've done a writeup on :P
[16:51:43] ivanskie: i just need a simple search.. looks like ransack is designed for crazy advanced searching???, and pg_search, doesn't have view example..
[16:51:52] ivanskie: I'm not sure what to do
[16:52:00] foucist: roymiloh: but i guess the main similarities is gonna be the MVC structure & the ruby/python similarities
[16:52:58] foucist: ivanskie: well there's other gems too
[16:53:11] ivanskie: i was looking at toolbox or what not
[16:53:45] ftj: I have a question about ordering records. I have a list of Annotations per Product that I'd like the user to drag and drop in a list and have the order the user chooses persist in the DB. The lists will all be short (under 10 members). Is the best way to do it simply to add a sort_order column to the table and update all n records every time the user drags one?
[16:53:57] roymiloh: foucist: well, yes, i know there are some resources around the net, unfortunately i haven't found a quality one.
[16:54:06] clocKwize: anyone know how to set request headers in a rspec request test...
[16:54:09] roymiloh: maybe some guys here know about..
[16:54:23] clocKwize: request is nil, so I can't do request.headers["X"] as people suggest on SO
[16:54:30] clocKwize: but I can get/post/put etc O.o
[16:54:50] foucist: ivanskie: rails 3 or 4?
[16:57:17] foucist: ivanskie: no idea.. if it was rails 3 i might've suggested acts as ferret, not sure if that'll work out of the box with rails 4
[16:57:34] ivanskie: and then i need to create almost like a shopping cart sort of thing, to be able to save "packages", and later make a "package builder" of like add a server to package, add ram, hard drives, add software licenses..
[16:57:56] ivanskie: then save as package..
[16:58:02] ivanskie: then make proposals with different packages
[16:58:17] ivanskie: and save proposals, and export as pdf
[16:58:22] ivanskie: already have pdf export functionality
[16:58:43] ivanskie: i'll take a look at ferret
[17:00:44] fcanela: Hi. I have been an hour fighting with some assets that appears BOTH inside application.js and linked
[17:00:45] tylersmith: if you don't mind running a search server, I love ES and it's easy to use. Especially with Tire.
[17:00:53] pipework: ES is neat.
[17:00:54] fcanela: You can see here the html output: https://gist.github.com/fcanela/7ebc9bf958c4c92bf49f
[17:01:01] ivanskie: so with ransack, i Don't HAVE to do a complex search..
[17:01:15] ivanskie: i can just do single parameter, and then expand into more complex if i need to eh
[17:01:26] fcanela: They are already inside in application.js, I want to avoid all others being linked
[17:02:02] fcanela: Assets_sync is doing nice uploading only application.js, but do not know why sprsocket is including script tags to all scripts
[17:02:11] fcanela: instead of linking just application.js
[17:02:32] ivanskie: show dude. i can totally use ransack
[17:06:27] ivanskie: so i have pagination going on??? @items = Item.order(:name).page params[:page]
[17:06:39] ivanskie: how do i have that work, if search result is empty?
[17:07:38] ivanskie: cuz normally you'd just do @items = @search.result
[17:08:13] ivanskie: @items = @search.result || Item.order(:name).page params[:page]
[17:09:36] dopie: Ok here we go
[17:09:43] dopie: i got an annonying one
[17:10:45] dopie: https://gist.github.com/gists
[17:10:57] dopie: its asking for authenticate_user! but I have no user
[17:11:03] dopie: https://github.com/SammyLin/redactor-rails
[17:11:12] metus_violarium: Hello, what can I do with the next? WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.9.0
[17:11:21] dopie: I removed the user_id from the migration
[17:11:31] pskrz: metus: uninstall and reinstall nokogiri gem
[17:12:32] metus_violarium: pskrz: it didn't help
[17:12:55] metus_violarium: pskrz: I have a frash rvm on frash system - opensuse
[17:13:19] pipework: My condolences.
[17:13:22] pskrz: metus: upgrade libxml to version 2.9.0 then try uninstall/reinstall
[17:14:38] ftj: In a has_many through association, should I be able to access the thing the object has many of directly? i.e., if a Look has_many :products, through: :annotations, should I be able to just do @look.products?
[17:14:50] ftj: I'm getting this error when I try that: uninitialized constant Look::Products
[17:16:53] Xander1: need help with CanCan set up: I have 2 roles: user and business, and I'm using Devise + CanCan, need help to set it up so that user that has a role of :user can only view and edit their own registration, but a user that has a role of :business - can view everyone, edit only their own registration info
[17:17:00] Xander1: https://gist.github.com/anonymous/54ff5bd7b9348ba732a1
[17:29:47] fcanela: stupid question mine, after reading about assets pipeline I realized why
[17:30:20] fcanela: I did before, but never noticed that assets linking works differently in production and development
[17:35:22] tetraktys: Hey guys, i'm trying to implement a facebook registration in my rails app, but i want to separate certain data into an 'employee' model in stead of saving everything in the user model. When i register a new user it is not yet associated with an employee but the build method as shown in the gist fails: https://gist.github.com/joostvanrijn/6717626
[17:37:38] RustyShackleford: So you know how you can declare some instance variables in a controller, then access them in your erb code?
[17:37:47] RustyShackleford: can you do something like this but for javascript?
[17:38:19] pipework: You preferably don't.
[17:38:23] tubbo: tetraktys: you should probably do employee = user.employee.build(first_name: auth.extra.raw_info.first_name)
[17:38:43] tubbo: RustyShackleford: not really.
[17:39:15] tubbo: RustyShackleford: wouldn't it be better to have JS call your backend route asynchronously?
[17:39:28] tetraktys: tubbo, thanks, i'll give it a shot
[17:39:31] tubbo: so if you want to share @post = Post.first with the frontend, you could just render json: @post
[17:39:42] RustyShackleford: well I'm trying to use the fullcalendar jquery plugin. You need to declare events in javascript
[17:39:46] tubbo: tetraktys: what is the error btw?
[17:40:11] tetraktys: undefined method 'build' for nil class
[17:40:30] tubbo: RustyShackleford: nah, you can give it a URL that consists of a list of events.
[17:40:40] rhizome: RustyShackleford: fullcalendar can retrieve events through ajax
[17:41:01] tetraktys: tubby, error remains
[17:41:16] tubbo: tetraktys: oh right, your syntax is still wrong
[17:41:17] ivanskie: oh just gone out and grabbed a via adapter..
[17:41:23] ivanskie: now i wish i had two somehow
[17:41:31] ivanskie: need 3 screens at this point lol
[17:41:43] ivanskie: one just for irc
[17:41:46] pipework: RustyShackleford: Look into rabl and how to use it with rails 3. That, or jbuilder, maybe.
[17:42:02] pipework: They're just helpful tools, you don't actually need them, but they'll help you get where you're wanting to be.
[17:42:02] RustyShackleford: wait so, should I be using rails 3 still?
[17:42:08] rhizome: http://arshaw.com/fullcalendar/docs/event_data/events_function/
[17:42:13] RustyShackleford: I am using rails 4 actually
[17:42:31] RustyShackleford: is it ready? Some people don't like .0 releases
[17:42:33] pipework: RustyShackleford: You can use whichever.
[17:42:53] pipework: I don't know why I specified rails 3. Just did, for no reason, I guess.
[17:43:20] tubbo: tetraktys: this is how i'd do it https://gist.github.com/tubbo/6717783
[17:43:48] foucist: RustyShackleford: there's a lot of issues with rails 4 at the moment it seems but if that's not an issue it's probably worth sticking it out
[17:43:53] tubbo: pipework: needs XML, not JSON...iirc
[17:43:55] ivanskie: so would you guys know how i can keep the pagination happening, if i do search?
[17:44:01] ivanskie: err i need to refrase
[17:44:20] pipework: tubbo: ewwwwwwwwwwww.
[17:44:27] tubbo: pipework: oh n/m http://arshaw.com/fullcalendar/docs/event_data/events_json_feed/ that was just for gcal support
[17:44:42] ivanskie: to make pagination happen I'm doing this in the index block of the controller: @items = Item.order(:name).page params[:page]
[17:45:04] ivanskie: but to make search happen usually u need @items = @search.result
[17:45:22] RustyShackleford: pipework, will i be able to use that example to load my events from a database?
[17:45:35] pipework: RustyShackleford: Sure.
[17:45:42] ivanskie: so hum i tried @items = @search.result || Item.order(:name).page params[:page]
[17:45:46] ivanskie: which doesn't work..
[17:45:50] pipework: You should have your server respond to some JSON that has the events in it.
[17:46:13] pipework: The response might be crafted to play nicely with your jqueery table stuff, if you'd like.
[17:46:38] tubbo: RustyShackleford: it's bad practice to share content from the controller and view directly with an ivar like that. if for some reason the ivar is ever nil, you get problems you can only debug by scouring the JS source
[17:47:11] RustyShackleford: so I take events from the db, put them into JSON, then use JSON to render them in the calendar?
[17:47:13] tubbo: so that's why we have this whole ajax/JSON thing for describing extra data the page may need after load
[17:47:33] tubbo: RustyShackleford: the first two parts of that statement describe about 99% of web development
[17:47:36] tubbo: the other 1% is IE issues
[17:48:08] tubbo: 1.) take shit out of the DB, 2.) convert into HTML or JSON, 3.) ????, 4.) $100 billion valuation
[17:48:10] RustyShackleford: i have no idea what I'm doing :(
[17:48:23] tubbo: you'll get there
[17:48:34] RustyShackleford: i sorta have the hang of rails/html/css
[17:48:38] ivanskie: got search to work
[17:48:40] RustyShackleford: just need to tackle javascript
[17:48:40] tubbo: at least rails makes it easier to get started building a REST API
[17:49:07] pipework: RustyShackleford: Yes. You either render the json directly into the page (good for first loads and having content) or you request it via JSON.
[17:49:47] RustyShackleford: now lets say the user keeps scrolling forward in the calendar, to the point where we've exhausted our JSON data
[17:50:07] RustyShackleford: can you ask for more data without reloading the page?
[17:50:19] foucist: ivanskie: what gem did you go with
[17:50:30] foucist: RustyShackleford: that's called AJAX
[17:50:45] ivanskie: took me a little while to figure out that I'm not obliged to do complex search forms with it
[17:50:46] RustyShackleford: if the calendar has appointments booked several months in advance, i don't think it would be wise to load them ALL into JSON
[17:50:59] pipework: RustyShackleford: You make more requests, mostly.
[17:51:06] ivanskie: and got sold on it cause i can do complex search with it later
[17:51:16] pipework: RustyShackleford: Load 2 pages ahead and back of the current page.
[17:51:25] tubbo: RustyShackleford: how do you know?
[17:51:33] tubbo: could take 5ms to load the whole thing
[17:51:38] tubbo: JSON isn't that big
[17:51:58] tubbo: RustyShackleford: why build something now when you have no proof you'll need it later?
[17:51:58] RustyShackleford: maybe I'll try that first. It would be simplest
[17:52:11] RustyShackleford: premature optimization?
[17:52:17] RustyShackleford: lol, I'm just thinking ahead
[17:52:29] tubbo: premature optimization is about as bad as premature ejaculation
[17:52:33] tubbo: it's embarrassing to admit you do it
[17:52:43] tubbo: and nobody wants to hang out with you if you do it
[17:53:01] tubbo: so don't optimize until you're absolutely sure you need to make it better
[17:54:06] pipework: RustyShackleford: I render JSON into HTML templates so that the page comes down with content preloaded. Then I request more data as necessary.
[17:54:47] RustyShackleford: so I have two questions: how do I render JSON? And how do I "get" that JSON from my javascript?
[17:54:52] Nenor: Does anybody use hosting at DreamHost? I would be grateful for instructions how to deploy rails app to it. I have public folder with quickstart.html and favicon created by default from hosting.
[17:55:20] pipework: So I'll load 5 pages of calendar data. Two pages of the past, the current page, and two pages of future. All in the html from the request. That way when the document renders, it has the data it needs. Then, as the user goes forward, the page requests more.
[17:55:44] pipework: RustyShackleford: Same way you render any view.
[17:56:17] RustyShackleford: so I'll be doing this in .erb files?
[17:56:30] tetraktys: tubbo, your solution wont work. If a user with the associated provider/uid exists i need it to update the data and not create a new user
[17:57:09] tubbo: tetraktys: oh haha i forgot it was in a where()
[17:57:54] tubbo: tetraktys: well your problem is basically that user.employee is nil. nil has no build method. so you probably need to make the Employee manually: user.employee = Employee.new(first_name: 'whatever')
[17:57:59] tubbo: but you actually want
[17:58:09] tubbo: user.employee = Employee.new(first_name: 'whatever', user_id: user.id)
[17:58:18] AntelopeSalad: is collection_select one of the few reasonable times when accessing a Model.all is acceptable in a view?
[17:58:26] tubbo: now if user doesn't *have* an id yet, i dunno what to tell you. you'll probably have to save it, then update the employee user_id, then save it again.
[17:58:37] tetraktys: makes sense, but user.id is not set when a user is created
[17:58:37] tubbo: AntelopeSalad: nope. use a helper method :)
[17:58:51] tubbo: tetraktys: exactly, so i dunno what you're gonna do about that.
[17:58:53] AntelopeSalad: tubbo: isn't that the same thing in the end? just moved to a helper
[17:59:05] pipework: RustyShackleford: If you want. That's why I suggested you use jbuilder or rabl.
[17:59:13] tetraktys: i'll try the second page with hits on google. Thanks anyway!
[17:59:13] slash_nick: AntelopeSalad: do all your queries in the controller or else.
[17:59:33] AntelopeSalad: slash_nick: even when you're only populating a selectbox with a secondary model's data?
[17:59:50] tubbo: tetraktys: see you probably should've just done that in the first place instead of asking us idiots ;0
[17:59:52] AntelopeSalad: example: having a bulk "change category to" option in your post's index view
[18:00:07] ivanskie: how would I do this http://bootsnipp.com/snipps/stylish-search-form? in rails? -- <%= f.submit("<i class="icon-search"></i>", :class => "btn") "search" %> is what I'm trying, and obviously this won't work but..
[18:00:08] thebobmarley: ivanskie: Let me help you: http://www.youtube.com/watch?v=-JhwxTen6yA
[18:00:43] tubbo: AntelopeSalad: a lot of the time i'll make helper methods like items_collection_select(attribute_name), to make it super-easy to add <select>s
[18:00:45] ivanskie: thanks thebobmar
[18:00:51] ivanskie: it helps a lot
[18:01:21] tubbo: AntelopeSalad: but for a 1-off thing, you're probably OK with it being in the view. it's all up to your discretion, really. personally i like to play with the queries, and use them in multiple places, so it makes sense to abstract the query to its own method and then just call the method when i need items.
[18:01:23] dbcclarke: If i have this URL -
[18:01:23] AntelopeSalad: tubbo: but you would still need to pass in the collection of items, since you might want to use that helper in a few places?
[18:01:38] tubbo: AntelopeSalad: depends on what i'm doing. i might just pass in the where() clause...
[18:01:51] dbcclarke: If I have this URL -> http://localhost:3000/book/new , how do I set up routing to this in routes.rb?
[18:02:00] tubbo: great entrance
[18:02:26] foucist: dbcclarke: well resources :book makes that accessible
[18:02:52] AntelopeSalad: btw speaking about collection select, why doesn't it work without a form object?
[18:03:21] AntelopeSalad: a SO answer says you could do: collection_select ... , marked as correct but that throws an error still
[18:03:35] dbcclarke: foucist: thats it? I just add that one line
[18:04:13] jumbo-jamba: rubyonrails is a bitch
[18:04:37] pipework: It sucks in some pretty marvelous ways.
[18:05:07] toretore: correction. rubyonrails is *my* bitch
[18:05:31] pipework: Bitches can't have bitches.
[18:05:43] dbcclarke: foucist: when i went to the url i get this error now: {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee]}
[18:05:58] dbcclarke: url: http://localhost:3000/book/new
[18:06:24] pipework: dbcclarke: That's not eh whoel error.
[18:06:26] tetraktys: tubbo, i found it: employee = user.build_employee is what i had to do, now i have access to user.employee
[18:06:30] pipework: jumbo-jamba: Clever.
[18:07:25] dbcclarke: Missing template book/new, application/new with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee]}. Searched in: * "/Users/DC/Documents/projects/myapp/app/views"
[18:08:10] pipework: Seems like you probably want to use resources not resource.
[18:08:39] RustyShackleford: the web uses so many damn languages/technologies
[18:08:49] pipework: books/new would make more sense, and then you'd need a view at app/views/books/new with the handler you want, probably app/views/books/new.html.erb
[18:09:12] mbd2: ALL, I'm desperate! 2 days now trying to debug a assets:precompile encoding problem: http://pastie.org/pastes/8357977/text?key=prul7qs7ikpejvg2fmghw . no idea how to debug problem!?!
[18:09:39] dbcclarke: pipework: now what does uninitialized constant BooksController mean!?
[18:09:43] pipework: jumbo-jamba: Do us a favor and at least be entertaining, alright?
[18:09:51] pipework: dbcclarke: That there's no constant by that name, why?
[18:10:07] dbcclarke: thats the next error is got thats why
[18:10:16] pipework: Do you have a book controller?
[18:10:26] dbcclarke: ya, im looking at it right now
[18:10:28] pipework: wmoxam: Please to ban the jumbo-jamba
[18:10:46] pipework: dbcclarke: Did you change resource :book to resources :books ?
[18:11:30] pipework: dbcclarke: mv app/controllers/book{,s}_controller.rb
[18:11:43] dbcclarke: pipework:i i changed from resources :book to resources :book
[18:11:46] ivanskie: i have Vendor view page.. i would like to add a list of Items on that page that are made by this Vendor..
[18:11:54] pipework: dbcclarke: Then open app/controllers/books_controller.rb and rename the class to BooksController.
[18:11:55] ivanskie: @items = Items.vendor
[18:11:59] ivanskie: err or Vendor.items
[18:12:07] dbcclarke: 2nd resource should be "resource"
[18:12:37] ivanskie: at first i tried @items = Items.where(:vendor_id => @vendor)
[18:13:41] _str: is there any way in jbuilder to do what "extend" in rabl does? i want to extend show.json.jbuilder
[18:13:42] pipework: jumbo-jamba: Are you some kind of joomla user?
[18:13:42] RustyShackleford: pipework, is it required that I know how to do this without jbuilder?
[18:14:04] pipework: RustyShackleford: jbuilder is just a helpful tool for building valid JSON.
[18:14:05] _str: if i want to use partials, then i have to create _show(for partial) and show(for normal)
[18:14:11] _str: which is not clean
[18:14:14] pipework: You can use json.erb if you want.
[18:14:34] RustyShackleford: it looks like if I copy and paste the example on their github, I might get somewhere
[18:14:46] thebobmarley: jumbo-jamba: Whoa! Sounds like you could use some Bob Marley: http://www.youtube.com/watch?v=gODh1nsHlPg
[18:14:55] RustyShackleford: and i guess the jbuilder gem is in your Gemfile by default
[18:15:04] pipework: RustyShackleford: I don't jbuilder myself.
[18:15:08] ivanskie: how do i use the resources :items in the vendor?
[18:15:24] pipework: jumbo-jamba probably just got fired because they replaced his whole team with one rails developer.
[18:15:37] pipework: Would explain his boring raging.
[18:15:38] jumbo-jamba: YEA BITCH,SUCKMY COCK
[18:15:43] toretore: jumbo-jamba: ur mom
[18:15:54] pipework: toretore: Don't you have +o and +b powers here?
[18:15:54] _str: is this jumbo-jamba a bot?
[18:16:03] toretore: pipework: nope
[18:16:08] slash_nick: Doubftul, _str
[18:16:08] ivanskie: ./ignore works pretty darn well
[18:16:17] rhizome: over the internet?
[18:16:22] pipework: ivanskie: You can probably just use // to escape the /
[18:16:27] _str: ./ignore jumbo-jamba
[18:16:33] slash_nick: i can't on irssi, pipework
[18:16:35] jumbo-jamba: FUCK YOU ASSHOLE
[18:16:36] thebobmarley: jumbo-jamba: Don't worry, be happy! http://www.youtube.com/watch?v=Oo4OnQpwjkc
[18:16:38] pipework: It's mostly for the people who aren't regulars here.
[18:16:43] pipework: slash_nick: What about /say ?
[18:16:53] pipework: /say /ignore jumbo-jamba
[18:17:00] rhizome: that's the way
[18:17:29] mbd2: ignored! thx for tip
[18:17:29] slash_nick: jumbo-jamba: what'd you have for breakfast?
[18:17:30] helpa: TROLL DETECTED!
[18:17:40] rhizome: unpersobel
[18:17:59] toretore: loop{ rubyonrails.say(cursewords[rand(cursewords.size)]); sleep 1 * rand }
[18:18:38] toretore: look, it's conscious
[18:19:03] fryguy: toretore: why not use #sample
[18:19:08] pipework: This is either an impressive use of AI or a terrible abuse of organic brain matter.
[18:19:37] ivanskie: i don't get it
[18:19:42] ipstatic: I have a render text: 'Hello World' in my controller and the action is complaining about a missing template, how can I skip the template?
[18:20:12] fryguy: ipstatic: by actually calling render :text. show us the code
[18:20:21] ivanskie: I'm in vendors_controlelr.. under def show, i need to @items = Items.find_by_id(:id) or something like Vendor.items
[18:20:23] ivanskie: anything I'm trying isn't working
[18:20:24] toretore: fryguy: cause im oldschool
[18:20:51] zeknox: hey fellas, what gem would you recommend to use for a file manager within the web interface?
[18:21:05] ipstatic: fryguy: https://gist.github.com/ipstatic/06141313304237a19ef5
[18:21:32] fryguy: ipstatic: what is the ... part of that
[18:21:40] rhizome: ivanskie: wat
[18:21:57] ivanskie: vendor has_many items, item belongs_to vendor..
[18:22:02] fryguy: whatever, i give up
[18:22:03] rhizome: fryguy: "and then a miracle occurs..."
[18:22:05] ivanskie: on vendor show page, i want to list items made by vendor
[18:22:14] dbcclarke: pipework: ok i have /controller/book_controller.rb and in the book_controller.rb I have "Class BooksController < ....etc." , and in the routes.rb I have one line: "resources :books" -> and still get the error "routing error uninitialized constant BooksController"
[18:22:32] fryguy: dbcclarke: pluralize the filename
[18:22:39] rhizome: ivanskie: Vendor.find(id).items
[18:22:45] ChanServ: +q *!*@gateway/web/freenode/ip.82.28.155.38
[18:22:47] slash_nick: dbcclarke: mv book_controller.rb books_controller.rb
[18:22:56] wmoxam: jumbo-jamba: hi
[18:23:10] RustyShackleford: I'm beginning to think google calendar can do everything this web app I'm planning can
[18:23:24] rhizome: except exist outside of the googlesystem
[18:23:54] RustyShackleford: I'm trying to help my mom streamline her business. Her way of making/keeping track of appointments pisses me off
[18:24:06] RustyShackleford: 1 appt book for 2 employees first of all
[18:24:23] slash_nick: RustyShackleford: have you seen this jQuery plugin? http://arshaw.com/fullcalendar/
[18:24:24] zeknox: what gem would you recommend to use for a file manager within the web interface?
[18:24:39] RustyShackleford: slash_nick, yeah it's pretty slick. I'm trying to figure it out
[18:25:00] rhizome: https://github.com/bcalloway/rails-calendar
[18:25:03] henn1nk: instead of saving "" for empty input fields i would like to save nil. how can i archieve this?
[18:25:05] rhizome: fullcalendar isn't hard, though
[18:25:10] rhizome: might take a minute, but...
[18:25:22] RustyShackleford: well if you know what you're doing :p
[18:25:30] slash_nick: rhizome: are there any demos of that in use?
[18:25:38] rhizome: dunno, just googled it up
[18:25:45] RustyShackleford: web dev is not my domain. I have spent far more time in compiled languages
[18:26:01] ipstatic: fryguy: While pasting my code I saw where I had the render statement inside a each block, thanks for your help!
[18:26:11] rhizome: slash_nick: readme uses config.gem so probably not the best suggestion
[18:26:29] wmoxam: RustyShackleford: some web programmers work mostly in compiled languages ;)
[18:26:47] pipework: And by compiled, he means precompiled.
[18:26:48] rhizome: RustyShackleford: oh come now, you've been in and out of here for ages!
[18:26:53] RustyShackleford: wmoxam, asp.net or something
[18:26:56] slash_nick: rhizome: not to mention, latest commit was 4 years ago.
[18:27:09] rhizome: just noticed that ;)
[18:27:33] wmoxam: RustyShackleford: java too
[18:27:48] wmoxam: RustyShackleford: some weirdos even like C/C++
[18:27:50] rhizome: anyway, an events scaffold, datepicker, fullcalendar. maybe i should make an app for github!
[18:28:18] RustyShackleford: cool, i didn't know there was that bot
[18:28:24] slash_nick: There is that bot :)
[18:28:26] helpa: Nom nom. Thanks, slash_nick!
[18:28:27] RustyShackleford: er, that he could do that
[18:28:29] rhizome: is that when helpa gained !seen though? :)
[18:28:44] slash_nick: shit... wrong, rhizome!
[18:28:52] rhizome: 2013-06-10
[18:29:06] timhansen: afternoon, all
[18:29:33] slash_nick: 2012-11-13 is my "since date", rhizome
[18:30:10] rhizome: pretty sure i predate helpa
[18:31:49] rhizome: what's a good name for an appts app? whenify sounds good
[18:31:54] slash_nick: rhizome: helpa first saw helpa on 09/01/2012
[18:32:05] rhizome: when's helpa's birthday?
[18:32:29] zeknox: anyone have an opinion on elFinder as a file manager?
[18:32:36] rhizome: what's elFinder?
[18:33:06] zeknox: rhizome: http://elfinder.org/
[18:33:40] rhizome: oh, for a dropbox clone or something?
[18:34:00] zeknox: rhizome: im just looking to manage files from a web interface, would love to be able to see contents of a file
[18:34:14] s2013_: can controller name for a model be different from the model name? (only cause i need to have different table names)
[18:34:22] s2013_: i mean i know it can but is it ok?
[18:34:42] rhizome: zeknox: file display might be a separate issue
[18:34:47] rhizome: s/issue/feature/
[18:34:59] RustyShackleford: railscasts are awesome
[18:35:06] rhizome: s2013_: yes, you can use any model from any controller
[18:35:12] RustyShackleford: I usually hate video tutorials
[18:35:13] rhizome: it's just a question of code org
[18:35:19] henn1nk: https://gist.github.com/henn1nk/6718565 i am trying to update/set name_en/name_fr/etc params for this basic_article. how should the syntax be?
[18:35:23] rhizome: yes, railscasts are a treasure
[18:36:06] godd2: s2013_: if you have a model names Photo, you can refer to that model in any controller just by calling Photo.all or Photo.first or whichever photo entries you want from its associated table in the database.
[18:36:32] rhizome: henn1nk: seems reasonable. problems?
[18:36:48] henn1nk: rhizome: i receive the syntax error
[18:36:51] s2013_: godd2, yeah i know that.. but thing is that all my models have to have support_ prefixed
[18:37:24] wmoxam: wmoxam kicked jumbo-jamba: to troll better buddy, that was pathetic
[18:37:27] s2013_: nevermind. anyways, tanks.
[18:37:29] rhizome: henn1nk: oh, gotcha
[18:37:46] s2013_: woah there is another op besides radar?
[18:37:59] rhizome: henn1nk: might be something diff in .send for a setter
[18:38:02] godd2: s2013_: if your tables are named that way because of a legacy dateabse, then this goes over active record customizations just like that: http://blog.crowdint.com/2013/09/25/non-standard-activerecord.html
[18:38:07] wmoxam: s2013_: several in fact
[18:38:24] s2013_: you are the silent op wmoxam
[18:38:36] rhizome: henn1nk: http://stackoverflow.com/questions/4637321/self-sendmethod-value-does-not-work
[18:38:45] s2013_: yeah godd2 pretty much thats what im dealing with. i guess not legacy as its new, just not rails convention cause most of the app is in C/python
[18:38:45] wmoxam: s2013_: I've been busy ;)
[18:38:59] henn1nk: rhizome: ah ok, i try this
[18:39:02] s2013_: not app but the codebase.. blah yeah. thanks
[18:39:10] s2013_: busy is good
[18:39:21] godd2: s2013_: going against convention just requires a few extra configurations, and rails is more than capable of bending over backwards for you
[18:39:34] s2013_: yeah i know. just havent had to deal with that. so learning how to now.
[18:39:49] s2013_: but its my first day on the job and im stuck with working with unconventional db. heh
[18:39:53] s2013_: its all good. thats how you learn
[18:39:54] godd2: ah ok, good luck :)
[18:40:50] patie: any better solution ? http://stackoverflow.com/questions/19029129/default-value-for-input-with-simple-form
[18:42:09] wmoxam: s2013_: /msg ChanServ ACCESS #rubyonrails LIST
[18:42:29] s2013_: yeah i just never did that. but let me check who i should be nice to :P
[18:42:53] AntelopeSalad: there's nothing dangerous about this right? this is in my controller that does a bulk update based off a select box's value : Post.where(id: params[:post_ids]).update_all(category_id: params[:category][:id])
[18:43:05] tubbo: my gut reaction would be "everyone except wmoxam"
[18:43:06] s2013_: woah. most of these people ive never even seen but thats cool
[18:43:14] tubbo: is who you should be nice to
[18:43:22] s2013_: im actually the nicest regular member here id say
[18:43:43] mbd2: in javascript application.js manifest when you say `//= require dataTables/jquery.dataTables` where is that file actually located in the application hierarchy?!?
[18:43:48] rhizome: i wonder if there's a way to modify generators so that something special only happens with certain versions of rails
[18:43:49] justanotherjason: Antelope.. thats not safe
[18:43:54] wmoxam: tubbo: lulz
[18:44:08] AntelopeSalad: justanotherjason: what makes it unsafe?
[18:44:18] RustyShackleford: so I watched a railscast about rendering json at an url like <domain>/posts/1.json
[18:44:32] RustyShackleford: but what if I want several posts at once?
[18:44:32] mbd2: i have no `datatables/jquery.dataTables` file that I can locate anyway...
[18:44:32] justanotherjason: doesn't escape the params
[18:44:34] tubbo: justanotherjason: how?
[18:44:49] rhizome: mbd2: app/assets/javascript
[18:44:53] AntelopeSalad: but doesn't rails read the param in by default without any other protection?
[18:44:56] tubbo: AntelopeSalad: you should probably be using stromg_parameters
[18:45:06] justanotherjason: .update_all("category_id: ?", params[:category][:id])
[18:45:10] tubbo: i think that escapes string input
[18:45:13] AntelopeSalad: example: rails will put this in the scaffold , @post = Post.find(params[:id])
[18:45:22] AntelopeSalad: that is doing the exact same thing as what i pasted before no?
[18:45:34] justanotherjason: oops leave off the :
[18:45:35] rhizome: AntelopeSalad: get the category first
[18:45:44] AntelopeSalad: in the sense that it's taking a param and doing a lookup in the db
[18:45:46] tubbo: justanotherjason: first of all that's incorrect SQL, and second of all is where(hash: value) the same thing as where("whatever = ?", value)?
[18:46:08] mbd2: rhizome: ok, there is a file app/assets/javascript/datatables.js but no datatables/jquery.datatables
[18:46:31] mbd2: rhizome: wondering if i'm missing something...
[18:46:43] rhizome: looks like a spelling error
[18:46:49] AntelopeSalad: almost every rails just uses the param directly in a query too, i thought maybe update_all had some magic tho
[18:46:55] justanotherjason: id say its not the same, because params are escaped in the 2nd example
[18:46:57] tubbo: oh update_all
[18:47:15] AntelopeSalad: why are params escaped in the 2nd example but not the first?
[18:47:27] ivanskie: jauqery.purr can't find
[18:47:33] ivanskie: nor best_in_place argh
[18:47:37] tubbo: AntelopeSalad: you can just do Post.where(id: params[:post_ids]).update_attributes category_id: params[:category][:id] right
[18:47:43] tubbo: why use update_all there?
[18:47:44] AntelopeSalad: or what about with kaminari where it just puts .page(params[:page])
[18:47:51] AntelopeSalad: it doesn't escape the page
[18:48:24] justanotherjason: http://www.sitepoint.com/rails-security-pitfalls/
[18:48:25] AntelopeSalad: tubbo: i don't know, i was going by what ryan had in a screencast to do bulk updates to a single attrib
[18:48:27] tubbo: justanotherjason: i would think that where({}) is just a more readable DSL for where('', v)
[18:48:33] rhizome: opening a new app in sublime always results in a teensy window
[18:48:46] AntelopeSalad: rhizome: not if you launch it with "subl" , don't put the .
[18:48:57] tubbo: justanotherjason: therefore both solutions are equal in how much they protect against sql injection
[18:49:10] rhizome: AntelopeSalad: this is just "open folder" from an existing instance
[18:49:27] justanotherjason: scroll to SQL Injection in the link i posted
[18:49:29] AntelopeSalad: rhizome: oh, missed some of your convo, i thought that's what you wanted to do
[18:49:48] justanotherjason: you are right tubbo
[18:49:48] rhizome: i was just whining
[18:49:50] justanotherjason: i just reread it
[18:50:12] AntelopeSalad: i thought rails only was unprotected when you ran direct SQL and used interpolation?
[18:50:36] tubbo: justanotherjason: lol don't link me to a sitepoint tutorial and expect me to read it ;)
[18:50:51] tubbo: sitepoint is on the same level as w3schools which is on the same level as the art institute in terms of credibility :\
[18:51:07] AntelopeSalad: you know what's funny, i thought the same thing tubbo heh... but i did skim it because security isn't something i want to take lightly
[18:51:10] barce: AntelopeSalad: rails is not protected from devs not knowing about security.
[18:51:17] pipework: justanotherjason: What's your point?
[18:51:30] justanotherjason: that its not a tutorial
[18:51:34] tubbo: AntelopeSalad: you *can* be unsafe with rails and sql, but the community has done a good job of advocating best practices.
[18:51:46] pipework: That it's an article that displays ways people write bad code?
[18:51:47] tobobo: hi all, is there a way to control the order in which before_action methods are called?
[18:51:50] AntelopeSalad: barce: i can only go by what i see as examples, i've never seen anyone use placeholders for params
[18:52:08] pipework: Still missing the whole point.
[18:52:12] tubbo: pipework: the SITE point
[18:52:15] tubbo: if you will
[18:52:24] pipework: Point me to the site.
[18:52:28] tubbo: --------------------------->
[18:52:31] justanotherjason: http://www.sitepoint.com/rails-security-pitfalls/
[18:52:34] AntelopeSalad: btw tubbo: what advantages are there to update_attribs vs update_all?
[18:52:48] tubbo: AntelopeSalad: for all i know they could be aliases :D
[18:53:09] barce: AntelopeSalad: have you tried this gem? http://brakemanscanner.org/
[18:53:09] AntelopeSalad: is update_attrib more efficient because it somehow only knows about the one column it's touching instead of the whole record?
[18:53:14] tubbo: AntelopeSalad: i would imagine update_all is meant to be called directly on Post, like Post.update_all, for doing the same update on all Post records. would be the same as Post.all.update_attributes()
[18:53:34] tubbo: AntelopeSalad: i actually don't know the difference. to the source code! http://github.com/rails/rails
[18:53:51] AntelopeSalad: i got that syntax from this comment: http://railscasts.com/episodes/165-edit-multiple-revised?view=comments
[18:54:04] AntelopeSalad: do a find for "in rails 4, this"
[18:54:09] tubbo: AntelopeSalad: if you're only updating 1 record, it will take less time than if you are updating 100 or 1000 records.
[18:54:21] tubbo: so it depends on how any post rows are included in the collection that you call this update method on
[18:54:27] AntelopeSalad: tubbo: that action is responsible for updating an unknown amount of rows
[18:54:27] tubbo: s/collection/active relation
[18:54:31] AntelopeSalad: it might be 1 or it might be 50
[18:54:50] AntelopeSalad: it's just a bulk update end point
[18:54:53] AntelopeSalad: for 1 single column
[18:55:07] tubbo: but you can pass a hash into it
[18:55:12] tubbo: thereby updating multiple columns at once?
[18:55:16] tubbo: for multiple rows
[18:55:33] AntelopeSalad: it seems like that query i pasted does something like that yeah
[18:55:37] AntelopeSalad: i don't know for sure, all i know is it works heh
[18:56:10] AntelopeSalad: here, it executed this query: UPDATE "posts" SET "category_id" = '4' WHERE "posts"."id" IN (17, 14, 12)
[18:57:53] crunch-choco: guys, i have a little question about rails 4, can it be installed on any server or do i have to be extra careful with which host to choose?
[18:58:15] justanotherjason: any server more or less
[18:58:28] justanotherjason: id use digitalocean
[18:58:56] crunch-choco: ah yes i read about digital ocean
[18:59:13] crunch-choco: are you satisfied? i almost picked heroku
[18:59:43] webdestroya: heroku makes stuff super easy
[18:59:51] AntelopeSalad: i'd say it depends on your needs/budget , heroku can get really expensive with certain requirements
[18:59:52] webdestroya: but it costs more
[18:59:59] justanotherjason: i just like to be able to ssh into my box
[19:00:15] webdestroya: heroku forces you to make your app very scalabe
[19:00:16] pskrz: cruch-choco: heroku is just a wrapper around aws
[19:00:30] helpa: pskrz: Don't you mean http://lolroku.com/?
[19:00:30] pipework: pskrz: !heroku
[19:01:06] crunch-choco: hm is digital ocean recommended for a beginner?
[19:01:23] webdestroya: crunch-choco: have you ever setup a linux box yourself?
[19:01:27] pskrz: pipework: hehe
[19:01:36] webdestroya: if you are comfortable using shell do to everything, then use DO
[19:01:54] crunch-choco: webdestroya: yes i have more or less
[19:02:56] mbd2: anyone recommend the Rails Way to view thousands of records of tabular data in Rails?
[19:03:09] RustyShackleford: damn digitalocean is way cheaper than AWS
[19:03:13] webdestroya: infinite scroll?
[19:03:41] justanotherjason: :mbd2.. pagination
[19:04:46] mbd2: justanotherjason: tried that. too cumbersome. i was thinking more on the lines of a data table. Tried datatables.js but it seems out of date. anything newer?
[19:05:21] mbd2: justanotherjason: by 'cumbersome' i mean it's laborious to 'next page' through thousands of records...
[19:05:32] justanotherjason: yea then do infinite scroll
[19:05:41] crunch-choco: DO seems great, and not expensive but would i have to setup everything from scratch?
[19:06:11] mbd2: crunch-choco: 'DO'? you talking to me?
[19:06:26] dbcclarke: Can someone help me understand why my url http://localhost:3000/books/list is returning "ActiveRecord::RecordNotFound in BooksController#show" ... instead of my list view file??? -> http://grab.by/qDuk
[19:06:37] crunch-choco: i meant digital ocean
[19:06:38] AntelopeSalad: crunch-choco: that's one nice perk if you don't mind reading a lot of documentation
[19:06:39] dbcclarke: ^^this is SUPPOSED to be shown
[19:06:41] webdestroya: dbcclarke: /books is your "list" url
[19:06:44] mbd2: justanotherjason: what's practical limit on infinite scroll?
[19:07:25] webdestroya: mbd2: what do you mean? its like the facebook newsfeed
[19:07:31] webdestroya: you scroll down, and it shows more
[19:07:49] crunch-choco: AntelopeSalad: true, i should see it that way
[19:07:53] dbcclarke: when i put http://localhost:3000/books, it says The action 'index' could not be found for BooksController
[19:08:07] dbcclarke: do i need an index action? i cant have a list action?
[19:08:15] webdestroya: index is the "list" action
[19:08:18] justanotherjason: you need def index end
[19:08:28] webdestroya: def index; end
[19:09:30] crunch-choco: have guys ever heard of linode?
[19:10:20] dbcclarke: webdestroya: ok that worked!
[19:10:25] webdestroya: crunch-choco: yea
[19:10:33] webdestroya: its fairly popular
[19:10:41] Tarential: linode? what's that?
[19:10:47] AntelopeSalad: crunch-choco: you can put basically whatever you want on it as long as you have enough ram you're good to go
[19:11:22] barce: crunch-choco: and cpu, io, and bandwidth
[19:11:45] AntelopeSalad: yeah that too, ram seems to be the easiest to mess up though when you have free reign heh
[19:11:52] crunch-choco: sounds complicated
[19:11:59] jstrong: just download more ram
[19:12:28] RustyShackleford: I'm not sure how I want to lay out my database for appointments
[19:12:31] jstrong: http://downloadmoreram.com/
[19:12:37] RustyShackleford: so an appointment has a start and end time
[19:12:44] RustyShackleford: and I want to make sure they can't overlap
[19:13:17] RustyShackleford: but if we have multiple employees, that might be harder to keep track of
[19:17:17] s2013_: how do i generate a model that doesn't automatically create a table
[19:17:27] s2013_: or should i just create a file and put it in the models folder
[19:17:45] ivanskie: I'm liking where I'm at with my app :D
[19:17:46] justanotherjason: s2013_ yes, just create the file
[19:18:02] justanotherjason: if you do rails generate it will make a migration
[19:19:19] s2013_: then self.table_name = "table name" ?
[19:21:08] justanotherjason: s2013_: yes, only if you wanna override so you can use with legacy db
[19:21:30] justanotherjason: otherwise it will create plural form of the model name
[19:22:29] ivanskie: hm my sort isn't working with kaminari
[19:22:48] ivanskie: @itsearch.result.order(:name || :sort).page params[:page] works..
[19:22:58] ivanskie: :sort or :name doesnt
[19:24:11] jamespeerless: is there anyway to have asset-url give relative paths? generates "/assets/filename" and I want "assets/filename"
[19:24:11] thebobmarley: jamespeerless: Mad? You just got to listen to me! http://www.youtube.com/watch?v=6yXRGdZdonM
[19:24:35] webdestroya: jamespeerless: just set your asset path in your production.rb file
[19:24:39] webdestroya: and make it relative
[19:24:49] webdestroya: but... *why* do you want it relative
[19:24:54] webdestroya: that will likely not work for you
[19:24:57] webdestroya: unless you have a single page app
[19:25:07] jamespeerless: yeah its a spa
[19:26:51] vanev: How can I change the CKEditor Toolbar in Active Admin?
[19:28:19] rehat: is there a way to call a controller action from an erb file?
[19:30:00] justanotherjason: rehat: yes, you link_to method
[19:30:41] justanotherjason: :controller => "my controller", :action => "method name"
[19:30:42] godd2: Anyone have any experience with Plesk making Apache ignore my httpd.conf ?
[19:30:46] rehat: does that just create a link or call that action
[19:31:02] justanotherjason: creates the link, you could fire the action with js
[19:35:32] dbcclarke: Does anyone know if Forem Forums allows for moderation?
[19:36:53] dbcclarke: radar: do you know about Forem Forums?
[19:37:16] pipework: I think he's heard of it.
[19:38:18] dbcclarke: pipework: do you know if it allows for moderation?
[19:38:28] pipework: dbcclarke: I've never looked at it or used it.
[19:38:32] dbcclarke: pipework:im reading an article, but its over a year old
[19:38:44] dbcclarke: not sure if Forem's updated or not yet
[19:38:46] pipework: Forums are the most boring means of discourse to me.
[19:39:40] AntelopeSalad: does anyone know how to apply validations to .update_all? google is coming up empty
[19:41:00] justanotherjason: AntelopSalad: use update method instead
[19:41:35] justanotherjason: AntelopeSalad: http://guides.rubyonrails.org/active_record_validations.html#skipping-validations
[19:41:37] kazuuu: What do you guys think from this affirmation: It's better to have most of our code in the models with less code in the controllers and views.. Is it 100% right? or are there people who thinks differently?
[19:41:49] justanotherjason: fat models skinny controllers
[19:42:13] AntelopeSalad: i don't think i can use update
[19:42:17] pipework: Fat models are hot.
[19:42:25] pipework: AntelopeSalad: #update_attributes
[19:42:27] kazuuu: fat models are hot? hahah
[19:42:51] kazuuu: i'd rather the skinny ones.. ;)
[19:42:54] pipework: kazuuu: No logic in the views, only request-related logic in the controller, and only business logic in the models.
[19:43:04] pipework: You might need to use helpers and services for the rest.
[19:43:04] tubbo: kazuuu: i like organizing my biz logic in modules, and then include them into models. i save the model classes for defining "data model" configuration
[19:43:14] AntelopeSalad: pipework: that's a drop in replacement to update_all?
[19:43:16] tubbo: in other words, that's where i define my validations and scopes
[19:43:21] pipework: AntelopeSalad: I think.
[19:43:44] makerop: medium models, thin controllers, excess into concerns
[19:43:47] pipework: Mind that tubbo is a weirdie tho.
[19:43:59] pipework: Mmm, chubby models.
[19:44:17] AntelopeSalad: pipework: it says the method is undefined hmm
[19:44:17] tubbo: i think it's a nice way of separating concerns :)
[19:44:22] pskrz: AntelopeSalad: update is defined right after update_all https://github.com/rails/rails/blob/master/activerecord/lib/active_record/relation.rb#L324
[19:44:39] pipework: Seems like you've got shit all fucked up.
[19:44:39] thebobmarley: pipework: *hug*
[19:44:41] tubbo: plus, makes it easy to share code between models
[19:44:55] AntelopeSalad: pipework: this works Post.where(id: params[:post_ids]).update_all(category_id: params[:category][:id])
[19:44:55] s2013_: this is a question that is a bit more subjective but is it better to have something like a profile for users or just add all the fields in the devise user table?
[19:45:01] AntelopeSalad: i dropped in update_attributes and it says undefined
[19:45:06] s2013_: by that i mean something like a profile tab
[19:45:18] pipework: AntelopeSalad: I never use update_all, myself.
[19:45:27] tobobo: I have a question about optimizing activerecord queries
[19:45:31] kazuuu: awesome... chubby chubby... thanks guys..
[19:45:31] AntelopeSalad: i thought i could just replace it but it seems i can't
[19:45:40] pipework: AntelopeSalad: Read more documentation.
[19:45:58] AntelopeSalad: it says it's deprecated
[19:46:05] AntelopeSalad: so that's out of the question
[19:46:06] pipework: AntelopeSalad: ActiveRecord::Base has #update_attributes in at least rails 3.
[19:46:15] AntelopeSalad: http://apidock.com/rails/ActiveRecord/Base/update_attributes
[19:46:15] tubbo: AntelopeSalad: weird. i thought update_attrs was in rails 4..
[19:46:23] tubbo: hasn't failed *my* tests.
[19:46:32] AntelopeSalad: attrs is a different method, he told me to use attributes
[19:46:35] AntelopeSalad: i'll try attrs
[19:46:43] tubbo: AntelopeSalad: update_attributes is what i meant
[19:47:02] tubbo: haha sorry
[19:47:10] justanotherjason: tubbo, update_attributes skips validations
[19:47:18] justanotherjason: http://guides.rubyonrails.org/active_record_validations.html#skipping-validations
[19:47:21] pipework: http://rubydoc.info/gems/activerecord/4.0.0/ActiveRecord/Persistence:update
[19:47:29] AntelopeSalad: the api docs say it WILL run validations but it's deprecated
[19:47:33] tubbo: justanotherjason: update_attribute does. update_attributes does not. different methods.
[19:47:41] tubbo: justanotherjason: and update_attribute is deprecated anwyay
[19:47:43] pipework: update_attributes is plural.
[19:47:46] AntelopeSalad: are you using 4.0 too tubbo?
[19:47:50] tubbo: AntelopeSalad: yes
[19:48:09] tubbo: working on a 4.0 app right now. activeadmin needs to fucking get on that and update.
[19:48:19] AntelopeSalad: can you gist me the passing code?
[19:48:28] tubbo: i'm sorta sick of gregbell/active_admin having 200+ PRs and 300+ issues all the time. it's as if gregbell is fucking dead.
[19:48:42] tubbo: greg come baaaaaaaaaaaaaaaaack
[19:48:48] jstrong: UGH ACTIVE ADMIN
[19:48:58] pipework: Active Ughmin.
[19:49:13] jstrong: a great idea gone horribly wrong tbh
[19:49:24] stepfresh: speaking of active admin.. does it not support multiple member actions with the same name but different methods?
[19:49:45] tubbo: AntelopeSalad: https://gist.github.com/tubbo/7283477f7bf3bf7ee110
[19:49:52] jcromartie: is there a definitive guide to running a Rails app under anything but the root ("/") of a web server?
[19:49:52] stepfresh: it seems always to use the last one defined, regardless of GET or PUT etc
[19:50:01] jstrong: active_admin reinvented rails mvc
[19:50:17] AntelopeSalad: tubbo: nothing there seems to use update_attributes?
[19:50:19] jstrong: rails_admin is the way to go
[19:50:26] tubbo: AntelopeSalad: https://gist.github.com/tubbo/7283477f7bf3bf7ee110
[19:50:32] mrstibbons: Hey. I Have nested all my models inside of modules. The generators created modules with a method inside them, self.table_name_prefix. everything was working alright. now i updated to rails 4 and now it is looking for the tables with only the prefix and not with prefix+model_name. any ideas?
[19:50:33] tubbo: AntelopeSalad: updated to include controller
[19:51:07] jcromartie: glad I'm not the only one with a distaste for Active Admin
[19:51:12] tubbo: AntelopeSalad: it's a decent example of how i write controllers too
[19:51:30] jstrong: jcromartie: we're all enticed by its pretty and its cool landing page
[19:51:31] tubbo: jcromartie: i love activeadmin. i hate how mismanaged and hard to deal with it is.
[19:51:35] tubbo: but the product is decent.
[19:51:36] AntelopeSalad: if this fails... Post.where(id: params[:post_ids]).update_attributes(category_id: params[:category][:id])
[19:51:38] mosez: %w(index create)? doesnt it have to be symbols?
[19:51:45] tubbo: mosez: nope.
[19:51:46] jstrong: tubbo: dude activeadmin reinvents everything
[19:51:51] AntelopeSalad: then it means the where clause is somehow returning nil?
[19:52:02] jstrong: tubbo: like you put your controller routes under admin/model.rb and other sorts of insanity
[19:52:21] tubbo: AntelopeSalad: could be...you need to probably check if Post.where().any? first
[19:52:39] AntelopeSalad: tubbo: all i know is if i replace _attributes with _all , then it works fine
[19:52:49] tubbo: jstrong: you put your admin dashboard config in app/admin. it's useful if you want to have a separate admin panel from a user-facing app
[19:52:55] tubbo: AntelopeSalad: so do that :)
[19:52:59] mosez: tubbo: not really elegant implemented :)
[19:53:01] AntelopeSalad: yeah but then i don't have validation
[19:53:08] jstrong: tubbo: I know I use it.
[19:53:09] tubbo: mosez: what, activeadmin?
[19:53:32] tubbo: jstrong: yeah, i basically stopped b/c it required devise and i have trouble getting devise and ember.js to play nice. so i've been writing my own auth recently.
[19:53:56] jstrong: tubbo: I stopped because simple things that active admin doesn't do is hard to add in
[19:54:00] mosez: tubbo: i would implement the find_volume method on another way. without adding render json for 404.
[19:54:18] AntelopeSalad: tubbo: do you find those tests to be really useful?
[19:54:19] tubbo: jstrong: yeah def. i would never ship a product not designed for devs that uses AA on the backend.
[19:54:38] AntelopeSalad: maybe i'm wrong (probably am :D) , but it mostly looks like you're testing rails there
[19:55:00] tubbo: AntelopeSalad: nah, i'm testing the passing of data into a request and seeing if a record gets changed.
[19:55:11] SloggerKhan: Is OmniAuth widely used? Has anyone had experience with it?
[19:55:18] tobobo: i have a question about active record relations. i have a post model which has an author and child posts. each author has an avatar, which is a separate model
[19:55:22] tubbo: basically i want to know that the controller's update() method is doing its job, and editable_params isn't omitting any values that are supposed to get change.d
[19:55:32] scriabin: I'm curious if anyone's thought of this? Array.map returns another array where the mapping function has been applied to each element. Why does AR.map(&:attr) only return an array of attr's?
[19:55:41] tobobo: how can I get a post and all its children, with authors and avatars, without doing a ridiculous number of database queries?
[19:55:48] scriabin: so the default behavior of map is to mask out other attributes?
[19:55:55] tubbo: scriabin: it's called .each() :P
[19:56:03] AntelopeSalad: tubbo: i think i see the difference in our use case
[19:56:11] tubbo: scriabin: map() is a function, it's really more generic than in AR.
[19:56:12] AntelopeSalad: you're using it on an instance of volume
[19:56:16] AntelopeSalad: i'm using it on the model
[19:56:36] AntelopeSalad: i guess the 2 methods do completely different things?
[19:56:41] s2013_: got a q about cancan. for the roles, should you have a separate model for it?
[19:56:44] tubbo: AntelopeSalad: yep, that's what i said a hour or so ago...update_all is supposed to be a class method iirc.
[19:56:49] scriabin: map applise to Enumerable I suspect
[19:56:49] tubbo: i guess either one works
[19:56:56] tubbo: scriabin: yeah, it's part of Enumerable
[19:56:58] AntelopeSalad: either one won't work tho
[19:57:01] tubbo: scriabin: so it always returns an array
[19:57:07] AntelopeSalad: because in this update_all call i'm making it's on the class itself
[19:57:18] AntelopeSalad: because it's bulking up multiple records to be edited
[19:57:25] tubbo: i don't think your update_all solution is very easy to read
[19:57:44] mosez: yay... i like refinerycms more and more 8)
[19:57:45] AntelopeSalad: what would you do to make it more readable?
[19:57:46] tubbo: instead, i feel like it should compile everything it needs to do first, then execute the loop
[19:57:51] scriabin: I'm trying to figure out how to create a map() function for a custom wrapper of Enumerable
[19:57:59] scriabin: but I need to understand map first
[19:58:02] tubbo: AntelopeSalad: well explain to me exactly what you're trying to do there, without using code
[19:58:03] mosez: got it running on rails 4 and currently i'm porting some extensions for me :P
[19:58:12] tubbo: scriabin: you can always use reduce() to change the type you get back
[19:58:18] pipework: scriabin: methods, and the notation is either #,., or :: for methods.
[19:58:28] tubbo: scriabin: i typically use reduce() to slim down hashes, or make a hash collection out of objects
[19:58:32] pipework: What's hard to understand about map?
[19:58:38] pipework: Have you read about map and reduce?
[19:58:52] AntelopeSalad: tubbo: sure, i have a list of posts and each post has a category. in the post's index view i have a bulk option to change the category of each checked off post, then that query i pasted is ran in a controller action
[19:59:13] AntelopeSalad: it all works great but the skipping of validation is unacceptable
[19:59:23] pipework: AntelopeSalad: It doesn't skip them.
[19:59:37] AntelopeSalad: pipework: yes it does because i just input bad data by adjusting the form
[19:59:46] AntelopeSalad: i was able to add in a foreign key that does not exist
[20:00:24] AntelopeSalad: i manually used chrome to change an id to 666 and it changed the category_id to each post to 666
[20:00:28] pipework: Have you tried the bang version?
[20:01:06] scriabin: pipework: it just seems irregular - normally map takes a block (proc?), and applies the block to every element in an Enumerable and returns the new Enumerable. But map(&:attr) just returns an array of attr
[20:01:07] AntelopeSalad: nope, i'll give that a shot although a real error is something i'm not sure how to deal with yet
[20:01:35] pipework: scriabin: Symbol#to_proc is what you see there.
[20:01:41] AntelopeSalad: pipework: update_all! is not a valid method btw
[20:01:47] pipework: It's just doing map {|thing| thing}
[20:01:57] pipework: AntelopeSalad: I don't use update_all in any way, like I said before.
[20:02:07] AntelopeSalad: pipework: there's no alternative
[20:02:14] AntelopeSalad: update_attributes is something else entirely
[20:02:14] pipework: AntelopeSalad: update_attributes!
[20:02:22] scriabin: pipework:now that makes sense. I wonder if it works out of the box on my data structure...
[20:03:03] AntelopeSalad: pipework: scroll up to see what i'm using it for, update_attributes is something that works on an instance of a model , i am doing a bulk update referencing the model itself
[20:03:26] pipework: AntelopeSalad: I'm a bit wrapped up in candy box atm.
[20:03:40] AntelopeSalad: i know how to get around the problem i think, i can make my custom validator to make sure the category exists a class method that takes an input?
[20:03:59] AntelopeSalad: since i have the category_id before i run that bulk query i can only run it if it passes that test?
[20:07:52] AntelopeSalad: hmm, is it not possible to have a class method act as a custom validator?
[20:09:04] tubbo: AntelopeSalad: https://gist.github.com/tubbo/cb2a322def9c1c1135ab
[20:09:19] tubbo: i guess it's not the most efficient way to do it
[20:09:39] tubbo: in fact, if i was *really* doing this i might even write a method on the model that just executes a custom query
[20:10:24] tubbo: b/c you're basically looking to do "UPDATE posts SET category_id=#{some_id} WHERE id IN (#{collection_of_ids})"
[20:10:35] AntelopeSalad: this is what i came up with: http://pastie.org/8358282
[20:10:39] AntelopeSalad: i didn't test it yet tho
[20:11:04] pipework: Add a lambda as the validation block for a validates method call.
[20:11:08] mrstibbons: Why could it be that singleton methods that i defined on modules are no longer found?
[20:11:14] AntelopeSalad: tubbo: that query you wrote is exactly what gets executed in my query
[20:11:18] pipework: mrstibbons: 'no longer found' in what way?
[20:11:19] tubbo: AntelopeSalad: yeah that seems like what you want. but you wanted validations though
[20:11:29] mrstibbons: pipework: "method missing" way
[20:11:31] AntelopeSalad: tubbo: the category.exists? call is the validation
[20:11:34] helpa: mrstibbons: 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.
[20:11:34] pipework: mrstibbons: !code
[20:11:49] AntelopeSalad: if the category id does not exist then we know it's invalid
[20:11:52] tubbo: AntelopeSalad: so wait, if you really want validations, why not just reduce(true) over valid? on each model
[20:12:05] tubbo: AntelopeSalad: since update_all just fires that query, you could manually do validation prior to that
[20:12:56] tubbo: or wait that is not possible n/m
[20:13:28] tubbo: AntelopeSalad: so you're gonna have to make a choice here, you have to make sure category_id is real (which you're doing) before you actually call update_all. you can't run validations in update_all b/c it's just a SQL query.
[20:13:40] mrstibbons: pipework: https://gist.github.com/anonymous/6bd269332f75b2c0b7dd
[20:13:46] tubbo: you could go the efficiency route and just fire the query, or you can go the secure route and iterate through each object to update.
[20:14:04] AntelopeSalad: tubbo: that pastie i pasted gives the best of both worlds and seems to pass all tests
[20:14:11] tubbo: if you do end up going the latter route, you might want to build something in to collect and catch errors each model throws, so you can output to the user. that'd be the only reason i would really do that second one.
[20:14:15] tubbo: AntelopeSalad: you're good then! :)
[20:14:26] AntelopeSalad: it only runs Category.exists? once before the update all
[20:14:28] s2013_: do i need to put jquery-ui in my assets folder to include it or can rails use it automatically if i require it
[20:14:36] AntelopeSalad: then either runs the update all or insta fails with a redirect
[20:15:04] ivanskie: I'm getting some sort of a conflict i think..
[20:15:16] makerop: s2013_, you can typically include it in application.js
[20:15:21] AntelopeSalad: tubbo: i think in the future though... with a more complicated validation i might have to do something that you mentioned
[20:15:27] ivanskie: on my items index view.. i dynamically swap vendor_id for item.vendor.name
[20:15:28] s2013_: i did that and it says cant find it
[20:15:29] makerop: make sure the gem is added though
[20:15:31] pipework: mrstibbons: I don't think you need to put them on the eigenclass.
[20:15:38] s2013_: couldn't find file 'jquery-ui'
[20:15:44] ivanskie: on one of the pages, it throws undefined method 'name' for nil
[20:15:47] makerop: is it in your Gemfile?
[20:15:53] ivanskie: i looked in my db, i don't have a nil name..
[20:16:00] makerop: jquery-rails that is
[20:16:01] s2013_: makerop, talking to me?
[20:16:11] s2013_: yeah jquery-rails is installed
[20:16:56] s2013_: i guess ill just use this https://github.com/joliss/jquery-ui-rails
[20:16:56] makerop: s2013_, what about gem 'jquery-ui-rails'
[20:17:03] s2013_: no, ill install it now
[20:17:12] makerop: s2013_, http://stackoverflow.com/questions/17830313/couldnt-find-file-jquery-ui
[20:17:28] ivanskie: oh i have blank item models with nil vendor fields argh
[20:17:32] s2013_: gotcha, thanks
[20:18:24] AntelopeSalad: tubbo: do you think for something more complicated it would be reasonable to just load up a form in a new view, sort of like that "edit multiple" rails cast?
[20:18:44] AntelopeSalad: so the user sees multiple forms for each record and then handling validation per record is easy street
[20:18:58] RustyShackleford: how can I make a form entry which will save to datetime ?
[20:19:14] scriabin: collective rails genii: how do I make a map function? https://gist.github.com/chewmanfoo/6719942
[20:19:26] tubbo: AntelopeSalad: possibly, or use nested attributes: accepts_nested_attributes_for / fields_for
[20:19:26] scriabin: seems like something like find but not sure.
[20:19:40] tubbo: scriabin: why would you do that, when ruby has map()?
[20:19:48] AntelopeSalad: tubbo: ok, i'll read up on that if it comes up. i remember seeing that in a cast but i didn't watch it yet
[20:20:28] scriabin: tubbo does ruby's map wrk with that data structure? Maybe I should change the data structure
[20:21:08] mrstibbons: pipework: it was working fine for about half a year. today i updated to ruby 2.0 / rails 4 and suddenly it starts to complain. From another app where it is stil working (also ruby 2.0 / rais 4): https://gist.github.com/anonymous/d0bfe5159d139a7afd50
[20:22:20] tubbo: scriabin: https://gist.github.com/tubbo/6719960
[20:22:30] tubbo: scriabin: and yes, it does. Hashes are Enumerable
[20:23:37] ridingwithrails: hello all???.quick question: I have a simple form that I want to protect from bots/spammers
[20:23:42] ridingwithrails: I cannot use capthca
[20:23:54] ridingwithrails: any suggestions for a rails 3 app
[20:24:05] tubbo: ridingwithrails: why can't you use captcha?
[20:24:22] ridingwithrails: the product guys don't want that solution
[20:24:27] ridingwithrails: that was my original idea
[20:24:30] ridingwithrails: but was shot down
[20:24:48] ridingwithrails: any other thoughts?
[20:25:01] mrstibbons: pipework: Besides, this should just work. Just a class method on the eigenclass. why is the method lookup fucked? The method should be listed in Module.methods but it isn't. But its there, it's defined. I just don't get it
[20:25:02] thebobmarley: mrstibbons: More love, less hate: http://www.youtube.com/watch?v=CHekNnySAfM
[20:25:06] tubbo: ridingwithrails: ask them if they have a better solution. make sure you pick out a good captcha tool because i'm 99% sure they don't have any better ideas.
[20:25:30] ridingwithrails: yeah no other good ideas???they are looking at me
[20:25:31] tubbo: ridingwithrails: also by "captcha" what do you mean? captcha doesn't necessarily mean an ugly word. could be a mathematical word problem, etc.
[20:25:49] tubbo: ridingwithrails: shrug and tell them "that's your problem. get back to me when you have something you want me to code." :)
[20:25:56] EspenA: is there a gem or is there a setting that will put active record in read only mode? (for a limited time with a setting/command)
[20:26:00] ridingwithrails: yeah it is looking that way
[20:26:16] tubbo: ridingwithrails: if they're going to reject an industry-standard solution to a problem they better have another solution for you. sounds like they're wasting time and wasting money.
[20:26:19] ridingwithrails: I am fighting myself from writing some crazy solution
[20:26:26] tubbo: don't do that, push back.
[20:26:26] EminenceHC: Has anyone ever populated a ransack search field from a value set in the controller?
[20:26:37] pipework: mrstibbons: Give me a second, I think I remember this odd stuff.
[20:26:42] tubbo: especially if it's a client who's paying you a fee. they're wasting their/your time and money.
[20:26:54] mrstibbons: pipework: awesome! take your time :)
[20:27:28] ridingwithrails: @tubbo you are right, just making sure I do my due diligence
[20:28:02] ridingwithrails: the only idea I had was some kind of token exchange which would lock a bot out for a few minutes
[20:29:04] ridingwithrails: **that is kinda close to the write tons of code that barely protects
[20:29:20] tubbo: ridingwithrails: you could do that, like accounts timeout. but it's not really a great solution unless you're also trying to protect users brute-forcing the password
[20:29:52] ridingwithrails: yeah that is the only thing I can think outside of the obvious
[20:30:01] ridingwithrails: solution which is the captcah
[20:30:12] tubbo: but captcha is still better at getting rid of spambots.
[20:30:28] tubbo: timeout is a solution to 2 problemsa t once but it's not really that great at either of them
[20:30:58] ridingwithrails: well, I will present the ideas and see what they say
[20:31:23] tobobo: I'm curious to hear how others would approach the issue I'm currently having
[20:31:48] pipework: With alcohol in hand.
[20:32:01] tobobo: I have a Project model, which has many child posts.
[20:32:06] tobobo: the posts have authors, and the authors have avatars
[20:32:14] tobobo: the posts also have child posts
[20:32:25] tubbo: tobobo: check out joins() and includes()
[20:32:35] tubbo: that will combine multiple data points into the same query (usually with a JOIN)
[20:32:57] tobobo: tubbo: i've been messing with those a little bit but it seems like I might be approaching it wrong
[20:33:07] slash_nick: tubbo: have you used honey pots/reverse captchas?
[20:33:14] tubbo: slash_nick: nope.
[20:33:49] slash_nick: Was wondering whether they'd still be useful
[20:34:17] tubbo: not sure, i've never used one
[20:34:56] slash_nick: You just hide an input, and if it gets filled in then you assume a bot filled in the form...
[20:35:15] tubbo: that seems like a nice solution :)
[20:35:29] slash_nick: I'd think spam bots would catch on rather quickly though
[20:35:30] tubbo: slash_nick: is it easy to break though? like with a form input automator or 1password?
[20:35:54] slash_nick: tubbo: I don't know :) Remember I was the guy asking you :) lol
[20:36:39] rhizome: catch the field, then return a benign false error like "email is wrong format" or something
[20:38:04] vim_shim: How do you guy's like to handle nested forms? So far I've looked at cocoon, reform, and form objects.
[20:38:31] mosez: cocoon is fine :)
[20:39:13] scriabin: when I just try @servers.map(&:batch_group) I get NoMethodError: undefined method `batch_group' for #<Array:0x0000000f855b88>
[20:40:29] mrstibbons: pipework: well, on the fly it is working. https://gist.github.com/anonymous/18551756d1cd5d947872 Any Idea how I could research the problem?
[20:40:33] tubbo: scriabin: ah right, that's gonna run a method. you probably want @servers.map { |s| s[:batch_group] } or whatever
[20:40:39] pipework: scriabin: @servers has an array of arrays then
[20:41:07] s2013_: im trying to render a list of venues
[20:41:12] s2013_: into a json file.. http://paste.ubuntu.com/6160302/
[20:41:15] pipework: mrstibbons: I'm really not quite sure.
[20:41:17] s2013_: but when i go there its just blank
[20:41:29] Mok99: is there a way to use 'get' method instead of 'delete' for the destroy action?
[20:41:42] pipework: It uses a get.
[20:42:06] s2013_: i am not sure why it not woring
[20:42:21] Mok99: it shows as "DELETE" in the route list
[20:43:08] mosez: hum... reform looks pretty well... never saw it before
[20:43:50] vim_shim: the dsl is great, and I really want to use it form my project
[20:44:12] vim_shim: The documentation is just a little all over the place.
[20:44:25] mosez: got to bookmark reform :)
[20:44:40] mosez: reform in combination with simple form sounds great :)
[20:44:59] makerop: s2013_, what URL are you going to?
[20:45:04] pipework: mosez: Browsers don't know how to DELETE.
[20:45:08] s2013_: going to /search_venues
[20:45:21] s2013_: that should be the correct one. in routes i have
[20:45:21] s2013_: match 'search_venues' => 'search_venues#index'
[20:45:22] makerop: s2013_, goto /search_venues.json
[20:45:26] mosez: pipework: wrong person :)
[20:45:36] s2013_: shouldnt it automatically return .json though?
[20:45:44] makerop: s2013_, no
[20:46:03] s2013_: oh. ok looks like thats working
[20:46:07] mosez: s2013_: if your controller responsds to json only yes.
[20:46:28] mosez: ok... time for gaming. gn8 ppl
[20:46:28] s2013_: yeah thats all it does
[20:46:33] s2013_: thats why i was confused
[20:46:37] s2013_: it doesnt respond to html or anything else
[20:47:01] EminenceHC: Anyone know of a way to make Ransack filters use ajax requests?
[20:47:02] scriabin: pipework:I thought it was a hash of hashes
[20:47:10] s2013_: makerop, like mosez said, if my controller responds only to json then it should default to json right?
[20:47:14] pipework: Could be that.
[20:47:22] pipework: Except it isn't.
[20:47:39] scriabin: lots of curly braces
[20:47:48] makerop: s2013_, im pretty sure that if you are using respond_to, it will default to html
[20:47:56] s2013_: so is it respond_with ?
[20:47:57] makerop: adn even if you dont explicitly call it, it will still do so
[20:47:58] scriabin: does map coerce an enumerable into an array?
[20:48:06] makerop: but im not 100% positive
[20:48:11] s2013_: im tryint to get the autocomplete to work
[20:50:11] pskrz: scriabin: there's a map defined for enumerables and one for arrays
[20:51:15] workmad3: s2013_: no, a controller should not 'default to' json
[20:51:37] AntelopeSalad: having 0 or nil for a non-existent foreign key would be a big mistake right? it should always be nil?
[20:52:06] s2013_: https://gist.github.com/ss2k/a7b1b28ea9b552ff27d3
[20:52:07] workmad3: s2013_: if json isn't in the Accept header from the client, then the server should not return json
[20:52:12] scriabin: pipework: .map {|k,v| v[:batch_group]} works
[20:52:18] scriabin: I'm wondering if there's a simpler way
[20:52:19] s2013_: thats my coffee script for auto complete but it doesnt seem to return anything
[20:52:37] makerop: is search_Venues.json returning?
[20:52:43] makerop: outisde of coffe
[20:52:45] s2013_: now it is
[20:53:11] s2013_: but i tried it with @venues = Venue.all didnt try it with params[:term]
[20:53:22] tobobo: tubbo: is it possible to have a scope applied to the results of a has_many relation?
[20:54:36] s2013_: hmm i believe it is actually sending data back in the autocomplete
[20:54:46] makerop: is there anyone in here that loves off freelancing that I can chat with?
[20:54:49] makerop: pick your brain etc?
[20:54:49] s2013_: cause the drop down boxes become larger/smaller depending in the search term
[20:54:52] s2013_: but it just looks blank
[20:55:10] makerop: s2013_, watch the logs for the requests imo
[20:55:25] makerop: loves=lives*
[20:55:26] s2013_: yeah its working i just cant seem to see any text in the dorpdown
[20:55:42] makerop: that sounds js related
[20:55:58] s2013_: yeah let chek the console
[20:57:26] s2013_: oh i need value
[21:00:34] pipework: s2013_: Use .map {|_,v| v[:batch_group]} instead
[21:00:37] DaniG2k: guys im trying to use famfamfam rails gem with bootstrap 3 but it doesnt seem to work well with bootstrap's <li> tags :-/
[21:00:42] DaniG2k: any idea how I could fix it
[21:00:57] DaniG2k: (famfamfam flag icons, that is)
[21:01:14] scriabin: pipework:I think that was for me. Why the _ ?
[21:01:26] pipework: scriabin: Because _ means "I don't care about this variable"
[21:01:54] scriabin: you mean like that's the "rails way"?
[21:01:57] wmoxam: https://twitter.com/recruiterbro/status/383335199137726464
[21:02:01] s2013_: pipework, what do you mean
[21:02:17] pipework: s2013_: I didn't mean to highlight you, sorry.
[21:02:23] pipework: scriabin: No, it's ruby.
[21:02:38] scriabin: ah ok - will do then thanks
[21:02:44] s2013_: hmm i think i see an issue
[21:03:00] s2013_: my json file is returning everything from the db, i just wanted to get the name into the json. i think
[21:04:15] Xander1: need help/suggestion about creating a "filtered" / "guided" search - an example would be like the one on NewEgg
[21:04:50] scriabin: Xander1: you mean like being able to add/remove filters from the UI?
[21:05:01] Xander1: i have Users model with lots of attributes - and when they are all displayed, i would want to give a user that's searching an ability to filter by those attributes
[21:05:26] Xander1: i.e. if user checks off that "speaks spanish" only those that have it set to true, would show up
[21:06:30] Xander1: i was watching http://railscasts.com/episodes/370-ransack - looks like a great gem to use, but thought i'd ask also
[21:26:49] Stalkr^: Hey all, what resources do you recommend for HTML/CSS/JS? I want to get into Rails development, but I don't know any static web development really
[21:26:57] DeltaHeavy: Hey, does anybody know why I'm getting these following errors? I trued using 'git reset --hard' and removing the active_admin cache but neither helped - https://www.refheap.com/19050
[21:28:07] DeltaHeavy: Stalkr^: http://docs.webplatform.org/wiki/Main_Page
[21:28:15] pipework: Stalkr^: there's really a lot to learn.
[21:28:26] bastilian: DeltaHeavy: try removing the cache dir?
[21:28:39] DeltaHeavy: bastilian: I've already done that as stated in my question.
[21:28:40] makerop: or your Gemfile.lock
[21:28:42] Stalkr^: pipework: Gotta start somewhere I guess
[21:28:49] DeltaHeavy: makerop: Is that directed at me?
[21:28:53] Stalkr^: DeltaHeavy: Thanks, will check it out
[21:29:02] makerop: DeltaHeavy, ya
[21:29:14] DeltaHeavy: makerop: So I should DELETE my Gemfile.lock?
[21:29:27] DeltaHeavy: I'm a RoR beginner, I'm really just trying to get a project up on here to edit the SASS/HAML
[21:29:42] makerop: yes, shouldnt break anything
[21:29:46] makerop: then run bundle install again
[21:30:13] EminenceHC: RAILS IS FUCKING AWESOME!!!
[21:30:16] EminenceHC: thank you for your time
[21:30:21] makerop: DeltaHeavy, http://stackoverflow.com/questions/19002974/heroku-deployment-with-active-admin
[21:30:24] s2013_: @venues = Venue.where("name LIKE ?", "%#{params[:term]}%").limit(10) this works except if the it begins with the params[:term]
[21:30:34] DeltaHeavy: Ah, getting a different error now. Thanks!
[21:31:01] DeltaHeavy: makerop: I read that but I couldn't understand his answer at all. I'm not a Ruby/RoR person
[21:31:04] AntelopeSalad: EminenceHC: how many times have you single or double fist pumped in happiness when something you wanted to do ended up being a simple 1 or 2 liner but you expected it to be much worse?
[21:31:16] s2013_: i think its cause of case sensitivity
[21:31:55] EminenceHC: AntelopeSalad: About 100 times and I've only been using rails for a few weeks.
[21:31:57] makerop: DeltaHeavy, basically in your gemfile
[21:31:58] makerop: http://collectiveidea.com/blog/archives/2010/09/28/gemfiles-and-branches/
[21:31:59] s2013_: nvm i got around by using ILIKE
[21:32:08] AntelopeSalad: EminenceHC: the same thing happened to me
[21:32:18] makerop: plugin the vairables he mentioned in that stackoverflow post, following the patterns on the site i just linked
[21:32:31] makerop: variables*
[21:33:03] EminenceHC: AntelopeSalad: Keep in mind I come from the Drupal world so this stuff makes me extra excited about actually doing flexible programming.
[21:34:25] pipework: nigerianceo: Are you also a prince?
[21:35:15] AntelopeSalad: EminenceHC: i actually came from the polar opposite scene
[21:35:39] pipework: AntelopeSalad: You came from perl?
[21:35:57] EminenceHC: AntelopeSalad: python?
[21:36:19] pipework: Or worse... sales.
[21:36:26] AntelopeSalad: nah, node land but i still use it
[21:36:36] AntelopeSalad: i was just using it for crud/document heavy sites and it was tedious at times
[21:37:43] smintz: Hey guys: I would like to create a has_and_belongs_to_many association but I want to alias it, couldnt find any lead in the documentation nor googling it. can anyone point me to relevant doc?
[21:38:19] AntelopeSalad: the productivity boost i've seen already even with little experience is mind boggling
[21:38:52] EminenceHC: AntelopeSalad: I still want to learn node though I hear good things about it. I cant imagine it being as rapid of a framework as this though.
[21:39:19] smathy: smintz, just make whatever you want the name of the association, and use the :class_name option to set the class name to the real class name of the other model.
[21:39:20] thebobmarley: smathy: Mad? You just got to listen to me! http://www.youtube.com/watch?v=6yXRGdZdonM
[21:39:49] smathy: smintz, so: has_and_belongs_to_many :foos, class_name: "Bar"
[21:39:56] AntelopeSalad: EminenceHC: i would treat it as something you might use in addition to rails to handle other services rather than making the actual public facing site
[21:40:32] smintz: smathy: so, no join table required?
[21:41:05] DeltaHeavy: Why am I getting 'mysql.h is missing. please check your installation of mysql and try again.' when I have mysqld installed via yum?
[21:41:20] fryguy: DeltaHeavy: need to install dev packages
[21:41:22] smathy: smintz, the habtm join table is inferred from the class name of where you declare it, and the class name of what it's associated to.
[21:41:23] thebobmarley: smathy: Let me help you: http://www.youtube.com/watch?v=-JhwxTen6yA
[21:41:32] DeltaHeavy: fryguy: Thanks!
[21:41:58] smathy: DeltaHeavy, because you need the dev/devel package, so the header files are included.
[21:42:12] smathy: Oh sorry :) Missing that it had already been answered.
[21:42:18] DeltaHeavy: np, thanks for the effort!
[21:42:43] dopie: anyone here mess with CKEditor
[21:51:25] nigerianceo: dopie i've tried it a bit
[21:51:29] nigerianceo: went with redactor instead
[21:57:38] t27duck: dopie: I've become a fan of http://www.sceditor.com/
[21:59:21] dopie: t27duck, thats cool but need upload
[22:00:14] t27duck: ACTION wrote his own using paperclip and jquery
[22:00:21] t27duck: (fileupload)
[22:01:28] nigerianceo: i wrote my own web framework from scratch in assembly ok
[22:02:00] nigerianceo: DON"T U TALK TO ME ABOUT MASOCHISM
[22:03:47] foucist: socket 7 from ASM ftw
[22:04:24] foucist: i kid, i coded it in forth
[22:35:03] Radar: Good morning.
[22:35:34] pipework: Radar: Hidar.
[22:49:01] pontiki: man, someone has to make a JS framework called "rubberband" so we can macguyver things with paperclip and rubberband
[22:50:04] esparkman: haml vs slim....pros and cons.....I'll hush up and read
[22:50:38] pontiki: dunno slim
[22:50:42] pontiki: should look at ti
[22:54:48] pipework: esparkman: They both have clientside library implementations and server, right?
[22:55:03] esparkman: not sure about server side
[22:55:14] esparkman: i'm more curious as to folks opinions
[22:56:06] pipework: http://me.phillipoertel.com/articles/2013/02/03/why-i-like-the-slim-template-engine
[22:56:18] pipework: I'm still a fan of writing erb.
[22:56:30] esparkman: i'm not a fan at all of erb
[22:56:47] pipework: Juggling conversion and markup stuff isn't really in my priorities.
[23:05:26] dopie: anyone ever change toolbars in CKEditor?
[23:14:55] bricker`work: dopie: I could possibly help, what's the problem?
[23:15:16] dopie: bricker`work, got it working :)
[23:15:27] dopie: was not paying attention and forgot .coffee
[23:15:55] dopie: :happy: :happy: :happy:
[23:16:11] dopie: bricker`work, would you know the reference i just did
[23:17:19] bricker`work: ren & stimpy?
[23:18:22] dopie: http://www.youtube.com/watch?v=iWp1VOFQxKg
[23:25:01] momomomomo: AHhhhh I finally started answering questions in SO yesterday, and I'm addicted :/
[23:25:27] momomomomo: 90% of the helped don't respond afterwards or acknowledge that the problem was fixed :/
[23:26:40] pipework: I stopped playing because people are incurably stupid quite often, and those that are curable are too few.
[23:27:16] momomomomo: pipework: I've come across a few unfortunate situations, but mostly just quietly back away
[23:29:25] bricker`work: I was once #2 ranked on SO because I also got addicted to answering questions
[23:29:28] bricker`work: now I've fallen off
[23:29:43] momomomomo: bricker`work: It's like this channel, except.. internet points
[23:30:04] pipework: I do it for free without recognition via points.
[23:30:17] momomomomo: pipework: same, which is why I hang out here :p
[23:30:38] momomomomo: pipework: but I don't have an awesome github profile, and figure the points might help give me a half a cool point in an interview
[23:31:08] momomomomo: maybe I should just squash some issues in a project :|
[23:31:09] pipework: I just have a neat resume that has some good names on it.
[23:31:21] pipework: Most of the other things seem to come second to that.
[23:31:26] momomomomo: pipework: My first SE gig was this year
[23:31:41] momomomomo: starting in Feb, prior to that I led departments at a radio network, and worked at an ad agency
[23:31:59] momomomomo: and ran my own businesses (one still ongoing??? making more than my current salary actually haha)
[23:33:40] momomomomo: So it's a neat salary, but for the 'wrong' career
[23:34:21] smathy: I love candidates who have run their own gigs.
[23:34:47] momomomomo: Where are you based? :)
[23:35:00] smathy: San Diego :)
[23:35:36] momomomomo: Well, my sister IS moving out there literally tomorrow - I'll be there on the 4th if you want to meet for coffee
[23:36:20] smathy: Heh, amazing coincidence.
[23:36:32] smathy: Ping me at jk@handle.it
[23:36:40] smathy: gtalk, email, your pick
[23:37:39] momomomomo: How about gchat? I'm at a coffee shop and would rather not start talking at my computer
[23:46:26] pontiki: does the new hangover..err hangout thing work for ppl?