« Back to channel list

#RubyOnRails - 28 June 2013

« Back 1 day Forward 1 day »
[00:00:20] Radar: feens: did the version with the double colon prefix work?
[00:00:30] feens: trying it now…had to recreate the file
[00:00:34] Radar: pothibo: Because class name takes a string.
[00:00:42] slash_nick: sprite--: now, @all_the_dependencies may include a handful of other service objects... like here https://github.com/rthbound/protected_record/blob/master/lib/protected_record/use_case/update.rb
[00:01:02] Radar: pothibo: And if you specify a Class object and the other class calls back to the original class then you're going to have a bad time.
[00:02:28] superscott[8]: if i have an array of active record objects, is there a way i can pick the one i want by id?
[00:03:08] superscott[8]: id being the table.id column not, the index of the array
[00:03:46] Radar: superscott[8]: how did you get the array in the first place?
[00:03:58] feens: Radar: in the console, if I do org.type, it returns nil
[00:04:16] feens: and then in my form, f.association :type gives "undefined method `where' for ActiveRecord::AttributeMethods::Serialization::Type:Class
[00:04:35] superscott[8]: Radar: i'm just wondering if i can look it up from the data i already have instead of going back to the db with the ID
[00:04:42] Radar: feens: now you're learning the valuable lesson of not using reserved class names within Rails.
[00:04:56] Radar: feens: Move the model to organization_type.rb, call it OrganizationType and be done.
[00:05:02] feens: ya, I was wondering if that may cause issues
[00:05:15] Radar: Yes, using Type or type within AR almost always causes trouble.
[00:05:23] feens: and that;s what I had done when we started this convo
[00:05:33] feens: just wanted to see if I missed anything
[00:05:58] nT4BR: Hi guys, i need to build one query for find rows that has not itens on relation (has_many)
[00:06:02] nT4BR: any idea?
[00:06:18] Radar: nT4BR: that question does not make any sense. Please slow down and explain it better.
[00:06:28] feens: Radar: is it really recommended to use model folders anyway?
[00:06:32] nT4BR: i have a table questions
[00:06:37] Radar: feens: only in extreme cases
[00:06:38] nT4BR: and one table named answers
[00:06:39] helpa: nT4BR: The enter key should not be used as a space bar. Lines on IRC can be up to 400 characters long.
[00:06:39] Radar: nT4BR: !enternotspace
[00:07:04] nT4BR: i want to find questions that not has answers yet
[00:07:06] Radar: feens: how big is this project going to be anyway?
[00:07:13] superscott[8]: Radar: am i over thinking this, and should just look it back up by ID in the db?
[00:07:23] Radar: nT4BR: http://stackoverflow.com/questions/1314408/finding-all-records-without-associated-ones
[00:07:39] feens: well, we're over 20 models now
[00:07:44] Radar: superscott[8]: Seems like my first message didn't get through. How did you get the array in the first place?
[00:07:45] feens: and pretty early in dev
[00:07:53] Radar: feens: Apply YAGNI liberally.
[00:08:28] feens: heh. well, it was my co-worker's suggestion…but seemed logical enough
[00:09:05] superscott[8]: Radar: looking it up via active record :: data = Contacts.where(:sales_code => '1011').order('full_name ASC')
[00:09:36] nT4BR: Radar: thank you bro, this worked like a charm
[00:09:48] Radar: superscott[8]: that's an ActiveRecord::Relation object masquerading as an Array. The query has not been executed at that point, so you can do data.find(<id>) and that'll only execute one query to find the object you're looking for.
[00:11:46] superscott[8]: Radar: yeah but i need that look up for the first step. now the second step will be after all those contacts are loaded into the array. they pick one of the contacts and get more info about that particular record. so i thought instead of going back to the db to get just that single record, i could "re-query" the data i already have
[00:12:38] Radar: superscott[8]: I am not understanding the problem.
[00:12:53] Radar: I can't see the same things your seeing with the flow so I am completely in the dark here.
[00:29:05] slash_nick: feens: What?
[00:32:00] banas: I've been looking at this example https://github.com/Velir/open_id_authentication#example . In the sessions controller, they make use of the method successful_login (defined towards the end).
[00:32:37] banas: It says @current_user.id . Where does this come from?
[00:32:48] banas: I mean, where is @current_user defined?
[00:34:13] superscott[8]: Radar: hopefully that explains it? https://gist.github.com/superscott/216ac50f862b9a5e4344
[00:34:55] slash_nick: mixed camel and snake casing with those method signatures
[00:35:39] superscott[8]: i don't even if it's even worth it to try and get it back from the global, or just re-look it back up in the db
[00:40:00] slash_nick: superscott[8]: a little lost here... what are you trying to do?
[00:40:11] fgo: banas: Perhaps a helper_method from the ApplicationsController?
[00:40:28] superscott[8]: slash_nick sorry, the console section of the gist explains what's kinda going on
[00:40:58] superscott[8]: slash_nick: trying to figure out if i can lookup an active record object from inside a global i've already defined
[00:41:02] banas: fgo, so I'll have to define that explictly, am I correct? Since that README didn't say anything about it, I had assumed otherwise.
[00:42:15] slash_nick: superscott[8]: yeah but why
[00:42:45] slash_nick: where is the other place you want to access it from?
[00:43:05] superscott[8]: slash_nick: just cause i guess? :D didn't know if it's possible without iterating over everything
[00:43:38] superscott[8]: i'm going to render a partial with the full contact info, so i need to go back to the controller anyways
[00:45:03] superscott[8]: it might be a more academic question at this point
[01:04:58] Radar: superscott[8]: I still don't undersrtand what you're trying to do.
[01:08:32] superscott[8]: Radar: it's all good. i don't think it's even a thing
[01:13:12] edwardthefma: i need help installing json gem in windows8
[01:14:56] edwardthefma: https://gist.github.com/edwardthefma/5881731
[01:15:50] superscott[8]: edwardthefma: ah, mingw doesnt know where your gcc compiler is
[01:16:11] edwardthefma: ok how do i fix
[01:16:40] superscott[8]: edwardthefma: http://www.mingw.org/wiki/InstallationHOWTOforMinGW
[01:17:18] superscott[8]: get the gcc-core (bin and dll)
[01:18:06] king313: Hi! I am looking for a way to integrate compass with rails 4. At the moment all I have found is this gist: https://gist.github.com/Nielsomat/5319529
[01:18:16] king313: which makes use of: gem "compass-rails", github: "milgner/compass-rails", ref: "1749c06f15dc4b058427e7969810457213647fb8"
[01:18:42] Radar: king313: https://github.com/Compass/compass-rails/issues/89#issuecomment-19985613
[01:18:45] king313: I do not trust placing a commit in my Gemfile for a production application
[01:19:05] king313: ACTION is reading, thx Radar 
[01:19:22] superscott[8]: king313: does it just break without the assets group?
[01:21:20] king313: no, the problem is that I do not trust referencing this commit in a stable development
[01:21:47] king313: I am going to treat code and style in separate ways, giving rails just the css
[01:23:06] superscott[8]: ah i see. you could just save that branch/commit/fork locally :)
[01:23:21] superscott[8]: but yeah i know what you mean
[01:33:59] edwardthefma: i give up on rails and windows
[01:34:14] chrisan: use a VM on windows, life = happy
[01:34:33] edwardthefma: ima buy a new pi
[01:35:15] sevenseacat: wow, chris eppstein cut sick in that GH issue
[01:35:29] edwardthefma: im trying to make a google cloud messiging app
[01:35:51] edwardthefma: using the gcm gem
[01:38:13] chrisan: any devops around? is Chef the best choice for ruby people or should I consider puppet/salt/ansible?
[01:38:44] sevenseacat: chrisan: i think it boils down to personal preference.
[01:39:43] chrisan: I was only leaning towards chef since it was written in part with ruby, havent tried any of the others
[01:43:49] mysk: hi, I'm newbie at ror, how can I become expert ? advice ?
[01:44:24] kyubey: keep working at it
[01:45:01] chrisan: railscasts.com helped kickstart me
[01:46:10] superscott[8]: edwardthefma: vagrant + linux + writing code in windows
[01:46:22] mysk: kyubey: working how ?
[01:46:22] soahccc: I try to manually create the routes for a nested resource inside a namespace. What do I need to do to get the routes named like "new_forum_thread_post_path" instead of "forum_new_thread_post_path"? https://gist.github.com/2called-chaos/9a1b1af1c55fa52ee770
[01:47:08] superscott[8]: edwardthefma: you can write the actual code in whatever windows editor you're using, but actually run code via you vagrant instance, and view your rails app on your windows web browser
[01:47:28] edwardthefma: <superscott[8]> im just trying to cope with a busted raspberry pi
[01:47:51] superscott[8]: edwardthefma: oh, then why did you need windows help :D
[01:47:59] edwardthefma: and continue with windows untill my pi arives
[01:48:51] edwardthefma: i wish thare was a better way
[01:49:11] superscott[8]: edwardthefma http://www.vagrantup.com/
[01:49:28] superscott[8]: that would give you less of a headache for the time being
[01:49:48] edwardthefma: ill check it out
[01:50:58] superscott[8]: edwardthefma: there are a bunch of pre-built vagrant boxes that already have ruby/rails/rvm setup and everything
[01:51:41] superscott[8]: http://www.vagrantbox.es/
[01:52:13] edwardthefma: hopefully i can get my google cloud messiging app working
[01:53:38] superscott[8]: the cloud never responds back to me when i talk to ti
[01:54:18] edwardthefma: well im going to use it to push messgis to phones
[01:55:18] edwardthefma: calling rails to push
[01:55:42] edwardthefma: make a phone ring or buzz
[02:07:45] rhizome: hmm, index caching seems to be stuck "on"
[02:08:01] rhizome: caching disabled in dev
[02:14:03] Ruxton: I'm building a template handler can someone help me get the code looking nicer https://gist.github.com/Ruxton/5881840
[02:19:18] soahccc: Isn't counter_cache supposed to track changes (category changes)? belongs_to :category, touch: true, counter_cache: true
[02:19:41] sevenseacat: its supposed to track the count.
[02:20:31] soahccc: sevenseacat: yeah I mean there is a callback on create and destroy but when I update the category it doesn't update the counters
[02:20:44] sevenseacat: got some more code and an example?
[02:27:40] soahccc: Hmm weird, it works in the console... Seems to be something different
[02:30:30] Radar: Ruxton: A+
[02:33:36] willbradley: hey, is cancan still a thing people are supposed to use?
[02:34:07] willbradley: i'm about to write a post/suggestion/vulnerability-fix but the smell of bit-rot is lingering around the project
[02:35:42] esparkman: howdy folks
[02:37:10] esparkman: Radar: how goes it?
[02:37:15] sevenseacat: willbradley: it's certainly still the most common option.
[02:37:28] sevenseacat: even though its had no significant development in several years.
[02:37:29] esparkman: sevenseacat: how's it goin'?
[02:37:36] sevenseacat: esparkman: howdy
[02:37:43] willbradley: ah, it seems the bug may have been fixed in version 2.0 which is still in "early development"
[02:37:52] sevenseacat: and has been for some time :(
[02:38:01] Radar: esparkman: it goes well
[02:38:08] esparkman: Radar: good good
[02:39:35] apneic: Does anyone know by any chance if Resque workers have issues with namespaced classes?
[02:40:07] esparkman: apneic: i'm not 100% sure, but I would imagine it would.
[02:40:15] apneic: esparkman: why's that?
[02:40:44] soahccc: sevenseacat: https://gist.github.com/2called-chaos/5c62d111bf3d15f31a18 I don't understand why this works in the console (so updating the counter cache) Thread.find(1).update_attributes(category_id: 2)
[02:41:29] soahccc: That is what basically should happen in line 43
[02:41:54] esparkman: now that was some wicked thunder and lighting
[02:42:18] apneic: Ok, here's another question: What if I have 3 classes in a single module in one file.
[02:42:34] apneic: I know Rails doesn't like multiple classes per file, maybe resque is breaking because of that convention?
[02:42:45] esparkman: that could be possible
[02:42:45] sevenseacat: line 43 is going to explode if if params[:forum_thread].try(:[], :category_id).present? is false
[02:43:07] apneic: if that's the case, that would be kinda annoying. I'll try it out
[02:44:58] soahccc: sevenseacat: What do you mean? if it is false it won't change the category at all
[02:45:19] sevenseacat: soahccc: if its false, @category will be undefined
[02:45:28] sevenseacat: and line 43 uses @category.id
[02:45:52] soahccc: sevenseacat: well @category is set through a before filter, sorry :)
[02:45:59] soahccc: it would just override it there
[02:46:35] soahccc: It actually does change the category but it doesn't update the counter and I don't see a reason why
[02:50:25] soahccc: Unfortunately there are no sql logs but it did not update the counter: http://files.sven.bmonkeys.net/images/_%5Bmaster%5D__Volumes_code__project-production_geekya_%E2%80%94_ruby-20130628-044922.png
[02:53:41] banas: what's happening in this line?
[02:53:43] banas: http://pastie.org/8089961#4
[02:54:03] sevenseacat: banas: which part are you unclear on?
[02:54:09] sevenseacat: it looks pretty standard
[02:54:58] banas: I took that from the sessions_controller here https://github.com/Velir/open_id_authentication#example
[02:55:12] banas: but I don't get where that @account came from?
[02:56:22] sevenseacat: no idea. where are you defining it?
[02:57:19] banas: I wanted to set up just openid for my app. So I was looking at that code. I don't seem to see that @account being defined anywhere else in that example
[02:57:38] banas: I've modified it like this http://pastie.org/8089965
[02:58:40] sevenseacat: and does that do what you want it to do?
[02:59:12] gestahlt: I seriously dont get how content_tag works
[02:59:32] momomomomo: gestahlt: http://api.rubyonrails.org/classes/ActionView/Helpers/TagHelper.html#method-i-content_tag
[02:59:48] gestahlt: I got this:
[02:59:49] gestahlt: https://gist.github.com/anonymous/5882176
[02:59:54] gestahlt: it renders me the first concat
[02:59:57] gestahlt: and the last one
[03:00:02] gestahlt: but i need all of them
[03:00:10] sevenseacat: so add them all
[03:00:17] gestahlt: I have no idea how to do it
[03:00:20] banas: sevenseacat: When I remove the 12th line here, http://pastie.org/8089965#12, I can enter my OpenID url, it goes there, and even authetcates me (I believe). It returns to my app, and throws this error RuntimeError in SessionsController#create
[03:00:21] banas: Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id
[03:00:27] sevenseacat: remember that a method will only implicitly return the last value
[03:00:28] gestahlt: And i dont really get the explanations i get from google
[03:00:36] sevenseacat: ie. the content_tag :div, :uniqueness
[03:00:44] banas: Sorry I meant uncomment the 12th line
[03:00:55] gestahlt: But how can i return all? How do i need to enclose them?
[03:01:03] sevenseacat: gestahlt: add them all together
[03:01:25] gestahlt: But i need the div around it
[03:01:38] sevenseacat: banas: full code and full error plz
[03:01:46] sevenseacat: gestahlt: what?
[03:01:57] banas: Ok, one sec
[03:02:27] gestahlt: sevenseacat: you see, i want to render the content in a div.. means i need all 4 of them with the content i enclosed in content_tag
[03:02:53] sevenseacat: gestahlt: so you see how you're adding all the other strings together inside the content_tags? *do the same thing for the content_tags*
[03:04:43] gestahlt: sevenseacat: i dont really understand. I want to add the content in a div. I need a div with an ID around them all thats what the first content_tag is for, then the next ones to wrap them inside divs with classes
[03:05:01] sevenseacat: this makes me so sad
[03:05:08] momomomomo: gestahlt: http://stackoverflow.com/questions/4205613/rails-nested-content-tag
[03:05:08] sevenseacat: a content tag simply generates a string,right?
[03:05:15] sevenseacat: how do you add strings together?
[03:05:22] momomomomo: http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#method-i-concat
[03:05:37] Radar: what do I win?
[03:05:44] sevenseacat: Radar: a cookie.
[03:05:47] momomomomo: a free trip to switzerland
[03:05:54] gestahlt: Uh so place the + behind the end of each concat??
[03:06:19] Radar: gestahlt: this code seems like the perfect use case for a partial
[03:06:32] momomomomo: aye, it does
[03:06:57] banas: sevenseacat: Here's sessions_controller http://pastie.org/8089965#10 . Here's views/sessions/new http://pastie.org/8089978 . Here's what happens once my OpenID provider returns the details to my app http://pastie.org/8089983
[03:07:07] gestahlt: the + did the trick
[03:07:13] momomomomo: banas: http://gist.github.com will stop you from having all those different links
[03:07:49] gestahlt: radar: i need to add more logic to it. And i didnt want to add more partials
[03:07:52] king313: ACTION bye, roraholics :)
[03:08:05] gestahlt: Seriously.. the more i use rails, the more i hate it
[03:08:10] Radar: gestahlt: ok bye then
[03:08:22] gestahlt: thanks guys
[03:08:34] sevenseacat: 'i hate rails because i cant work out how to add strings together'?
[03:08:43] gestahlt: No.. a sum of things
[03:08:44] momomomomo: gestahlt: Partials are there to make your life easier - continue going down your concat path if you like, but it's goign to get spaghettified
[03:08:44] sevenseacat: seems a bit over the top dont you think
[03:09:19] momomomomo: gestahlt: one of the clients I work with exclusively does internal projects in vb.net, now THAT's a bummer.
[03:09:38] gestahlt: Sevenseacat: The amount of frustration it build up for me.. is massive
[03:09:54] gestahlt: i switched from VB to Ruby
[03:10:02] momomomomo: lol how are you not dancing?
[03:10:02] brownies: i'm actually ridiculously productive with Rails
[03:10:04] gestahlt: And it was hard
[03:10:10] brownies: my only worry is that maybe i'm becoming too dependent or spoiled by it
[03:10:11] sevenseacat: well thats not something we can help with, without information on individual problems
[03:10:12] gestahlt: it still is
[03:10:22] sevenseacat: ruby is a cakewalk compared to most other languages
[03:10:29] brownies: i'm at the point where i turn my nose up at a gig unless it's Rails
[03:11:08] Radar: gestahlt: that logic that'd be in your partial is what should be moved out to a helper… not the whole bloody partial
[03:11:11] gestahlt: Sevenseacat: I get irritated a lot by the usage. Maybe its too easy and doesnt look cryptic enough
[03:11:11] brownies: Ruby is pretty damn nice though
[03:11:21] Radar: calling content_tag a million times inside a helper is a code smell… one that indicates that the code should be moved into a partial
[03:11:28] Radar: Ruby generating HTML is slower than HTML.
[03:11:28] sevenseacat: gestahlt: any real examples or are we just going to whinge?
[03:11:45] gestahlt: Uaaa.. let me think
[03:12:28] momomomomo: banas: not wanting to debug the block you're sending to open-id, you might want to check out something like debugger or better-errors to understand what's going on under the hood of your methods
[03:12:56] gestahlt: Getters and Setters
[03:13:05] gestahlt: If you are used to the c# and vb way
[03:13:22] gestahlt: you waste a lot of time of googling / reading how it works with Ruby
[03:13:26] momomomomo: gestahlt: Save yourself the headache - don't. Like anything else, ruby and RoR take time to learn; you don't jump into C knowing how to create a linked list
[03:13:32] sevenseacat: so... learn ruby?
[03:13:36] helpa: Learn Ruby by reading this book - http://manning.com/black2 - The Well-Grounded Rubyist by David A. Black
[03:13:44] brownies: why not just read Programming Ruby?
[03:13:59] banas: sevenseacat: I'll be back in a bit. Here;s the files https://gist.github.com/sarupbanskota/5882209
[03:14:06] sevenseacat: and it didnt cover attr_reader/writer/accessor ?
[03:14:25] gestahlt: Oh it did, you just asked what was difficult
[03:14:28] sevenseacat: so we're blaming ruby for being too hard because you're set in your VB *ick* ways?
[03:14:39] gestahlt: Its different
[03:14:46] sevenseacat: very much so.
[03:14:52] sevenseacat: this is a good thing.
[03:15:08] gestahlt: Its just irritating at times if you are used to other stuff
[03:15:37] momomomomo: gestahlt: That's the leanring process for everything in life
[03:15:48] momomomomo: well, learning anyhow
[03:16:07] gestahlt: And i dont really have an affinity towards it. I tried to love it.. but i dont really can
[03:16:14] momomomomo: Then don't force yourself to
[03:16:21] sevenseacat: after working with ruby for 3 years, you think I don't still try and do things like php implode and explode every now and then? of course i do. i did PHP for seven years beforehand.
[03:16:24] momomomomo: there are tons of other web-app frameworks; many love RoR, some don't
[03:17:11] momomomomo: gestahlt: http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks
[03:17:12] gestahlt: momomomo: I went for RoR because a lot of stuff was very easy.. i thought: Wow cool! I can do that. Thats much easier done with RoR than with ASP
[03:18:17] gestahlt: And so i managed to get a lot stuff done in the half time i did in C# / VB / ASP
[03:18:26] sevenseacat: this is a win, no?
[03:18:29] gestahlt: But then there are always those hooks
[03:18:39] gestahlt: i dont know how to explain
[03:18:39] davidcelis: gestahlt: are you some kind of pun
[03:18:56] momomomomo: Like, having to read the documentation to understand how things work?
[03:18:57] davidcelis: Gestalt + Gestahl?
[03:19:07] gestahlt: Stahl = Steel
[03:19:13] gestahlt: Gestalt = Form
[03:19:24] davidcelis: nevermind :(
[03:19:55] banas: momomomomo: Thanks for the gists hint ;) Here;s the problem sevenseacat , I'm back :) https://gist.github.com/sarupbanskota/5882209
[03:20:04] gestahlt: Understanding the documentation is sometimes the problem
[03:20:33] davidcelis: sevenseacat: you... did PHP for seven years?
[03:20:40] momomomomo: so basically banas @current_user is nil
[03:20:46] gestahlt: Just like the content_tag.. Okay, it does return a string, okay methods always return the last
[03:20:47] sevenseacat: davidcelis: aye. since 2004.
[03:21:00] momomomomo: but you should really check out something like better errors or debugger to understand how it got to be nil, and why your logic isn't working
[03:21:06] davidcelis: sevenseacat: i'm so sorry... so, so sorry....
[03:21:09] sevenseacat: davidcelis: switched to ruby in 2011 and here i am.
[03:21:15] davidcelis: ACTION somberly takes sevenseacat out back
[03:21:20] davidcelis: ACTION readies a rifle
[03:21:28] davidcelis: sevenseacat: so sorry :C
[03:21:34] banas: momomomomo: Alright could you link me as to how to use a debugger? I'm really new to rails
[03:21:54] momomomomo: banas: check out http://railscasts.com/episodes/402-better-errors-railspanel
[03:22:07] banas: okay, thanks. Ill do that! :D
[03:22:16] momomomomo: and debugger is this old beast renamed http://railscasts.com/episodes/54-debugging-with-ruby-debug banas
[03:22:43] banas: okay! :) THanks, I'll look at them now
[03:29:24] scyllinice: davidcelis: I used to do PHP and ASP.NET before I learned Ruby and Rails in 2008. I sometimes wished I had your rifle back then.
[03:37:26] richardr: Is `doorkeeper` an appropriate gem to use if you wanted to provide secure access to your API to developers testing it?
[03:37:43] richardr: Or better to just generate and give out a simple token that is passed through HTTP?
[03:38:58] dobry-den: oauth is generally for making requests on the behalf of a user.
[03:39:09] dobry-den: just give devs an access token
[03:39:56] richardr: dobry-den: since this access token wouldn't expire (not attached to a user) does that pose a bit of a security risk if these don't expire / are distributed? any other common approaches?
[03:40:39] dobry-den: oauth tokens dont necessarily expire either. they can sit around as long as the user doesnt change their password or revoke access.
[03:40:54] richardr: simple access_tokens it is !
[03:43:30] dobry-den: just generate a token for each dev so that you know who's who
[03:52:49] richardr: dobry-den: thanks. think SecureRandom.hex will suffice?
[04:14:06] dobry-den: haha depending on what youre doing even (join (take 30 (shuffle "abcdef…"))) would suffice
[04:16:29] sevenseacat: richardr: it'll suffice as long as you're passing the token via headers and not via the URL
[04:16:55] sevenseacat: SecureRandom.hex likes to include characters that you cant use in URLs, like + & # etc.
[04:17:04] sevenseacat: or am i thinking of the other one
[04:17:35] sevenseacat: nvm, im thinking of the other one
[04:21:16] zeromodulus: is there a way to pass inline javascript when using respond_to do |f| f.js end?
[04:21:29] zeromodulus: rather than having to put it in a js.erb file
[04:21:41] zeromodulus: I basically just need to pass one function call.
[04:23:36] ChrisBolton: Anyone familiar with Fancybox? I'm trying to implement the gallery feature but it's not working … https://gist.github.com/Iknewthisguy/5882444
[04:25:06] zeromodulus: also, for a js template can I do template.js.coffee.erb?
[04:25:26] zeromodulus: is that the correct order?
[04:25:27] sevenseacat: zeromodulus: have you tried it?
[04:25:34] zeromodulus: it says missing template.
[04:25:50] zeromodulus: ACTION awaits the smackdown.
[04:26:05] sevenseacat: we tend to like full errors.
[04:26:21] zeromodulus: ActionView::MissingTemplate (Missing template photos/destroy, application/destroy with {:locale=>[:en], :formats=>[:js, :html], :handlers=>[:erb, :builder, :coffee]}.
[04:26:37] sevenseacat: and your file is?
[04:26:45] zeromodulus: destroy.js.coffee.erb
[04:27:10] zeromodulus: I named it based on which rendering engine would need to be called first.
[04:27:49] sevenseacat: I guess you cant nest template engines for views like you can for assets then
[04:28:20] zeromodulus: hmm, well, seeing :coffee and :erb in the :handlers array makes me think otherwise.
[04:28:31] zeromodulus: but, I'll try your suggestion.
[04:29:25] zeromodulus: No missing template error this time.
[04:29:53] zeromodulus: but the javascript I'm returning on the server side doesn't seem to get executed.
[04:33:02] slash_nick: zeromodulus: did you execute it on the client side?
[04:33:59] zeromodulus: I don't know, I assume that it would, because the I'm making an ajax request to the action with :remote => true.
[04:34:34] zeromodulus: it looks like I also had to define the function on `this` so it would be accessible from the global scope.
[04:34:52] zeromodulus: so I did that, but it still doesn't get executed. I'm trying to get it to work in the console at the moment.
[04:36:15] zeromodulus: haha, okay, got it to work. :D
[04:46:27] rhizome: caching still won't turn off
[04:47:12] fyuckwack: anyone here
[04:47:48] fyuckwack: 0 " $ ( N } 9 [ Q M # b U P h + s " ` V \ L { \ 7 ^ E T $ e d U j @ J ? D a F z _ s ) h B E Z
[04:47:50] fyuckwack: % < d U U !
[04:47:52] fyuckwack: v j N j N * U v ( + V = I [ _ ) k < \ G d Z z S , a ' c T & z , C v ? & p ~ L @ ! D A C o I X Z 7
[04:47:53] fyuckwack: A Z W B ( h ? # i _ W , h F 6 k I z % : # S ( _ 5 A O v P y m u n O % $ X D ? 6 ? M | S T \ q z t O
[04:47:54] fyuckwack: b c Y o & i
[04:47:55] fyuckwack: u f C D j ~ x C : d c 5 Y U n : 2 k \ p } m % ! l u } x R 0 z D X 0 I R 0 . W W B # g ? l
[04:47:56] brownies: ACTION pokes rhizome 
[04:47:56] fyuckwack: $ _ + } 9 !
[04:47:56] fyuckwack: * [ < K a F ` 7 % n t s 5 ( ' > U H z 5 e y ! ( ' | C W D @ - a { @ c 4 U v q k o Q F ~ Y @ Z n
[04:48:01] brownies: ACTION pokes Radar
[04:48:01] fyuckwack: & & p / ^ | w E + 5 ^ ~ Z A % = a F ~ Q d X ] 6 > ! } ) _ + X O > ! v 8 q Q . y o K f - W {
[04:48:01] fyuckwack: _ } c \ [ V ` f ' ; | I 1 d ) a E [ W X + G w 9 ; t D ) X T r o w ! 9 n v N o 1 r Q u o g 5 f
[04:48:07] fyuckwack: = t < C P 2 p P ) y k G + O | Q R N J [ k T : t t ' H $ < { V j Q * ) ` w & q l B P r , : H z $ v t ^
[04:48:07] fyuckwack: Q 9 D F # I
[04:48:07] fyuckwack: d y < n # Z : O o P ^ J F 5 , w L # S " 8 L [ e | q b o m O 5 a c V c { R T ' ( H W i ] r M k X ,
[04:48:07] fyuckwack: ~ I h M N Y : ? F ` > + L V f = | E ) " S ? U g $ s S z b R S G / ' z / p " ` x D B p
[04:48:07] fyuckwack: O P I z j 5
[04:48:07] fyuckwack: A c l " ` y
[04:48:09] fyuckwack: m U ( * Q [ ] ) w ) < s N o V U M d S B i J } ; 3 T H W O y ; : k E F X c M ( ; { f k E Y " b "
[04:48:10] fyuckwack: ) D o b r x F U n R P t ? G * R | u H T W z n c D F q t E r P O - - 7 ( U , C g ) 3 : $ ) R +
[04:48:15] fyuckwack: I mean in ancient times the Egyptians used hard muscle-demanding labor to create large pyramids... and stone age people, the neanderthals, needed to burn 5000-6000 calories a day to survive
[04:48:17] fyuckwack: But now people at Amazon use fork lifts, or skyscraper builders use heavy machinery
[04:48:18] fyuckwack: heavy machinery by companies like Hitachi or Kabuto or C.A.T. or whatever requires some object movement by people to make but not that of bodybuilders
[04:48:20] fyuckwack: But now all weight lifting is good for is police, military, or football/sports players
[04:48:22] fyuckwack: Police don't really "contribute" and product to society, but it's always good pay and it's sort of needed
[04:48:24] fyuckwack: Military is a waste of time and money
[04:48:26] fyuckwack: And football players are like playing video games only in real life
[04:48:28] fyuckwack: Throwing a ball around doesn't help other people no matter how much someone is paid
[04:48:30] fyuckwack: Police are mostly worthless
[04:48:32] fyuckwack: Football is like a virus to the world
[04:48:34] fyuckwack: What if I throw your balls around?
[04:48:36] fyuckwack: Police don't deter crime
[04:48:37] fyuckwack: They just mop up and catch the crooks
[04:48:41] fyuckwack: I look at the future and think: Computers will be obsolete because brain implants will replace them
[04:48:43] fyuckwack: Being in shape and having the brain of a computer would mean sitting down would be wasting time.
[04:48:45] fyuckwack: But for now, in humanity's evolution, sitting down at a computer or making automated machinery is more productive than bodybuilding
[04:48:47] fyuckwack: Do you think in the future body building will be more profitable than sitting at a computer or at a desk?
[04:49:05] fyuckwack: Partinks spee spaga speel scrap. Ruda Trooda. Ejection request. Heffy the jello wup. Juffo-wup! rab locid rebbasmoth. The Proteus Animal Plannable. Poo da Boo! need 10-15 people straight Groaning my grurch nords. Ruh ninna knaw knife
[04:49:07] fyuckwack: agrillio mellish. Blakes my bog. kedda mah go go mageezik Renna manuck to the ruthafied sneffal The Rump Shaking Rider Crew - Fuck You! Wren a men a menna menna moo, filling my jolts and filling my shoe, plenk a peek a pokie zal nawl knife
[04:49:09] fyuckwack: Shaar nag lililly linomp nip. Many mini minotaur taurs, hate tar tar sauce. I am a robibbob meme. Have you ever thought about where the bird goes? Squirnish Mernish. Jelly jolaggalan joo! Chuh lap lap rillip. Oh I grew three years. I'm old now.
[04:49:11] fyuckwack: Does anyone heck teck the rooga beega bagga? Hebber master hoon a ferr fee. Hilly a mackhole. The shiny dot in the middle of a liddle light, of the middle of a lep lep lains! Gotta get that schit ass shcrap biteoad. Ruproudj a malef loo
[04:49:13] fyuckwack: Moistie bather. riberian schmecklef Mulla Malee loo lup the new flood wars. Chuddy dip, chuddy dip, chuddy microchip. Bucka lucka loo, bucky lucky blay. Bucka lucky blay lee.
[04:49:15] Radar: +b *!*@
[04:49:23] Radar: fyuckwack: piss off
[04:49:36] Radar: Radar kicked fyuckwack: bye now
[04:49:47] Radar: sorry brownies, wasn't paying attention to IRC
[04:50:18] brownies: ...you lazy bum. ;)
[04:52:28] willbradley: heya, anyone used cancan and noticed that it will authorize based on params passed during #create but not based on params passed during #update?
[04:53:23] rhizome: @user.reload i'm guessing
[04:54:07] willbradley: in other words, if i've got can :manage, Post, user_id: user.id in my ability, a user can't create posts with another user's id but they can create one with a nil id and then edit it to have another id
[04:54:13] brownies: if the ability object was instantiated with the User object pre-update, then i think you'll need to refresh it
[04:54:23] willbradley: the user object isn't changing
[04:54:41] brownies: how can they create a post with a nil id?
[04:54:47] brownies: your validations should not be allowing that at all.
[04:55:51] willbradley: sure, or just assume i'm creating it with the user's id
[04:56:54] willbradley: point is, on #update it validates based on the old model pre-update_attributes; i'd expect it to assign_attributes and then validate in order to actually protect the update method
[04:57:15] willbradley: (just like it seems to do for #create)
[04:59:41] willbradley: so, it seems to me like you can "lob one over the fence" by updating an authorized object to be unauthorized
[04:59:42] arefaslani: suppose i have a physician model: https://gist.github.com/arefaslani/5882552
[05:00:06] arefaslani: and a patient model: https://gist.github.com/arefaslani/5882554
[05:00:40] arefaslani: that relate together through appointments: https://gist.github.com/arefaslani/5882557
[05:01:20] arefaslani: with a "has many through" association
[05:01:35] arefaslani: how can i set an appointment date?
[05:02:00] Radar: Appointment.create(:patient => patient, :physician => physician, :date => date)
[05:02:03] helpa: Next question, please!
[05:02:51] arefaslani: physician.patients.create(name: 'sth', age: 20) <-- can i set the appointment date here
[05:03:21] willbradley: Radar: what do you think about my problem? considering writing a pull request for cancan
[05:03:23] rhizome: let's see if a reboot fixes caching. hate to think i have to reboot every time i change a template
[05:04:06] brownies: willbradley: i see what you're getting at but i'm not convinced that user_id should be user-editable in the first place
[05:04:27] brownies: and if it is for some wacky reason (like a user can reassign a post to another user or something) you should be constraining choices on both the way in and the way out
[05:04:46] willbradley: brownies: maybe it shouldn't, but then i get to write un-DRY controller logic for anything non-admins ever own
[05:05:00] rhizome: arefaslani: Appt.new(dr: params[:dr], patient: params[:patient], date: ...)
[05:05:09] brownies: e.g. before rendering, make sure the choices in the drop-down menu are filtered with e.g. can?(:assign_post_to, that_user) or whatever ... and then in the PUT method you have to again check
[05:05:31] Radar: arefaslani: no
[05:05:33] brownies: willbradley: tbh i think you're overcomplicating things
[05:05:33] Radar: arefaslani: not easily.
[05:05:49] Radar: willbradley: Your problem is a bit tl;dr and I charge for those kinds.
[05:06:19] willbradley: brownies: yeah but your method (which i've used) would be moot if cancan actually authorized #update the same way it authorizes #create
[05:06:40] rhizome: er, (dr: dr, patient: patient, date: ...) # dr/patient should arleady exist
[05:06:45] arefaslani: physician = Physician.create(name: 'Dr. aslani', age: 24)
[05:06:48] brownies: willbradley: you just have to explicitly check
[05:07:04] willbradley: and i really hate doing unless(admin_signed_in) @post.id = current_user.id
[05:07:05] brownies: i really think this is a validation problem, not an authorization problem
[05:07:16] willbradley: on every #update
[05:07:25] brownies: wtf! why is your primary key user editable!!
[05:07:32] brownies: that's what i keep coming back to -_-
[05:07:35] willbradley: secondary keys
[05:07:44] willbradley: because admins need to be able to change it
[05:07:52] arefaslani: physician.patients.create(name: 'sth', age: 20) <-- in this expression an appointment object will be created. my question is how can i change its date value when needed?(from here if possible)
[05:08:04] willbradley: @post.user_id = user.id
[05:08:08] brownies: well, show me the real code if you want real help, but otherwise all i can really say is variations on "well, it's not that hard"
[05:08:19] Radar: arefaslani: *YOU CAN'T.* Please stop asking.
[05:08:31] Radar: arefaslani: You will need to create a new Appointment object and modify that as required.
[05:08:54] arefaslani: Radar: Thank you, please be calm :D ;)
[05:09:00] Radar: arefaslani: I really hate repeating myself.
[05:09:12] Radar: arefaslani: or do a query after the fact like appointment = physician.appointments.where(:patient_id => patient.id)
[05:09:13] Radar: and then update it
[05:09:25] willbradley: so you just put a few lines in every #update to force the correct id? that's what i've been doing but i hate it (mostly because the cancan screencast acts like it's secure without it, which is wrong)
[05:09:35] brownies: no, i don't
[05:09:40] brownies: can you show me an example update method that has this issue?
[05:23:40] willbradley: brownies: ok, uploaded to github
[05:24:36] fulcan: I am a total rails n00b http://bpaste.net/show/tKKi4TCutOKIyIZYtYrt/
[05:25:06] fulcan: trying to install https://github.com/lockitron/selfstarter/
[05:25:34] fulcan: I suck at git too.
[05:27:36] Lewis: fulcan: bundle exec rake db:migrate
[05:29:00] fulcan: li424-222 selfstarter # bundle exec rake db:migrate|wgetpaste
[05:29:00] fulcan: rake aborted!
[05:29:01] fulcan: Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.
[05:29:01] fulcan: (See full trace by running task with --trace)
[05:29:01] fulcan: No input read. Nothing to paste. Aborting.
[05:29:18] rvanlieshout: fulcan: install a javascript runtime
[05:29:32] gja: fulcan, if you are on mac.. that is strange. If you are on linux, install node.js or libv8
[05:29:40] willbradley: brownies: https://github.com/zyphlar/cancan-attr-test
[05:29:45] willbradley: thanks for checking it out
[05:31:26] fulcan: I appologize for the multiline paste. installing nodejs now (what I think is my gentoo javascript runtime)
[05:31:54] brownies: willbradley: oh i see
[05:32:12] brownies: willbradley: yeah i would actually use scoped mass-assignment protection via roles for this situation
[05:32:18] brownies: willbradley: here's a decent blog post on it http://launchware.com/articles/whats-new-in-edge-scoped-mass-assignment-in-rails-3-1
[05:32:27] willbradley: i haven't delved into the cancan source to see why it doesn't check params on update, but it does on create... but it just makes sense
[05:32:42] brownies: willbradley: so you can simply declare that admins can mass-assign :foo_id and :bar_id but non-admins can only mass-assign :bar_id
[05:32:44] willbradley: brownies: i was thinking about that, it just didn't seem to quite do cancan's job in this regard either
[05:33:11] brownies: i agree that CanCan isn't going to magically do anything here... you're going to have to be explicit about it somewhere, but i think you can DRY things up with a bit of cleverness
[05:33:20] willbradley: ah yeah, the problem is that it doesn't account for non-admins assigning foo_id only if it matches their id
[05:33:20] brownies: it depends on what you're really doing in your real project, but... it should be feasible
[05:33:27] fulcan: rvanlieshout I think it worked.
[05:33:37] brownies: willbradley: well, such a thing should never be assigned
[05:33:44] tjbiddle: Hey guys - Trying to look through some examples for CanCan. Can only find one with Devise. Is there one with just a home baked user auth?
[05:33:57] tjbiddle: It looks really simple to use - But not sure if the examples are just very minimal.
[05:33:58] willbradley: well, it's my use-case and it's in ryanb's cancan screencast
[05:34:00] brownies: willbradley: you should always be writing params[:foo].slice(:bar, :fizz, :buzz) and passing THAT to Foo.new
[05:34:13] brownies: willbradley: if you pass just Foo.new(params[:foo]) that is a security risk
[05:34:26] willbradley: i keep seeing the .slice fix, but that's a blacklist and i thought we all agreed that whitelisting via attr_accessible was better
[05:34:32] brownies: willbradley: so then you can wrap up the slice into a method to DRY it up... and you can just have two methods... one that slices for admins, one that slices for non-admins
[05:34:35] brownies: willbradley: i do both
[05:35:23] willbradley: the issue i have is that ryanb says attr_accessible shouldn't even be necessary with a proper cancan install; which obviously isn't true unless this bug is fixed
[05:35:35] willbradley: and how sweet would it be if cancan just handled it all
[05:35:41] HashNuke: holy mornings ~! :)
[05:35:49] brownies: i think you might have to use CanCan's block syntax to do some of this fancier stuff, as well
[05:36:01] sevenseacat: ryanb is not quite telling truthies if thats what he says
[05:36:05] fulcan: this is the error I was trying to get around. http://bpaste.net/show/3Md2iJTihCcFQ6TbQfVz/ how do I downgrade rack?
[05:36:10] willbradley: maybe, but actually it's surprisingly simple. can :manage, Post, user_id: user.id
[05:36:11] sevenseacat: attr_accessible is always necessary
[05:36:11] brownies: so this way you can just do a custom permission with a block and check can?(:update_post_to, new_post)
[05:36:26] brownies: yeah, i would also be highly suspicious of anyone that claimed you should stop using attr_accessible
[05:36:39] rhizome: suicide time
[05:36:50] brownies: well, that IS simple. the problem is that then you go and make user_id editable! so what did you expect ;)
[05:36:53] gja: fulcan, http://blog.gja.in/2012/06/using-bundler-with-executables.html#.Uc0g4j7boRg
[05:37:05] brownies: "it was simple, but then i complicated it, and now it's not simple anymore."
[05:37:40] willbradley: sevenseacat: so everyone puts a half-dozen lines in their controllers to assign @post.user_id = current_user.id if can? :update post ?
[05:37:49] rvanlieshout: using block syntax degrades performance
[05:37:50] willbradley: cuz i see a lot of .slice hacks
[05:37:58] sevenseacat: willbradley: ?
[05:38:04] brownies: i don't consider #slice a hack... i consider it good practice.
[05:38:04] fulcan: gja thank you! checking now.
[05:38:10] rvanlieshout: and cancan doesn't know how to handle rails 4 properly yet
[05:38:18] willbradley: using rails 3
[05:38:42] sevenseacat: personally i would not assign the post.user_id like that, i would use current_user.posts.build
[05:38:49] rvanlieshout: rails 4 = strong params
[05:39:35] rvanlieshout: so cancan and rails3 + strong params won't be happy
[05:39:38] willbradley: sevenseacat: correct or that. so if you needed admins to be able to update user_id but not users, you'd have a little if-block on #create and #update?
[05:39:54] sevenseacat: no, i'd make the user_id field attr_accessible for admins
[05:40:19] willbradley: and an if-block in the view?
[05:40:57] willbradley: hmmm. ok that works. i still think cancan's behavior on #update is wrong though
[05:41:10] sevenseacat: whats wrong with it?
[05:41:19] willbradley: (i just joined a project where people think can? in the view and authorize_resource in the controller is enough security)
[05:42:08] willbradley: sevenseacat: it doesn't account for params on update, so you can update a model into a state you shouldn't be able to based on your ability: https://github.com/zyphlar/cancan-attr-test
[05:42:54] sevenseacat: cancan has exactly 0 to do wth params
[05:43:03] willbradley: not true, it checks them on #create
[05:43:07] brownies: yeah i really think it's just not the right tool for the job
[05:43:12] sevenseacat: no, it does not
[05:43:14] willbradley: when i set can :manage, Post, user_id: user.id
[05:43:18] brownies: and sevenseacat told you the same thing i did... scoped attr_accessible -_-
[05:43:37] willbradley: i agree that's probably the answer. but i currently want to submit an issue to cancan
[05:43:47] sevenseacat: willbradley: you arent making sense
[05:43:48] rvanlieshout: willbradley: have you seen recent activity on cancan?
[05:43:55] willbradley: rvanlieshout: indeed i haven't
[05:44:02] sevenseacat: willbradley: show us a very specific example of what you mean, because it isnt clear at all
[05:44:09] sevenseacat: not an entire app with some shit hacked into it
[05:44:13] willbradley: read the readme
[05:44:25] sevenseacat: i'm not going to set up your app just to get an example of broken code.
[05:44:38] willbradley: i'd paste the reproduction steps in the readme, but that's impolite
[05:44:53] rvanlieshout: willbradley: as much as we like to see cancan handle strong params i don't think it's going to happen any time soon
[05:44:58] sevenseacat: i mean, it would be a dozen lines at most to reproduce this problem.
[05:45:09] sevenseacat: a controller and an action and a model.
[05:45:38] willbradley: have you read the readme? all is explained succinctly
[05:45:54] fulcan: gja I am confused, rake it what is erroring.
[05:46:12] sevenseacat: willbradley: i dont want an explanation. i want a simple example.
[05:46:48] fulcan: http://bpaste.net/show/HgnA8l6qSZcqw8849vT4/
[05:47:38] rvanlieshout: fulcan: read the error
[05:47:38] willbradley: sevenseacat: on a basic cancan/devise install, you need to add this in a before filter in order to secure #update: @post.assign_attributes(params[:post]); authorize! :edit, @post
[05:47:51] rvanlieshout: fulcan: "Using bundle exec may solve this"
[05:48:11] sevenseacat: what do you mean, 'in order to secure update'
[05:48:12] gja: fulcan, the solution I posted to you should solve that
[05:48:14] zeromodulus: how do you guys implement search in your webapps?
[05:48:33] sevenseacat: yes, you need to call authorize to secure an action. this is not new, this is the entire point of cancan.
[05:48:34] zeromodulus: I've read that Solr is pretty popular.
[05:48:42] rvanlieshout: willbradley: i just don't use load_resource if it's a think that has strange stuff
[05:48:45] gja: zeromodulus, yeah, I'm using sunspot + solr
[05:48:47] fulcan: I am very new to rails. I see this -> 10.0.3. Using bundle exec may solve this. but not sure how to downgrade. it this a package management system thing?
[05:48:50] willbradley: sevenseacat: cancan authorizes @post as it exists before update_parameters, so you can update a post into an illegal state
[05:48:53] rvanlieshout: willbradley: cancan should not be that specific
[05:48:58] zeromodulus: gja: how is it?
[05:49:06] sevenseacat: cancan does no such thing unless you tell it to.
[05:49:11] willbradley: i might agree, except it does so on #create
[05:49:31] gja: zeromodulus, I would recommend it very highly. sunspot makes it easy to annotate your model with `things to search by`
[05:49:34] sevenseacat: and if you're complaining because you tell it to do something and then it does it, well, lol you.
[05:49:36] willbradley: its #create and #update behavior isn't consistent
[05:49:45] gja: zeromodulus, and you can use something like websolr to actually deploy
[05:49:47] sevenseacat: still waiting to see a bloody example
[05:49:58] brownies: yeah, i actually don't use any of cancan's controller methods
[05:49:59] willbradley: sevenseacat: this is as simple as it gets https://github.com/zyphlar/cancan-attr-test
[05:50:00] zeromodulus: hmm, I guess I'll try it.
[05:50:03] sevenseacat: getting quite annoyed at idiocy
[05:50:07] brownies: i just call can?(:foo, bar) when i want to know if the user can foo a bar.
[05:50:44] sevenseacat: again, an app full of hacked up code is not a simple example
[05:50:52] brownies: yeah, tbh i feel like this is an odd problem
[05:50:57] willbradley: brownies: yeah but load_and_authorize_resource should check can? :update @post based on a post's updated params
[05:50:59] brownies: the code is behaving exactly as it should, because you told it to
[05:51:07] sevenseacat: show me a model, and a controller action, and some abilities, and the problems that are happening.
[05:51:08] brownies: no, because it's a before filter!
[05:51:18] brownies: wtfbbq, how is it going to know what you want to do with the params BEFORE you do it
[05:51:23] willbradley: then how's it doing it on create?
[05:51:40] willbradley: you can't #create with invalid params, it's obviously accessing them
[05:52:04] fulcan: how do you install an app from git? I find no docs to support this.
[05:52:12] sevenseacat: i honestly have no idea whats going on here.
[05:52:36] sevenseacat: ACTION goes back to tinkering with google maps
[05:52:43] willbradley: sevenseacat: model: https://github.com/zyphlar/cancan-attr-test/blob/master/app/models/post.rb controller: https://github.com/zyphlar/cancan-attr-test/blob/master/app/controllers/posts_controller.rb ability: https://github.com/zyphlar/cancan-attr-test/blob/master/app/models/ability.rb
[05:53:15] willbradley: problem is you can't #create with someone else's id, but you can #update
[05:53:17] fulcan: everything on github but nobody knows how to install, great.
[05:53:23] gja: fulcan, did you run a (bundle --binstubs)?
[05:53:38] sevenseacat: fulcan: thats awfully vague.
[05:53:59] sevenseacat: fulcan: thats like saying ''how do i install an app from the internet"
[05:54:13] sevenseacat: ah, load and authorize resource
[05:54:17] willbradley: brownies: it's in the cancan screencast, the bug exists if you follow the tutorials
[05:54:35] fulcan: gja huh? http://bpaste.net/show/8GECF6YDj0qxOqsYoPWD/
[05:54:36] sevenseacat: let's have a look at the name of the method
[05:54:46] brownies: like i said... i never liked how load_and_authorize_resource (and all the other controller methods) smelled, so i never used 'em
[05:54:59] sevenseacat: `load` - load up an instance. for create action, this is a new instance with the supplied params. for update, this is the instance fresh from the database.
[05:55:13] sevenseacat: 'authorize` - authorize the instance you just loaded.
[05:55:14] fulcan: sevenseacat no execute button. the question is valid.
[05:55:32] fulcan: no execute command
[05:55:33] gja: fulcan, did you actually read the post I linked you to? Step 1) Do a bundle --binstubs. Step 2) run ./bin/rake db:migrate
[05:55:59] willbradley: sevenseacat: is that from the docs, or your head?
[05:56:07] sevenseacat: fulcan: indeed, bundle has no execute command. it does have exec though.
[05:56:16] sevenseacat: willbradley: it's from reading the name of the method.
[05:56:38] sevenseacat: what else are you going to load?
[05:56:59] sevenseacat: i mean, you could call authorize on Post.new, but thats kinda pointless
[05:57:00] willbradley: that's nice, but the creator of cancan's docs disagree; they seem to claim that the authorization takes care of everything
[05:57:13] sevenseacat: it does. you're completely misinterpreting what it does.
[05:57:44] sevenseacat: https://github.com/ryanb/cancan/wiki/Authorizing-controller-actions
[05:57:44] HashNuke: willbradley: if you want something simple, you can write your own authorizer class. It's not tough.
[05:58:15] willbradley: HashNuke: i want something like cancan, plus this feature which i'm considering adding in
[05:58:52] fulcan: I don't know where I went wrong http://bpaste.net/show/6m7GCABj2mHh47CXp5MD/
[05:59:05] sevenseacat: willbradley: also, read https://github.com/ryanb/cancan/wiki/Controller-Authorization-Example
[05:59:18] sevenseacat: to see exactly what load_and_authorize_resource replaces
[05:59:40] sevenseacat: fulcan: did you read the error message?
[05:59:50] sevenseacat: ____Using bundle exec may solve this.____
[06:00:06] gja: fulcan, prepend /every/ rake command you are running with either ./bin or bundle exec
[06:00:21] willbradley: sevenseacat: i've read those; interestingly, he doesn't use load_and_authorize in that github example but he does in his screencast (and he does it wrong in the screencast)
[06:00:31] fulcan: sevenseacat please, I am working with rails for the first time. of course I read it, the error means something to you, not me.
[06:01:01] sevenseacat: fulcan: prefix the commands you're calling with `bundle exec`.
[06:02:14] willbradley: point is that if you aren't anal about security and use the documented features, you might fail to adequately secure #update -- in fact in his wiki example he even says to use load_and_authorize and NOT the expanded (correct) code
[06:02:40] sevenseacat: yeah i guess if you dont read the docs you might be confused about how cancan works, yeah.
[06:03:03] willbradley: i am reading the docs, it doesn't seem like they indicate that #update should need any additional authorization beyond load_and_authorize
[06:03:18] willbradley: i've read the docs for 3 hours
[06:03:22] fulcan: sevenseacat I am waiting for the rest sir.
[06:03:51] sevenseacat: willbradley: it doesnt. what you are trying to do is not in cancan's scope. you are trying to make cancan perform validations on your objects.
[06:04:01] sevenseacat: fulcan: rest of what?
[06:04:10] fulcan: prefix the commands you're calling with `bundle exec`.
[06:04:18] fulcan: and???....
[06:04:23] sevenseacat: and then they will work.
[06:04:52] willbradley: sevenseacat: i'd agree with that except that it is in the cancan examples
[06:05:01] sevenseacat: no, it is not.
[06:05:02] fulcan: bundler: exec needs a command to run
[06:05:20] sevenseacat: fulcan: before the commands, eg. 'rake db:migrate' becomes 'bundle exec rake db:migrate'
[06:05:46] willbradley: sevenseacat: i'm not going to debate whether the sky is blue. thanks for your time
[06:06:12] sevenseacat: willbradley: you have provided absolutely no evidence to back up your claims, and i've provided the docs that substantiate mine.
[06:06:37] fulcan: sevenseacat no sir! http://bpaste.net/show/FVlvcBNEUU24qHSZrfy0/
[06:06:55] sevenseacat: fulcan: you did not prefix the second command.
[06:07:23] willbradley: sevenseacat: actually, your docs all say "just use load_and_authorize" and so does the screencast source code (which is a full rails app so I don't expect you to click: https://github.com/ryanb/railscasts-episodes/blob/master/episode-192/blog/app/controllers/articles_controller.rb )
[06:07:41] willbradley: but it's ok. i'll just fix it and be on my way
[06:07:43] gja: fulcan, IE: `bundle exec rake db:seed` (alternatively `./bin/rake db:seed`)
[06:08:00] gja: fulcan, repeat this for EVERY command you are going to run in this repository
[06:08:02] sevenseacat: willbradley: and doing that does exactly what its intended to do. no, it will not validate your @post data for you.
[06:08:22] fulcan: sevenseacat I add lib nothing. straight copy/paste. I am 'that' new.
[06:08:36] sevenseacat: it ensures that you have the permission to work with the object as it has loaded.
[06:08:59] willbradley: sevenseacat: it ensures that comment.user == current_user on #create, but not on #update.
[06:09:00] sevenseacat: it will not ensure that you have the permission to make the exact data changes you want to make. thats validation issue.
[06:09:18] Oak: sevenseacat++
[06:09:21] sevenseacat: willbradley: again, look at what the code is doing. https://github.com/ryanb/cancan/wiki/Controller-Authorization-Example
[06:09:38] willbradley: then that needs to be a pretty big disclaimer, so we don't have a bunch of vulnerable apps on the loose
[06:10:11] sevenseacat: its in the docs. we presume that you have read them.
[06:10:17] willbradley: sevenseacat: what i'm saying is that the full controller example on that page is correct, but does not match load_and_authorize's behavior
[06:10:24] willbradley: therefore the docs are wrong
[06:11:16] sevenseacat: load_and_authorize_resource for an update action will a) load the record from the database and b) call authorize on that instance.
[06:11:22] sevenseacat: then you make your data changes.
[06:11:42] willbradley: which, it says nowhere in the docs, also need to be authorized on #update
[06:11:58] sevenseacat: data changes to not need to be authorized, no. thats a validation issue.
[06:12:12] willbradley: but validators can't see current_user
[06:12:19] sevenseacat: i'm not sure how you're confusing the two so badly.
[06:12:58] sevenseacat: why do they need to?
[06:13:08] willbradley: we're in agreement, i'm just saying that either cancan's #update needs to behave like its #create, or it needs a big red flag saying warning, we fully authorize creates but not updates
[06:13:20] sevenseacat: ACTION blinks
[06:13:24] willbradley: i know how to work around this, but others might not
[06:13:35] sevenseacat: theres nothing to work around...?
[06:13:56] sevenseacat: i do not know how you are misunderstanding things so badly
[06:14:06] willbradley: go back to your google maps, you're drunk
[06:14:49] sevenseacat: feel free to go file a cancan issue if you don't like its behaviour
[06:14:57] gja: willbradley, that's one I have never heard before
[06:14:59] willbradley: that's what i'm doing, thanks
[06:16:43] rhizome: in 3.2, if perform_caching = false does that mean that cache do blocks are ignored?
[06:18:50] certainty: sup tagrudev
[06:19:10] tagrudev: I am happy, when it's Friday
[06:19:31] willbradley: been awake too long: when the germans wake up ;)
[06:19:48] certainty: ACTION discovered yesterday that M-' does cool things in zsh with readline
[06:19:49] tagrudev: 3 more days till sober challange is over :D
[06:20:01] willbradley: tagrudev: drink some club mate for me
[06:20:19] tagrudev: lol on the M-'
[06:20:34] certainty: it even escapes correctly
[06:20:34] tagrudev: certainty, M-l
[06:20:48] certainty: i knew that one
[06:21:27] certainty: not to be confused with C-l :D
[06:22:04] certainty: also M-. but that's less useful in day to day use
[06:22:05] tagrudev: nah I knew !! not a fan of it
[06:22:36] willbradley: :O Sie sind kein Berliner!
[06:23:07] certainty: naja, nicht ganz
[06:23:20] tagrudev: hahah C-space works lol
[06:23:30] zeromodulus: was ist aller diesen dann?
[06:23:39] certainty: yeah almost everything works. It even has keyboard macros!
[06:23:49] certainty: zeromodulus: come again?
[06:23:58] zeromodulus: monty python reference auf deutsch
[06:24:11] certainty: aha! didn't know that one
[06:24:31] zeromodulus: in monty python sketches a cop will show up and say, "Alright, what's all this then?"
[06:24:31] certainty: forbidden comedians in a ruby related channel :D
[06:25:04] zeromodulus: my german might be a little broken though.
[06:25:16] certainty: not more than my english :D
[07:08:27] sambuko: how can I check in rails that a date will expire in 2 weeks?
[07:08:35] sambuko: a date field*
[07:08:50] rhizome: expiration_date = foo_date + 2.weeks
[07:09:33] maloik_: though you probably want to check for >= 2.weeks.from_now :-)
[07:09:47] maloik_: or <= 2.weeks.from_now depending on how you do things
[07:14:19] rvanlieshout: sambuko: .where("expiration_date <= :expiration", expiration: 2.weeks.from_now) in arel
[07:17:48] sambuko: thanks guys
[07:18:54] rhizome: so, turning off caching is not actually turning off caching for me
[07:19:20] rvanlieshout: rhizome: what caching have you turned of and what caching are you using?
[07:20:29] rhizome: i deleted all old caches_action/page lines, added cache_digests, put cache block in my views, enabled caching for development, saw everything worked fine, then was unable to turn it back off. i have backed out every change I can find.
[07:21:36] rhizome: grepping for 'cach' says the code is clear of caching bits, but neither passenger nor webbrick will serve pages directly, and template changes do not show up
[07:21:57] rhizome: i have cleared tmp and public
[07:22:29] Scient: i dont believe you
[07:22:41] irmbrady: Any vim uses here?
[07:22:45] rhizome: please tell me how i can prove it to you :)
[07:22:52] zeromodulus: irmbrady: tons probably.
[07:23:06] zeromodulus: irmbrady: I'm one of them. :D
[07:23:19] rhizome: irmbrady: ask your real question. also: #vim
[07:23:41] maloik_: rhizome: I vaguely recall one of our apps had a constant that messed things up
[07:23:49] irmbrady: Haha. Ok, well in that case I will just ask away. I am trying to get omnifunc/auto complete working for ruby files and rails projects. I am just playing around with a .rb file which requires FileUtils library
[07:23:49] rhizome: i don't use constants here
[07:24:55] irmbrady: Say I make a string: s = "Test" ... and then go s. <CTRL+N>, I don't get any omnifunc suggestions for class String. I just get a few hundred suggestions for FileUtils library
[07:25:27] rhizome: Scient: https://gist.github.com/rhizome/300722c8e37e5aa948ac
[07:25:34] irmbrady: I am using vim-ruby, vim-rails. I don't know what the expected behaviour is though. I was hoping that vim-ruby would give me autocompletions for String class though in my example above
[07:26:00] Scient: what do the logs show
[07:26:09] Scient: when you request a page that you claim is cached
[07:26:21] irmbrady: I guess my question is... is what I described the correct behaviour? Or should autocomplete have shown all the String method?
[07:26:45] zeromodulus: welp, I can't sleep, therefore code time. :D
[07:26:54] rhizome: Scient: updated gist
[07:27:15] rhizome: no log of the action, basically
[07:28:00] compiled: Anyone need ror supported hosting?
[07:29:48] arrowcircle: hi! what is the easiest way to change value of joining association from one of the parents object in has many through association?
[07:33:37] Scient: rhizome: then its not hitting the server
[07:33:49] Scient: i mean even if rails is caching, the request still shows up in the log
[07:34:00] Scient: also check nginx logs (or apache, depends what youre using)
[07:34:39] Scient: if youre using just passenger standalone, and the request shows but the standalone console shows nothing, its not hitting that passenger instance
[07:34:50] Scient: so if you shut down passenger, does it still serve the page?
[07:35:54] rhizome: this is development, btw
[07:36:01] Scient: so it only works when you start passenger, but it doesnt log anything into passenger?
[07:36:09] Scient: nothing in development.log ?
[07:36:27] Scient: is there a flag to start passenger in extra verbose mode then?
[07:36:36] Scient: thats just not possible :P
[07:36:43] rhizome: nothing in development log but the connecting to database...
[07:36:43] Scient: it has to log the request somewhere
[07:37:15] rhizome: ls -lrt says development.log is the only one being touched
[07:38:42] rhizome: i have even rebooted
[07:39:39] Scient: this is a bitch to debug remotely
[07:39:58] Scient: start up your rails server with thin or something instead of passenger standalone
[07:40:01] Scient: and see what it does
[07:40:15] Scient: tail this log /media/Data/usr/src/newflyers/log/passenger.3000.log
[07:40:15] rhizome: so. strace doesn't say anything after passenger finishes starting, it just spits out "connecting to database..."
[07:41:25] rhizome: so there's maybe something between the browser and the server process by which the browser throws an error if the server isn't running, but pulls from its own (permanent, seemingly) cache if the server is up?
[07:41:57] Scient: i dont think that can happen
[07:42:45] rhizome: hrm. passenger log hasn't updated since i downgraded to 3.x from 4.0.5 or whatever
[07:43:03] sambuko: can I query using Arel that date_field will expire in 1 week?
[07:43:19] sambuko: i thinking of some kinda or range
[07:43:29] sambuko: User.where(?)
[07:44:03] sambuko: Scient can you please help me?
[07:45:21] rhizome: uninstalling all other passenger versions besides this one
[07:45:59] rhizome: same behavior
[07:47:26] rhizome: webbrick not logging either
[07:48:28] goleldar: is coderwall supposed to replace personal blogs?
[07:53:12] rhizome: Scient: prev revision seems ok. gonna diff and see
[07:56:50] pi3r: In rails 4 X-Frame-Options default to SAMEORIGIN, how can I change that ?
[07:59:14] zeromodulus: Oooh yeah, my web app is starting to look sexy.
[08:01:04] pi3r: ok it's in config.action_dispatch.default_headers :)
[08:21:28] zeromodulus: https://gist.github.com/zeromodulus/5883269 - error is included.
[08:22:13] pi3r: zeromodulus: show your routes.rb
[08:22:49] rushed: zeromodulus: do you have a reason for wrapping everything in a blog module?
[08:23:25] zeromodulus: okay, updated.
[08:23:46] sevenseacat: you're not pointing your routes to the right controller
[08:23:59] pi3r: zeromodulus: don't use a module
[08:23:59] sevenseacat: blog isnt a resource, its a namespace
[08:24:47] zeromodulus: sevenseacat: beautiful, that worked.
[08:30:15] vaisakh: Could anybody please tell me what rack exactly do?
[08:32:43] elaptics: vaisakh: https://en.wikipedia.org/wiki/Rack_(web_server_interface)
[08:32:51] rushed: vaisakh: "Rack provides a minimal interface between webservers supporting Ruby and Ruby frameworks." <= from http://rack.github.io
[08:40:30] vaisakh: elaptics: I have gone through the article but confused.
[08:41:26] vaisakh: elaptics: Where does exactly rack stays? behind web server?
[08:43:26] rushed: vaisakh: yes, but unless you're trying to add some middleware you probably don't need to worry about it :)
[08:43:59] vaisakh: rushed: Ok :) But i'm curious to know all these.
[08:44:45] youl: Can you explain me the difference, in two words between my_model.sub_model.new and build, to add a submodel liked to a model
[08:44:54] youl: if Im not clear tell me ><
[08:45:00] rushed: vaisakh: then you might like these http://railscasts.com/episodes/151-rack-middleware http://railscasts.com/episodes/222-rack-in-rails-3 http://railscasts.com/episodes/317-rack-app-from-scratch
[08:45:04] elaptics: vaisakh: does this introduction to rack help? http://chneukirchen.org/blog/archive/2007/02/introducing-rack.html
[08:45:46] elaptics: youl: if sub_model is an active record relation then you should use build if you want AR to link the two models together
[08:46:36] youl: elaptics: new does not link the models ?
[08:49:12] elaptics: youl: well you can't call new, because it's not an instance of the actual model it's an active record relation
[08:49:34] youl: ahh ok I see
[08:49:38] youl: elaptics++
[08:50:18] rushed: youl: also, http://stackoverflow.com/a/4954542
[08:51:33] fayimora: hey guys, I've got this little helper(https://gist.github.com/fayimora/5877465) in a module which i include via RSpec.configure but I still can't access the method in my tests. Any idea what I'm doing wrong?
[08:52:37] youl: rushed: thanks !
[08:53:08] sevenseacat: fayimora: and your test is?
[08:53:47] fayimora: sevenseacat: https://gist.github.com/5883407
[08:54:13] sevenseacat: what type of test is it and what version of rspec are you using?
[08:54:50] dopie: sevenseacat, you ready?
[08:55:09] sevenseacat: dopie: if i have to be.
[08:55:59] fayimora: rspec-rails 2.13.0
[08:57:07] sevenseacat: https://www.relishapp.com/rspec/rspec-rails/v/2-13/docs/request-specs/request-spec see the note on capybara
[08:57:14] sevenseacat: (its not the problem but it's a problem)
[08:57:29] elaptics: rushed: ah, handy to know that build and new are now aliased since 3.2.13
[08:59:55] mathijspb: Hello, I want to create a custom class for RoR, i placed the file in /lib and and edited config/application.rb to autoload the file. But i want to the test the class in rails console, do i need to restart the console every time to get the latest version of the class?
[09:06:02] maasha: Hey. Im playing with shoulda-matchers. These expression are not equivalent? https://gist.github.com/maasha/3c0c2e3422f8c2c93149
[09:08:05] sevenseacat: maasha: no - the second example could be because of an error on any field
[09:08:07] krz: I need some help about ActiveRecord and join
[09:08:28] sevenseacat: the first will explicitly set name to nil and then make sure it has an error on name
[09:08:55] mathijspb_: Hello, I want to create a custom class for RoR, i placed the file in /lib and and edited config/application.rb to autoload the file. But i want to the test the class in rails console, do i need to restart the console every time to get the latest version of the class?
[09:09:26] sevenseacat: mathijspb_: or you could just reload the code i believe
[09:10:40] krz: Can anybody suggest a good tutorial, documentation about ActiveRecord and join? How can I access the values of fields?
[09:11:38] mathijspb_: sevenseacat: do you mean with ClassName.new? Because that doest work for me
[09:12:07] GarethAdams: mathijspb_: type `reload!` in the console
[09:12:51] mathijspb_: GarethAdams: thx
[09:14:19] maasha: More on shoulda-matchers, this two tests are equivalent, yes? https://gist.github.com/maasha/ca58a4fc98b0b65013d7
[09:16:55] maasha: sevenseacat, right.
[09:19:24] GarethAdams: maasha: also, I don't know how shoulda-matchers cares that you're assigning a property on an unrelated `user` variable - I assume you have that tied into the test somewhere else?
[09:20:20] maasha: GarethAdams: good point.
[09:20:55] maasha: GarethAdams: it gives a nomethod error
[09:21:14] maasha: Or I didnt get it.
[09:21:32] GarethAdams: should should be able to set `subject.name = …`
[09:28:06] vaisakh: rushed: Thanks, I'm watching it.
[09:28:22] vaisakh: elaptics: Thanks. I'm looking into it.
[09:38:38] zeromodulus: A rake task I made which just calls db:drop db:schema:load and db:seed fails, but when I run the commands individually it succeeds: https://gist.github.com/zeromodulus/5883602
[09:51:07] maloik_: zeromodulus: I believe rake db:reset does about the same
[09:51:44] Sylario: Well, i was wondering if they was railscast for Cancan, and then i saw the maintainer of cancan....
[09:55:07] vaisakh: elaptics: Introduction to rack is simple great.It's really helped me.
[09:55:13] vaisakh: Thanks a ton :)
[09:56:15] maasha: So I want to use shoulda-matchers in my rspec. How does it look? https://gist.github.com/maasha/0f1d9b2ff278463ef876
[10:16:20] Sylario: If i have users created with Devise, is it possible to keep them as my app will only use warden and no longuer use Devise?
[10:16:56] Sylario: And by keep i mean, will i be able to do a migration where i can keep the same login/password?
[10:23:10] rushed: Sylario: if you want warden you probably also want devise :) that said if you continue to use the same password function and settings you should be able to continue to verify existing passwords
[10:24:01] Sylario: rushed: i'm migrating an app to multi tenancy using "Mulittenancy with rails"
[10:24:13] Sylario: it explicitly says to not use devise
[10:30:35] asjk: hey guys, any idea why even after i signing into code triage, i get redirected back to the homepage
[10:31:17] asjk: and the same happens when i try to triage a particular repo
[10:31:21] asjk: nothing happens :(
[10:41:51] Hamatti: hi guys! I'm having some trouble with the whole ruby/rvm/rails/gems thing. I'm running a Ubuntu 12.04 and the installation seems really crashed.
[10:42:39] Hamatti: I followed the railsgirls guide for installation but it seems there was an older broken installation already on my server and now everything is more or less a mess
[10:43:16] Hamatti: i have a ruby 2.0.0p247 at the moment but if I try to run some rails commands, it says
[10:43:20] Hamatti: -bash: /usr/local/bin/rails: /usr/bin/ruby1.8: bad interpreter: No such file or directory
[10:43:36] Hamatti: i tried to google some instructions to remove it all but nothing I found was helpful
[10:47:41] dukz: Hamatti, try uninstalling RVM by running `rvm implode`
[10:48:08] dukz: then check if you have any other ruby version management software like chruby, rbenv, etc.
[10:48:24] dukz: uninstall them if you do, then choose just 1 of em and start all over again.
[10:51:25] Hamatti: okay, I ran the rvm implode, then removed the rbenv
[10:51:56] Hamatti: i think there might still be something, since if run "rails", it gives me the sme error as above
[10:52:49] dukz: Hamatti: make sure to start a new terminal session, then run `which ruby`
[10:53:16] Hamatti: which ruby gives nothing
[10:53:32] dukz: it'll show you which ruby executable it's running. You may also want to run `echo $PATH` to see if anything is added to the PATH through bash profiles, etc.
[10:53:52] Hamatti: in PATH, there's nothing ruby or rails stuff
[10:54:23] Hamatti: but the rails command still gives the same error (I believe it should not give that kind of if it's not installed, am i rite?)
[10:54:28] dukz: ok, then you should be clean now. Pick one of the ruby managers, and follow the instructions. :) you should be good now.
[10:54:33] dukz: try to run `which rails`
[10:54:46] Hamatti: it gave /usr/local/bin/rails
[10:55:20] dukz: run ln -lh /usr/local/bin/rails | grep rails
[10:55:26] dukz: is it a symbolic link?
[10:55:59] Hamatti: -rwxr-xr-x 1 root root 380 Oct 27 2012 rails
[10:56:32] Hamatti: there's also rackup, rake, rake2thor and rdoc in the folder
[10:56:51] dukz: what about which ruby?
[10:58:00] Hamatti: oh, there's also ri and erubis in the folder
[10:58:00] dukz: hmm... not sure where that's comnig from, but at any rate, if you install new ruby version manager, it should prepend the bin dirs of gem executables to the PATH variable, so it should be safe.
[10:58:12] Hamatti: ok, i'll test that
[11:17:20] seba4: has_many :otp_settings created def otp_settings right?
[12:11:25] maloik_: We recently upgraded the Tire elasticsearch gem which now has a tire:import:all rake tast, however upon running that I get an error (while my colleague does not)
[12:11:29] maloik_: https://gist.github.com/hannesfostie/09b050e5cd86db277012
[12:11:56] maloik_: Anyone know what to try here ?
[12:23:11] zeh235: hi there. is there a way to use a file_field tag, and make it 'editable'? i want to have two options, either inserting the path by typing or by selecting it with the browse button. is this possible? problem is, that the field automagically opens the file browser when selecting it. not only by pressing the browse button
[12:23:35] sevenseacat: thats the point of a file field
[12:23:46] sevenseacat: screwing with the browser controls like that isnt wise
[12:23:56] zeh235: yeah, i know. but i want to be able to put in the path by hand also
[12:24:19] zeh235: would it be better to use a normal text_field and then use some javascript for displaying a file browser?
[12:24:58] elaptics: zeh235: you probably will need both, or you'll have to create something by hand with an input field and some javascript
[12:25:25] elaptics: zeh235: the first thing is to consider whether you really need this?
[12:26:10] zeh235: ok. i see. yeah, its not about file upload. its just some form where the user can input some path (its used to generate some scripts out of this data). it would be cool if the user can also select the path with some filebrowser thing if he has this file on his computer
[12:30:15] maloik_: I have a file lib/search.rb that defines a module Search. I include it in a module (include Search), everything works fine. However when running a Tire rake task I'm getting 'undefined constant Search', an error my colleague on the same codebase is not getting
[12:30:23] maloik_: I'm quite clueless as to where to look, any ideas ?
[12:33:57] adac: How to check via javascript if the use is logged in? Just by reading out the cookie? If yes, which value of the cookie does hold this information?
[12:34:56] rushed: adac: http://railscasts.com/episodes/324-passing-data-to-javascript
[12:36:29] seba4: adac if login is defined in cookie then yes just read cookie..
[12:36:53] seba4: but there probably should be second validation. Cookies can be changed...
[12:37:07] seba4: atleast that is mine opinion..
[12:37:18] adac: seba4 and rushed, thank you very much!
[12:38:13] dllama: has anyone here had the misfortune of cleaning up RTF text?
[12:38:19] adac: seba4, sure thing yes. It is just for the usability so the user gets redirected when clicking on a "button" that executes a ajax option
[12:39:57] rushed: adac: "let me check cookies on the client to determine where to redirect" said no one ever :)
[12:40:54] adac: rushed, did I say that?
[12:41:02] elaptics: rushed: I suspect PHP developers may well have said it ;)
[12:52:47] adac: The user needs to see a login dialog when he clicks on certain ajax action. I don't know how to do this with rails natively. If there is way then feel free to tell me
[12:53:14] maloik_: hidden div with the form, click on it, add class to display it
[12:53:29] maloik_: ajax isn't necessary unless you want to log him in without refreshing the page
[12:54:39] adac: maloik_, yes I see. and therefore on client side I need to know if I'm already logged in
[12:54:51] adac: whcih was my previous question
[12:55:29] maloik_: user is not logged in, so you add the form... he logs in, so you don't add the form
[12:55:32] maloik_: easy, no ?
[12:58:38] adac: maloik_, yes. thank you
[12:59:46] youl: when rendering a collection in a view
[12:59:47] youl: like "render @categories"
[12:59:51] youl: how to set the partial used for each category ?
[13:00:18] egor: render @categories
[13:00:32] egor: and create partial _category.html.erb or haml
[13:00:49] youl: ok this is done, but I want to use another partial
[13:01:35] youl: smthing like render @categories, :partial => "category2"
[13:03:20] tagrudev: render :partial => "yolo", :locals => { :swag => true }
[13:03:22] egor: all that you need is http://apidock.com/rails/ActionController/Base/render
[13:03:27] Shorty_: tagrudev: no.
[13:03:32] Shorty_: not even once.
[13:04:45] maloik_: you don't even live once ?
[13:06:58] youl: =render :partial => "category2", :collection => @categories
[13:47:38] tagrudev: certainty, u drunk go home
[13:48:14] dllama: hoping someone might be able to point me in the right direction with an issue i'm having.  trying to format rtf text to either plain text or html
[13:48:58] sevenseacat: good luck with that.
[13:49:21] dllama: thanks sevenseacat lol
[13:53:26] msimkins: dllama, Think there is something called rtf-filter that may help
[13:54:16] dllama: i've installed some rtf libraries/gems but they all suck
[13:54:52] dllama: now i'm trying to figure out how to pass values into ubuntus unrtf
[13:56:02] Ace20: does anybody know how to annotate Draper::Decorators so they match their models?
[13:59:15] dllama: Ace20, https://gist.github.com/mvoloz/34463e1959bbb345cdfe
[13:59:18] dllama: thats how i have mine setup
[14:00:39] freesteph: when you need to do some kind of modeling
[14:00:44] freesteph: what do you use?
[14:00:56] freesteph: I'm sketching on a piece of paper something that ressembles my UML classes from university
[14:01:14] freesteph: (Unified Modeling Language, the boring diagrams)
[14:01:39] sevenseacat: i usually use dia for diagramming.
[14:01:42] Ace20: dllama: how does that help with the annotating?
[14:01:56] maloik_: I draw tiny tables (head being the name of the model, other rows are the properties) connected by arrows
[14:01:57] freesteph: sevenseacat: I've used Dia!
[14:02:11] maloik_: but then again I haven't had any formal programming education so I simply don't know better
[14:02:13] freesteph: it's good software, but maybe slightly too much here
[14:02:19] msimkins: freesteph, In a rails app ??
[14:02:23] freesteph: maloik_: I think that's what most of us do?
[14:02:31] maloik_: yep I would think so
[14:02:34] freesteph: msimkins: well in my case I'm doing Rails
[14:02:42] freesteph: but this is tech-agnostic I guess
[14:02:49] sevenseacat: UML class diagrams are one of those 'oh duh' kind of things, other types of UML diagrams not so much
[14:02:58] dllama: sorry Ace, i guess i misunderstood what you initially ment
[14:03:14] msimkins: freesteph, in my rails app, I use erd to diagram the model relationships
[14:03:18] Xeago: ACTION uses http://www.asciiflow.com
[14:03:29] Xeago: or well something very similair
[14:03:35] freesteph: msimkins: nice!
[14:03:50] sevenseacat: rails-erd and railroady are good tools to generate diagrams from existing code
[14:03:57] sevenseacat: existing rails code, that is
[14:04:01] freesteph: Xeago: that's amazing ah!
[14:04:02] Xeago: when exporting/presenting I use ditaa
[14:04:14] Xeago: http://ditaa.sourceforge.net
[14:04:43] Ace20: dllama: yeah I use a similar setup to that
[14:14:05] cored: quick question, I'm using database cleaner on my spec_helper after doing some refactoring to my models the specs starting to failed with exception ActiveRecord::RecordNotSaved
[14:14:38] cored: using rails 3.2.13 which is odd because I have config.after(:each) do Databasecleaner.clean end
[14:14:52] cored: s/Datbasecleaner/DatabaseCleaner
[14:15:20] cored: when I do a manunal rake db:reset the specs start to work until they found another User.create!(attributes)
[14:19:31] aknagi: cored: I had problems with database_cleaner & mysql, and had to switch to the 'truncation' strategy, but I imagine you have a different issue. Here's my config incase it helps http://pastie.org/8091394
[14:21:30] cored: aknagi: well, I'm using SQLite, but I will check your configuration either way and already using truncation
[14:21:58] aknagi: cored, Any clues in your backtrace?
[14:24:25] cored: aknagi: nope :-(
[14:38:37] interactionjaxsn: cored: You could use find_or_create. I know that doesn't solve the problem but it should allow your specs to run without the need to run db:reset every so often. From there you can explore other means of cleaning up after yourself.
[14:42:23] mfilipe: what is the problem here? http://pastie.org/8091465
[14:42:38] mfilipe: I have the nome field in the database
[14:42:45] mfilipe: I can't see the error :(
[14:45:35] interactionjaxsn: undefined method `nome='
[14:45:36] cored: interactionjaxsn: going to try that, thanks
[14:46:04] Shorty_: hey guys, I have a question.. I have an 'account' model of which a user may have many.. but I have a dependency where one account may depend on another via it's 'dependant_id'.. how can I prefetch all the objects I'll need to build a nested menu without doing a *heap* of queries?
[14:46:29] interactionjaxsn: mfilipe: nevermind... just saw your schema
[14:46:35] mfilipe: interactionjaxsn: nome is the correct name for the attribute
[14:47:15] interactionjaxsn: mfilipe: what rails are you using?
[14:47:31] mfilipe: interactionjaxsn: 3.0.9
[14:49:42] interactionjaxsn: mfilipe: this ? http://apidock.com/rails/ActiveRecord/Base/attr_accessible/class
[14:50:55] interactionjaxsn: mfilipe: and you also want to get on a secure version of rails. this http://www.cvedetails.com/vulnerability-list/vendor_id-12043/product_id-22568/version_id-129524/Rubyonrails-Ruby-On-Rails-3.0.9.html
[14:51:13] TheBatMan: Does Devise support rails 4 in master yet?
[14:51:18] TheBatMan: I've been on the rail4 branch
[14:55:01] sevenseacat: TheBatMan: check on github if that branch has been merged into master.
[14:55:20] TheBatMan: I've seen you somewhere before, sevenseacat
[14:55:52] TheBatMan: Have you seen TheBatMan before?
[14:56:22] sevenseacat: thats not the one i wanted
[14:56:55] interactionjaxsn: TheBatMan: this pr would indicate yes https://github.com/plataformatec/devise/commit/39c1a2c7d025adbc90e86fb5c1da41dad65d4385
[14:58:03] interactionjaxsn: TheBatMan: but seriously bruce, why aren't you paying someone else to do this. ;)
[14:59:14] TheBatMan: interactionjaxsn: I must learn…everything. To be the best.'
[14:59:33] TheBatMan: interactionjaxsn: Thanks. So it has already been 2 months that I've been on rails4 branch..Huh.
[15:00:03] mfilipe: interactionjaxsn: I wanna update my rails but I'm afraid about some incompatibilities
[15:00:15] mfilipe: do you know some version which I can update without problems?
[15:00:39] TheBatMan: mfilipe: What version are you running/
[15:00:45] TheBatMan: mfilipe: 3.2 -> 4?
[15:00:53] mfilipe: TheBatMan: 3.0.9
[15:01:03] TheBatMan: mfilipe: You have unit tests?
[15:01:15] mfilipe: yep but some tests are broken
[15:01:26] TheBatMan: mfilipe: Broken from upgrading or just broken right now?
[15:01:33] mfilipe: i have through rspec
[15:01:56] mfilipe: broken right now... I joined in this project and the tests were already broken
[15:02:02] interactionjaxsn: TheBatMan: the rails4 branch doesn't seem to be getting any more commits... :/
[15:02:14] TheBatMan: I strongly advise you to fix the tests before upgrading
[15:02:20] TheBatMan: or you won't know what's broken.
[15:02:29] TheBatMan: Of course rails will spit out deprecation notices and such
[15:02:38] mfilipe: I'm trying but look that: http://pastie.org/8091465
[15:02:40] TheBatMan: but you're still going to want dem tests
[15:02:47] chintanparikh: Hey all. I re-installed homebrew, and now I can't install any gems with native extensions for some resaon. Anyone have any idea why? I'll post the errors in a sec
[15:02:49] mfilipe: it doesn't make sense for me
[15:03:04] chintanparikh: https://gist.github.com/chintanparikh/5885346
[15:03:47] interactionjaxsn: chintanparikh: You have to install development tools first. ?
[15:03:57] chintanparikh: interactionjaxsn: They
[15:03:57] TheBatMan: mfilipe: You're going to have to figure out why your tests are failing
[15:04:01] chintanparikh: interactionjaxsn: They're definitely installed
[15:04:03] TheBatMan: maybe migrations?
[15:04:27] TheBatMan: interactionjaxsn: Alright. No more commits => no more needed branch
[15:05:17] interactionjaxsn: TheBatMan: i wouldn't say that's true for everything. You would have to use discretion. maybe look at the commits going into master to see if they are relevant
[15:06:35] mfilipe: TheBatMan: doesn't make sense it to be a migration problem because I'm running the rspec command (migrations and after the test executions)
[15:07:07] interactionjaxsn: chintanparikh: idk. what does the mkmf.log say?
[15:07:30] chintanparikh: interactionjaxsn: Any idea where I'd find it?
[15:07:31] TheBatMan: Then I'm not sure mfilipe
[15:07:45] TheBatMan: You won't be able to upgrade to 3.2 or 4.0 because there are definitely incompatibilites
[15:08:00] mfilipe: TheBatMan: lol
[15:08:08] mfilipe: if I execute rspec I got that error
[15:08:19] mfilipe: but if I execute rake spec I don't get the error
[15:08:35] mfilipe: what is the difference between rspec and rake spec?
[15:08:50] TheBatMan: I've personally always used rspec spec/
[15:08:53] mfilipe: TheBatMan: I don't wanna update to 4.0
[15:08:58] TheBatMan: Maybe someone else can chime in
[15:09:50] interactionjaxsn: chintanparikh: do a find
[15:09:59] boytoy: Anybody tried the new OpenSMTPD with Action Mailer yet?
[15:10:41] boytoy: http://www.opensmtpd.org/
[15:10:45] boytoy: time to say byebye to postfix
[15:11:38] criten: How much does the average rails dev get? Just curious to how my pay compairs.
[15:11:55] fryguy: criten: can I PM you?
[15:12:04] TheBatMan: fryguy: can I PM you?
[15:12:11] fryguy: TheBatMan: um, sure i guess
[15:12:13] TheBatMan: let's do a 3 way
[15:12:15] interactionjaxsn: criten: I get bread and water
[15:14:08] interactionjaxsn: criten: that was in my news feed the other day http://www.indeed.com/salary?q1=Ruby+On+Rails+Developer&l1=London%2C+UK
[15:14:39] criten: yeah. much above my pay :P
[15:14:48] Phobos: Hello all
[15:15:02] TheBatMan: interactionjaxsn: holy shit
[15:15:21] TheBatMan: Meh. I don't care for cash
[15:15:26] TheBatMan: I'm on a pursuit of happyness.
[15:15:28] interactionjaxsn: yeah :/ i don't make that
[15:15:59] TheBatMan: One day, interactionjaxsn. One day.
[15:16:11] interactionjaxsn: i feel like it's industry fluff to try and push up base salaries. I wish it would work although I have grown attached to my daily ration of stale bread and tap water
[15:16:25] TheBatMan: DHH will come out of the heavens and lead his rails army to a prosperous land
[15:16:55] IlyaLevin: Hey guys, what is the fastest way in Rails to get the current hour (from 1 to 24) and current weekday number (from 1 to 7)?
[15:17:11] Phobos: What is the best way to deal with this use case : an ad banner that needs to be managed from the backend by the admin. I don't think that creating one model/table for just storing one row is a good approach ? is there any better idea ?
[15:17:59] IlyaLevin: Phobos: I usually use a Config model for all customizable configurations
[15:18:05] cored: I'm having a weird behaviour with validations User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = 'example@example.com' LIMIT 1
[15:18:20] IlyaLevin: If you have just one in your app, chances are, you'll be having more soon)
[15:18:28] cored: I have validates :email, uniqueness: true in my user model
[15:18:31] scyllinice: interactionjaxsn: That chart just tells me that I should call myself a ROR Engineer
[15:18:39] cored: but still is saying valid with two different instance of the same object
[15:18:47] Phobos: IlyaLevin, you mean to store that in a table anyway ?
[15:18:56] IlyaLevin: Phobos: yea
[15:19:04] sevenseacat: IlyaLevin: Date.today.wday and Time.now.hour ?
[15:19:44] Phobos: IlyaLevin, I was thinking about the same thing today.. you are right ! we must think about scaling sometimes
[15:20:11] sevenseacat: cored: are they both saved?
[15:20:12] interactionjaxsn: scyllinice: not Ror Engineer
[15:20:35] sevenseacat: cored: if theyre the same object, they're both still valid.
[15:22:47] cored: sevenseacat: different objects
[15:22:59] sevenseacat: cored: you said before two instances of the same object.
[15:23:34] sevenseacat: if you load User ID 1 twice, doesnt make the first one suddenly invalid.
[15:23:41] cored: sevenseacat: ok, I tried to save one using the sandboxed console, but did not get save
[15:24:29] cored: which is wierd, why .valid? is saying tat the model is actually valid is not saving anything
[15:24:45] boytoy: Action Mailer's default arguments for Sendmail are "-i -t". If I switch from Sendmail to say the new OpenSMTPD (http://opensmtpd.org/) -- should I have to worry about "-i -t"?
[15:24:48] boytoy: So far my production.rb has: config.action_mailer.sendmail_settings = { location: "/usr/sbin/smtpctl" }
[15:24:53] mikecmpbll: it won't actually touch the database if the object hasn't changed.
[15:25:17] mikecmpbll: call .changed? on the record, cored.
[15:25:18] sevenseacat: cored: i don't understand your improper english.
[15:25:20] interactionjaxsn: IlyaLevin: http://api.rubyonrails.org/classes/DateTime.html#method-i-to_formatted_s
[15:25:38] cored: sevenseacat: ok, sorry
[15:26:21] cored: sevenseacat: let me, try explain myself. I did u = User.new(attributes); u.valid? -> true; u.save -> false
[15:26:38] cored: sevenseacat: the instante is valid but still can't save?
[15:26:53] cored: mikecmpbll: returned true
[15:26:55] cored: sevenseacat: wait
[15:27:06] mikecmpbll: u.save! and tell us the error ;)
[15:27:12] chintanparikh: interactionjaxsn: I found a bunch, but this might be the wrong one? https://gist.github.com/chintanparikh/5885541
[15:27:18] cored: sevenseacat: btw this is not my code, I'm just doing some refactoring of it for fun https://gist.github.com/cored/5885540
[15:27:20] chintanparikh: interactionjaxsn: Doesn't seem to give me any useful info
[15:27:30] cored: sevenseacat: that's the code from one of the RailsApps tutorial
[15:27:42] sevenseacat: cored: https://gist.github.com/cored/5885540#file-user-rb-L13 if this returns false, the save will not proceed.
[15:27:51] cored: mikecmpbll: ActiveRecord::RecordNotSave
[15:30:10] mikewintermute: Any suggestions on this: active_model/deprecated_mass_assignment_security.rb:14:in `attr_accessible': `attr_accessible` is extracted out of Rails into a gem. Please use new recommended protection model for params(strong_parameters) or add `protected_attributes` to your Gemfile to use old one. (RuntimeError)
[15:30:37] sevenseacat: mikewintermute: i suggest reading the message and doing what it says.
[15:30:56] momomomomo: mikewintermute: Post your code and errors to http://gist.github.com in future; but yeah, sevenseacat is spot on
[15:31:24] cored: sevenseacat: got it
[15:31:26] cored: sevenseacat: thanks
[15:31:56] interactionjaxsn: chintanparikh: not sure :/ sorry man.
[15:32:00] cored: sevenseacat: the create callback happens after the save, right ?
[15:32:06] chintanparikh: interactionjaxsn: No worries
[15:32:14] GarethAdams: is there a simple way to paragraphize blocks of text other than using simple_format?
[15:32:23] sevenseacat: cored: when it's a _before_ create? no.
[15:32:25] chintanparikh: Anyone know why trying to install debugger apparently installs ruby-debug?
[15:32:30] GarethAdams: I don't want its other behaviour of allowing <b>,<span> etc
[15:33:20] cored: sevenseacat: ok
[15:33:44] scyllinice: chintanparikh: Doing a gem install debugger tries to install ruby-debug?
[15:33:51] sevenseacat: chintanparikh: it should not.
[15:33:58] sevenseacat: it has no dependencies on ruby-debug.
[15:34:12] scyllinice: And none of its dependencies do either
[15:34:54] sevenseacat: it's a replacement for the old ruby-debug.
[15:35:54] chintanparikh: scyllinice sevenseacat It says it's trying to install debugger, but when I go into the path, it's "~/.rvm/gems/ruby-1.9.3-p0/gems/debugger-1.6.0/ext/ruby_debug"
[15:36:06] chintanparikh: Note the ruby_debug on the end. I have a feeling that's why it's failing?
[15:36:16] chintanparikh: I figured it should be ext/debugger, not ext/ruby_debug
[15:36:20] sevenseacat: https://github.com/cldwalker/debugger/tree/master/ext/ruby_debug
[15:36:41] sevenseacat: no problems there.
[15:36:42] chintanparikh: sevenseacat Hah, right you are
[15:37:01] scyllinice: chintanparikh: The gemspec also has this: s.extensions << "ext/ruby_debug/extconf.rb"
[15:37:04] scyllinice: So it knows what to build
[15:37:12] chintanparikh: scyllinice Got it, thanks guys
[15:37:23] chintanparikh: Anyone mind taking a look at https://gist.github.com/chintanparikh/5885346 I can't seem to work out the issue
[15:37:32] chintanparikh: I re-installed homebrew and now debugger just won't install
[15:37:46] sevenseacat: methinks you need to install development tools.
[15:38:38] chintanparikh: sevenseacat Hmm, I'll give that a go. They're definitely installed and in my PATH, but maybe re-installing will help
[15:38:43] scyllinice: All those damn pesky error messages that state a possibility
[15:38:53] scyllinice: chintanparikh: Run brew doctor
[15:38:58] scyllinice: It'll tell you if you're missing something
[15:39:18] chintanparikh: scyllinice Oh wow, how did I not think of that, gimme a sec
[15:39:23] interactionjaxsn: scyllinice: totally forgot about brew doctor.
[15:39:29] interactionjaxsn: need to run it myself
[15:39:32] mikecmpbll: there will probably be more useful information in mkmf.log like it says
[15:40:00] chintanparikh: mikecmpbll Couldn't find anything useful https://gist.github.com/chintanparikh/5885541
[15:40:33] chintanparikh: scyllinice Whoa, so many errors
[15:41:08] chintanparikh: scyllinice I think most of them showed up because I re-installed brew incorrectly. Is there a proper way to install homebrew?
[15:41:56] chintanparikh: Or re-install rather
[15:42:31] scyllinice: Here's an uninstall script from the Homebrew author: https://gist.github.com/mxcl/1173223
[15:42:44] scyllinice: Then you should be able to just follow the regular install instructions
[15:43:14] mikecmpbll: chintanparikh: probably because you don't have a /usr/local/bin/gcc-4.2
[15:43:22] mikecmpbll: check that exists.
[15:44:13] chintanparikh: mikecmpbll: Seems to exist
[15:44:27] chintanparikh: mikecmpbll Or at least ls says it does. When I try to cat/cd into it it says it doesn't exist?
[15:45:39] Solnse: can anybody recommend a gem to use for web scraping an AJAX result? I've been using mechanize for my other methods, but I've encountered a page that uses javascript to populate the result and I'm getting nil returned with mechanize, open-uri, and watir-webdriver. and I'd really like to find a solution that doesn't require opening an actual browser.
[15:45:53] mikecmpbll: you won't be able to cd into it, it's a compiler. you should be able to cat it but you wouldn't want to particularly.
[15:46:08] mikecmpbll: it's probably a symlink
[15:46:14] chintanparikh: mikecmpbll Yeah, figured so :)
[15:46:21] chintanparikh: The brew uninstall script fails - error: The following untracked working tree files would be overwritten by checkout:
[15:46:32] chintanparikh: And then lists a bunch of files. Git issue I assume?
[15:46:39] mikecmpbll: do you have command line tools for Xcode installed?
[15:46:53] chintanparikh: mikecmpbll Yup
[15:47:05] chintanparikh: Everything was working fine until I reinstalled homebrew
[15:50:11] brownies: Solnse: you will have to use phantomjs or selenium
[15:50:29] brownies: Solnse: you can drive either one with capybara
[15:50:31] mikecmpbll: chintanparikh: if you installed gcc42 through homebrew then maybe uninstalling homebrew has screwed that
[15:50:41] brownies: and either one will be a pain in the ass, in its own unique and special way
[15:50:54] chintanparikh: Just re-installed brew. Same issues. mikecmpbll: I'm not sure I did, any idea if it's possible to check?
[15:51:16] chintanparikh: mikecmpbll: okay yeah I did, history shows the command
[15:51:22] mikecmpbll: look where that symlink points to
[15:52:42] chintanparikh: mikecmpbll: Uhh, re-installed brew and now gcc-4.2 is gone
[15:52:51] mikecmpbll: there you are then.
[15:53:35] Solnse: brownies: thank you, I will look into it... I started playing around with selenium last night but it seems it opens a browser too?
[15:53:53] chintanparikh: mikecmpbll Does it have to be 4.2? Doesn't look like that's an open anymore
[15:55:00] chintanparikh: mikecmpbll: Cool, installing 4.9 atm
[15:55:56] mikecmpbll: if it doesn't work install gcc-4.2, there's loads of information on google of how to do it.
[15:56:40] pkp: I am not able to get the rails server running after creating a new app using rails composer.
[15:56:42] pkp: http://dpaste.de/4CEL8/
[15:56:56] pkp: Here's the error that I am getting.. can anyonetell me whats the problem?
[15:58:06] boytoy: Action Mailer's default arguments for Sendmail are -i and -t (http://guides.rubyonrails.org/action_mailer_basics.html): config.action_mailer.sendmail_settings = { location: "/usr/sbin/sendmail", arguments: "-i -t"}
[15:58:10] boytoy: If I switch OpenSMTPD: config.action_mailer.sendmail_settings = { location: "/usr/sbin/smtpctl" } -- should I have to worry about replacing -i and -t?
[15:58:13] boytoy: -i: Do not strip a leading dot from lines in incoming messages, and do not treat a dot on a line by itself as the end of an incoming message. This should be set if you are reading data from a file.
[15:58:17] boytoy: -t: Read message for recipients. To:, Cc:, and Bcc: lines will be scanned for recipient addresses. The Bcc: line will be deleted before transmission.
[15:58:53] hoffmanc: hello. how do I keep guard from running absolutely every spec?
[15:59:26] hoffmanc: I tried to have it watch only lib, but it keeps trying to run through everything on startup, and our test suite takes like an hour to go through...
[16:04:05] elaptics: hoffmanc: configure your Guardfile to only watch the lib directory
[16:05:14] sprite--: Does anyone know if Rails 4 live streaming is supported on Amazon Elastic Beanstalk?
[16:06:07] hoffmanc: yeah that didn't work, but I found the appropriate option for the rspec-specific config here: https://github.com/guard/guard-rspec
[16:06:18] hoffmanc: :all_on_start
[16:06:29] asoliman: How can i display a flash notice after ajax call/
[16:09:21] elaptics: asoliman: by returning something appropriate in your ajax call and then doing something with it
[16:17:41] dEPy: I'm using action model serializers, can I force as_json to use that? because I'm using it like: render json: {success: true, price: x, estimate: estimate} and estimate should be serialized using my serializer
[16:18:22] chintanparikh: Finally installed gcc - still no luck. Any ideas?
[16:20:12] BrianJ: I have a datetime attribute and I want to display 8 weeks from that date.. how would I do this? Date.parse(@user.due_date.to_s + 56.days)
[16:20:30] BrianJ: is failing due to "can't convert ActiveSupport::Duration into String"
[16:20:47] BrianJ: due_date is a datetime attribute
[16:22:50] pontiki_: don't do the to_s
[16:23:23] BrianJ: can't convert ActiveSupport::TimeWithZone into String
[16:23:25] elaptics: don't need to do Date.parse either
[16:24:01] elaptics: just add the date to the duration will give you another datetime object that you can then choose how to display
[16:24:31] elaptics: so e.g. (@user.due_date + 56.days).strftime(….)
[16:24:50] BrianJ: that worked
[16:24:58] brownies: Solnse: oh you don't want it to open a browser? then you will have to use phantomjs
[16:25:04] brownies: Solnse: with the poltergeist gem
[16:25:05] BrianJ: i did a to_date at the end
[16:39:00] reckoner: i'm looking for an example of how you're using factory_girl with carrierwave. my tests are running slow, i suspect this is why
[16:40:46] dobry-den: I have a question about restful-ish api design: Is `GET users/:user_id` preferable over `GET /users?user_id=42`?
[16:41:26] cschneid: if I have a form builder object, can I get access to the underlying object its wrapping?
[16:41:39] pontiki_: oh crikey, didn't even see the Date.parse thing
[16:41:56] cschneid: I'm in a partial and need to grab the underlying object to work around this line: https://github.com/rails/rails/blob/fb24f419051aec00790a8e6fb5785eeb6f503f4a/actionpack/lib/action_view/helpers/tags/text_field.rb#L9 (I don't want it before the typecast)
[16:43:26] pontiki_: reckoner: unless you're actually intending to test the real carrierwave code itself, mock it in your tests
[16:52:24] asoliman: elaptics: thank you
[16:52:36] asoliman: elaptics: i think i just had a typo
[16:54:55] nobitanobi: Anyone can see where does https://github.com/rails/docrails/blob/master/actionmailer/actionmailer.gemspec get the "version" from?
[16:56:16] pontiki_: nobitanobi: try line 1
[16:56:50] momomomomo: Having a tough time moving servers with a unicorn app; Unicorn is raising errors that look like it needs permissions somewhere, but the deployer user owns the app directory.. Here's the stack trace https://gist.github.com/momer/1ada40b7c7f5c94bcad3
[16:57:37] reckoner: pontiki_ looking into it thanks
[16:57:58] pontiki_: momomomomo: check the path up from the log file
[16:58:21] pontiki_: log/ needs rwx
[16:58:49] pontiki_: /home/deployer/apps/myapplication/shared/log
[16:58:57] pontiki_: is that directory linked anywhere?
[16:59:41] momomomomo: It's the stderr / stdout for unicorn
[16:59:46] momomomomo: & production log as well
[17:00:06] Xeago: I generated my model with transactions:references
[17:00:11] Xeago: but it generated a belongs_to for thi
[17:00:17] pontiki_: no sorry, you miss my point
[17:00:19] Xeago: what did I do wrong for it not to create a has_many?
[17:00:25] pontiki_: not the *file* i understand that
[17:00:57] pontiki_: what are the permissions on the *directory* it's in? and if it's a linked directory, the permissions on the directory it's *linked* to
[17:01:59] momomomomo: right, that log dir has 755
[17:02:10] pontiki_: and who is the owner?
[17:02:24] pontiki_: same as unicorn user?
[17:02:49] momomomomo: Deployer user inits unicorn, so yeah
[17:03:02] pontiki_: does your unicorn.rb contain a different user?
[17:03:24] pontiki_: or whatever you're calling your unicorn init file
[17:04:37] momomomomo: pontiki_: No, but I did just notice a legacy group being mentioned in unicorn.rb - one sec
[17:06:59] momomomomo: pontiki_: Sometimes it takes someone else's eyes to point out a simple mistake :) thank you - just have to figure out why the http server isn't working now
[17:07:15] pontiki_: nw, momomomomo
[17:07:22] momomomomo: pontiki_: just kidding
[17:07:44] momomomomo: pontiki_: Stderr log was delayed in adding the entries - error seems to have moved to initgroups now
[17:09:09] momomomomo: I'm trying out http://serverfault.com/questions/425529/operation-not-permitted-when-starting-unicorn - let's see if that resolves it
[17:16:10] nobitanobi: Anyone knows where the "Learn more" links are supposed to link? https://github.com/rails/docrails/blob/master/activerecord/README.rdoc -- they are broken right now
[17:21:17] pontiki_: nobitanobi: don't read the doc source, read the doc website
[17:21:30] pontiki_: http://api.rubyonrails.org
[17:21:34] nobitanobi: pontiki_, I'm trying to contribute :)
[17:21:49] nobitanobi: but I wonder where the .html files are
[17:22:28] pontiki_: they get generated via rdoc
[17:23:18] nobitanobi: pontiki_, actually https://github.com/rails/docrails/blob/master/activerecord/README.rdoc is not in these docs: http://api.rubyonrails.org/
[17:23:30] pontiki_: of course not
[17:23:41] micah`: nobitanobi: it is, search for README, 7th result down for me
[17:23:51] pontiki_: it's generated
[17:23:57] pontiki_: and won't have the github ref
[17:24:29] nobitanobi: well, will keep digging
[17:24:35] pontiki_: if you go to api.rubyonrails.org, in the left frame, open ActiveRecord, then Base, then the readme
[17:24:38] nobitanobi: while I learn, I will try to fix if I find something wrong
[17:24:52] nobitanobi: thanks pontiki_
[17:26:01] nobitanobi: pontiki_, ActiveRecord, then Base?
[17:26:05] nobitanobi: Base is not a folder in the left frame though
[17:26:17] micah`: sorry dropped there; any luck nobitanobi ?
[17:26:31] nobitanobi: micah`, yeah, I found it using the search form :)
[17:26:53] nobitanobi: can't find it using the left menu though
[17:27:07] micah`: yeah, weird huh
[17:29:44] nobitanobi: Do you guys know where are http://guides.rubyonrails.org stored?
[17:32:14] momomomomo: pontiki_: no dice for the init groups, gist here: https://gist.github.com/momer/1ada40b7c7f5c94bcad3
[17:50:26] buzaga: what's a good channel to ask ec2/sysop questions?
[17:50:35] dllama: would anyone be kind enough to help me out with this: https://gist.github.com/mvoloz/2d5e07928cfcdeaff4e1 — yes i know the formatting is a little off, sorry for that. can't get gist to set my tabs properly
[17:52:14] pontiki_: nobitanobi: click on the arrow next to ActiveRecord on the left, then Base when i opens up
[18:00:22] micah`: dllama: any luck?
[18:04:11] luckyruby: how come the default gemfile for rails4 doesn't use group :assets anymore?
[18:04:44] micah`: luckyruby: https://github.com/rails/rails/commit/49c4af43ec5819d8f5c1a91f9b84296c927ce6e7
[18:05:02] luckyruby: micah`: thanks
[18:05:56] Ryuno-Ki: Good evening
[18:06:02] micah`: luckyruby: looks like you have to precompile now
[18:10:51] ziyadb: Good evening.
[18:15:33] ziyadb: Quick question, I've overriden the default devise registrations controller and my client-side js expects a json (success) response in order to behave as expected. However, the response is empty. Controller code https://gist.github.com/ziyadbasheer/5886792
[18:16:45] brian___: slightly off topic, has anyone updated passenger 3.x to 4.0 on a live server? is it safe to do this?
[18:17:35] ziyadb: brian___: it's never safe to update anything on a "live server".
[18:18:18] dllama: micha, sorry i stepped away. no luck yet.
[18:20:29] luckyruby: brian___: try it on a staging server first
[18:41:17] pivotal: microphone check...is this thing on?
[18:42:50] pivotal: fryguy: you can read this?
[18:44:40] pivotal: yay! we have a polymorphic, STI, has_many through. we noticed that the polymorph only uses the STI base class when storing type. is there a specific reason for this?
[18:45:07] fryguy: pivotal: show us
[18:45:39] pivotal: hold please.
[18:52:01] pothibo: dllama: format your computer
[18:52:29] pothibo: I'm kidding (Partly)
[18:52:41] pothibo: I don't understand why you can't set your indentation properly
[18:52:55] dllama: i manually change it in gist, but when i hit save, it changes it
[18:53:15] pothibo: di you try using anonmymous browser and paste to gist?
[18:53:17] dllama: no matter how many times i got back in and edit it, it still saves it the way that it is, unless i manually retype it out
[18:53:46] pothibo: then it's not gist the problem
[18:54:08] scyllinice: Did you just pun?
[18:54:20] dllama: just tried annonymous in different browser,
[18:54:41] dllama: same thing, "tabs" "2 spaces" while editing. hit save => huge tabs
[18:54:52] pothibo: scyllinice: wrong construction :/
[18:55:06] pothibo: dllama: it's sublime the issue then
[18:55:27] luckyruby: is there a guide (paid is fine) you guys recommend for upgrading a rails 3.2 app to rails 4?
[18:55:27] dllama: maybe, but i dont plan on getting rid of sublime :)
[18:55:29] scyllinice: pothibo: Oh, I just like puns. That's why I asked if it was intentional
[18:55:51] pothibo: I wish I was that good in english
[18:56:19] dllama: pothibo, before:https://www.evernote.com/shard/s197/sh/edb59a77-f532-4ddb-9765-81c6753d00e8/00137c4facd3942353b7b8989dba338b/deep/0/Screenshot%206/28/13%202:55%20PM.png
[18:56:19] dllama: after: https://gist.github.com/anonymous/ebaa407e56a03749acd7
[18:56:56] pothibo: dllama: name the file for something.rb and submit
[18:57:58] dllama: https://gist.github.com/anonymous/06c38818ec5e1cdd97fc — something.rb, tabs/2 space indents prior to saving
[18:58:21] interactionjaxsn: dllama: oh damn, not this again
[18:58:25] pothibo: interactionjaxsn: hahaha
[18:58:49] pothibo: dllama: what language do you speak?
[18:58:52] dllama: u know, if i actually got an answer, u guys would spend much less time looking at code where u dont like the formatting :)
[18:58:53] interactionjaxsn: dllama: is it pronounced dilemma ?
[18:59:04] dllama: i speak english
[18:59:12] dllama: and its not dilemma, though i can see how that works now lol
[18:59:17] pothibo: and your computer/keyboard is US english?
[18:59:18] dllama: its just d — llama
[18:59:28] interactionjaxsn: dllama: like dhali llama ?
[18:59:42] pivotal: fryguy: https://gist.github.com/anonymous/ad2dbf9dea2ad404a740
[18:59:42] pothibo: like The Llama?
[18:59:46] dllama: and its dalai ;)
[18:59:54] pivotal: or anyone else that might be able to help...
[18:59:58] dllama: but no its just d, like the letter d stuck in front of the word llama lol
[19:00:07] interactionjaxsn: dllama: i spell as well as you soft tab ;0
[19:00:17] interactionjaxsn: also not good at shift key
[19:00:21] pivotal: as you can see in the gist, when asking for the "suggestable_type", it is set to the base class instead of the inherited class type
[19:00:53] dllama: anyway, ugly formatting aside, (i can't go for 2 straight days of lynching) can anyone actually help with the code? lol
[19:01:03] dllama: yes its spelled dalai lama
[19:01:29] pothibo: well, you try to strip character and you have tabbing issue
[19:01:44] pothibo: I have a vague feeling that both issue could be related
[19:01:53] dllama: are you talking about my formatting stilL?
[19:01:54] pothibo: strip_rtf?
[19:02:10] dllama: its not a tabbing issue
[19:02:16] pothibo: it's dalaï in french
[19:02:54] interactionjaxsn: and it's wtf i want it to be in 'murica
[19:03:11] interactionjaxsn: kidding of course.
[19:03:28] interactionjaxsn: dllama: what's the problem, soft tabs or is a code problem?
[19:03:32] pothibo: I live in america
[19:03:45] pothibo: wtf with americans thinking they are alone on the continent
[19:04:04] interactionjaxsn: 'muricans are alone in the galaxy
[19:04:07] dllama: i'm importing content thats encoded with rtf. i need to strip the rtf and end up with html or plain text.
[19:04:12] dllama: in view, it works
[19:04:16] dllama: as a method it doesn't
[19:04:51] dllama: when i preview before importing, removing rtf works perfectly fine, but when i start the sync process, i have to run the "notes" through a method to strip rtf, and thast where things go south
[19:06:40] dllama: heres the gist again. https://gist.github.com/mvoloz/2d5e07928cfcdeaff4e1
[19:08:49] interactionjaxsn: dllama: is this difference intended; from haml: - valid_string = ic.iconv(section[:text]) from sync.rb: ic.conv(section[:text])
[19:09:02] interactionjaxsn: missing i in ic.conv from sync.rb
[19:10:32] dllama: the missing I was a typo
[19:10:44] dllama: it was correct in the rb file
[19:10:59] dllama: must have erased it by accident while trying to format the gist :D
[19:13:21] interactionjaxsn: dllama: are you using pry yet?
[19:13:43] interactionjaxsn: dllama: you familiar with binding.pry ?
[19:13:59] dllama: no, u guys told me about it yesterday, i haven't had a chance yet to play around with it
[19:15:31] zeromodulus: Anyone use erubis?
[19:16:43] zeromodulus: I was thinking about using Haml, but then I learned about erubis. The description for erubis says it's 3 times faster than ERB.
[19:16:55] interactionjaxsn: dllama: now is the perfect time... just to get a feel for what it does, put binding.pry in the second line of your strip_rtf method and then hit that method from the application. Your app will hang and if you bring into view the terminal that you are running the server in, you will see ruby.
[19:17:24] dllama: k trying that now,
[19:17:28] interactionjaxsn: dllama: specifically you will see where you put in the binding.pry call
[19:18:50] zeromodulus: It looks like I already had erubis installed though. Does Rails 3.2.13 use erubis by default?
[19:19:10] pivotal: fryguy: any chance that you were able to take a look at that gist?
[19:19:13] pivotal: Radar: are you around?
[19:19:17] zeromodulus: Ah, looks like it does.
[19:19:27] dllama: interactionjaxsn, i see that the console
[19:21:11] interactionjaxsn: dllama: cool... you can do ruby in there... execute the code line by line to see what's happening to your object. also: multiple binding.pry calls will act as breakpoints if you run exit.
[19:21:27] dllama: i think i may have found the issue
[19:21:37] dllama: maybe* i think its the way i'm mapping the sections.
[19:21:44] dllama: but this looks like a great way to debug this…
[19:21:52] dllama: a lot easier than plain console
[19:24:24] fryguy: pivotal: no
[19:31:08] micah`: I stepped away, too dllama. how goes it?
[19:31:27] dllama: messing with pry
[19:31:37] dllama: might be getting closer, but who knows lol
[19:31:48] dllama: moral of the story, stay away from anything MS, and RTF sucks!
[19:35:25] micah`: I'd be happy to try to pair with you on it if you're set up for that at all
[19:36:32] dllama: skype, teamviewer, gotomeeting, ichat, facetime, pick ur poison lol
[19:38:34] dllama: thats a new one for me
[19:38:54] dllama: i think it might take me longer to figure out how to set it up and set my router permissions
[19:39:47] zeromodulus: Lol, it looks like Microsoft has a code hosting website like GitHub.
[19:39:49] micah`: wemux would be awesome. sorta depends on your editor of choice though
[19:39:53] zeromodulus: www.codeplex.com
[19:40:00] scyllinice: It's been around a long time
[19:41:05] dllama: micah, i'm using sublime
[19:42:52] scyllinice: It's more like Sourceforge or Google's offering though
[19:48:15] Ogredude: dllama: actually if you've got a box on the internet where you've got an ssh account, you can port forward through a reverse ssh tunnel. 'tweemux forward local 22 from whatever.mybox.com 2323'
[19:48:35] Ogredude: the big thing that takes getting used to is using a terminal-based text editor (vim!)
[19:53:46] fragamus: Is there a model For schema migrations? I want to manipulate those numbers
[20:03:39] end_guy: so I just upgraded to rails 4.0, and I get all these Relation#all is deprecated warnings...
[20:03:58] end_guy: what are you suppose to call if you literally need all the records?
[20:06:28] end_guy: scoped i guess?
[20:25:30] pontiki_: ACTION waves to Ogredude 
[20:26:20] Ogredude: ACTION waves to pontiki_
[20:41:52] jsmooth406: I'm new here. How's everything doing
[20:46:13] CPng|N: How's everyone going
[20:46:22] jsmooth406: Can you see me writing this?
[20:47:04] jsmooth406: Can anyone see this text???
[20:55:59] brian___: if i have a form partial thats shared across new and edit and i want the f.submit button to have custom text for both instead of the basic 'Create User' / 'Update User', something like 'Sign Up' / 'Update Profile' is the best way to do this to make an if statement that checks the controller action?
[20:59:39] pontiki_: brian___: that would work, or you could pass it in
[21:00:00] brian___: pontiki: looks like you can actually check if it's a new record too
[21:00:08] brian___: @user.new_record?
[21:00:13] brian___: cool thanks
[21:02:46] torartc: I have a smallish sqlite db that I'd really like to be in mysql. What the easiest way to accomplish that
[21:04:47] pontiki_: torartc: try here: http://www.redmine.org/boards/2/topics/12793
[21:05:03] pontiki_: there's a python script
[21:05:38] pontiki_: second link on https://www.google.com/search?client=ubuntu&channel=fs&q=convert+sqlite3+to+mysql&ie=utf-8&oe=utf-8
[21:06:11] torartc: thanks! I'll check it out
[21:07:33] luckyruby: torartc: I usually export data into something like a csv, then reimport it into the new db.
[21:08:19] torartc: luckyruby: That makes sense
[21:09:00] torartc: luckyruby: Would you export each table individually?
[21:09:26] torartc: luckyruby: word thanks!
[21:09:42] luckyruby: torartc: i feel safer doing it myself than relying on a script, tbh
[21:10:07] brownies: luckyruby: wat
[21:10:10] brownies: torartc: use the taps gem
[21:11:35] torartc: brownies: have it open right now, thanks for the tip
[21:14:58] werdnativ: It looks like Arel doesn't support inserting multiple rows at all. Is there a good trick to generate the bulk-insert SQL for "INSERT INTO t VALUES(1,2,3), (4,5,6)", safely?
[21:17:36] brownies: werdnativ: are you just trying to optimize past the usual ActiveRecord approach?
[21:17:53] brownies: werdnativ: a quick win would be to wrap it all in one transaction, instead of letting AR wrap each INSERT in its own transaction
[21:18:52] fryguy: werdnativ: https://github.com/zdennis/activerecord-import
[21:18:53] werdnativ: yes, not the usual ".save"… Hmm. that will be any faster?
[21:19:08] werdnativ: thanks fryguy, looking at that just now...
[21:34:02] xybre: Anyone aware of a way to disable type casting of values being set in ActiveRecord before they go to the DB? I'd like to validate values before type casting.
[21:40:49] aamax: I'm trying to get our app deployed and hitting some errors when precompiling assets. this code deployed to heroku so i know that was ok in the past. it seems to be choking on the css in this gist: https://gist.github.com/aamax/5888361 the line that SEEMS to be having trouble is 24. any ideas?
[21:41:27] aamax: xybre, could you use a callback to do it?
[21:42:17] terrellt: aamax: Is "progid" supposed to be in quotes?
[21:43:26] aamax: terrellt, i suppose so. i didn't write this but it's been in there like that for months. this server hasn't been set up before - first time deploying
[21:43:54] aamax: guess i can try precompiling locally in production but i hate doing that
[21:44:08] xybre: aamax: unfortunately no, ActiveRecord typecasts *on set* of the value, so as soon as it recieves the value, it mangles it. The only two approaches I can think of off the top of my head are to 1) overwrite the setter or 2) use a temporary instance variable, setting the value at save-time.
[21:45:12] aamax: xybre, i guess it would do the casting before you could get your hands on it in the callback. suppose that makes sense
[21:45:34] zeromodulus: wow, finally Galleria starts working.
[21:49:07] xybre: aamax: yep, happens even before the object is saved, it happens as soon as you set the value. So `SomeModel.new {some_attribute: "whatever"}` will immediately mangle the value of "some_attribute" according to the type casting rules hard-coded in ActiveRecord.
[21:49:27] xybre: aamax: for instance in AR, "true" == true; but "True" == false.
[21:49:58] aamax: right but there are callbacks on AR that get called before it saves. still no joy though huh?
[21:50:24] aamax: xybre, i guess you'll have to handle it before you create the AR object then
[21:50:36] aamax: or monkey patch AR - not my choice
[21:52:51] xybre: aamax: right, the coercion happens before the save, so no dice.
[21:54:07] aamax: i updated this gist (https://gist.github.com/aamax/5888361) with the error that i'm getting - which i am also getting when precompiling on my local dev box.
[21:54:52] aamax: the error refers to line 98 which is really line 24 in the gist
[22:09:04] micah`: aamax: kill the space between progid: and DX?
[22:11:30] aamax: micah` i don't know. i checked the history of the file. this hasn't changed but now it won't compile although i haven't tried to compile it locally before now. it did precompile on heroku without a problem before though. the error says something about (sass):98 where 98 is the line number. not sure if that is indicating something (sass). i went through and added semi-colons on the end of all the lines (there were a few that didn't
[22:11:30] aamax: have them) but it's still crapping out on me.
[22:12:17] aamax: i pulled the lines out (23 and 24) and it gives a different error Invalid CSS after ".eit-header:": expected pseudoclass or pseudoelement, was " hover {"
[22:12:32] aamax: which is the next css element being defined after this one
[22:13:14] iliketurtles: anyone know what the newest version of rspec that works with ruby 1.8.7 is?
[22:15:58] micah`: huh, aamax. something before eit-header not properly closed?
[22:17:05] aamax: micah`, must be but i don't see it (yet) and the fact still remains that this code hasn't been touched for some time. except for in the top of the file.guess i better look there before i get to set in that idea ;)
[22:17:18] micah`: iliketurtles: based on the travis-ci output, the latest is passing on 1.8.7...
[22:17:21] nikeita: which is the best practices to condition an output in a view based on user navigation…for example on the very same view i need to enable some buttons but not when i come from another path/route
[22:17:29] iliketurtles: micah`: thanks
[22:17:32] micah`: aamax: would csslint.net help? or is it sass? scss?
[22:17:54] aamax: it's the application.css file for my project :)
[22:18:19] micah`: straight up css then?
[22:18:35] aamax: micah`, yup. better be :)
[22:18:45] micah`: throw it in lint and see if something yells
[22:19:00] chelbs: Hey there - Anybody have any good resources on how to get Compass working with Rails 4?
[22:21:16] aamax: micah`, nothing jumps out. it notes some things but nothing major.
[22:21:24] aamax: and nothing around those lines
[22:22:25] aamax: micah`, 0 errors, 28 warnings ;)
[22:27:41] bricker_: chelbs: https://github.com/Compass/compass-rails/issues/89
[22:28:28] chelbs: bricker_: awesome thanks
[22:32:07] aamax: .eit-widget .eit-header .eit-toolbar button: :-moz-focus-inner {
[22:32:24] aamax: wtf is that (especially the button: : -moz-focus-inner)
[22:33:51] zeromodulus: Woot! My web app is starting to look really good.
[22:35:04] aamax: zeromodulus, cool.
[22:35:21] zeromodulus: I'm going to get it set up on my laptop so I can show employers.
[22:36:52] aamax: Woot! seems like my assets are now compiling. no idea why i had to do what i had to do to the css to get it to compile though. weird.
[22:38:20] aamax: had to remove a bunch of spaces between class identifiers and : hover or : action, added semi colons to all line ends, commented out the filter lines that were causing the one exception listed in my gist. not sure where that line came from or what it does but it's gone now.
[22:38:28] aamax: not sure what'll happen with it
[22:40:19] aamax: shit. it does fubar my page though.
[22:46:32] fulcan: gem install 'jquery-rails', '< 3.0.0' -> ERROR: Could not find a valid gem 'jquery-rails,' (>= 0) in any repository
[22:46:40] fulcan: couldn't find file 'jquery.ui.all' which is a known issue, I added *= require jquery.ui.all to application.css and //= require jquery.ui.all to application.js but still get the error. http://bpaste.net/show/1RqTDUte2XLBoj8fdTbf/
[22:57:50] pivotal: Radar: are you around?
[23:05:13] fulcan: couldn't find file 'jquery.ui.all' which is a known issue, I added *= require jquery.ui.all to application.css and //= require jquery.ui.all to application.js but still get the error. http://bpaste.net/show/1RqTDUte2XLBoj8fdTbf/
[23:16:27] aharris6: hi all, suggestions on how to get current url in a controller?
[23:16:49] aharris6: for use in bitly shortening
[23:16:53] aharris6: something like page_url = bitly.shorten(request.request_url)
[23:22:14] boytoy: Hi, is this the best way to block Tor IPs with Nginx? https://gist.github.com/kakekake89/5888836
[23:28:38] micah`: aharris6: if you can't use #url_for and just want a blind copy, request.full_path will get you pretty far
[23:28:51] micah`: chances are you'll need request.host too
[23:28:54] micah`: assuming rails > 3
[23:33:37] fulcan: couldn't find file 'jquery.ui.all' which is a known issue, I added *= require jquery.ui.all to application.css and //= require jquery.ui.all to application.js but still get the error. http://bpaste.net/show/1RqTDUte2XLBoj8fdTbf/
[23:36:03] aharris6: micah: request.full_path gives me:
[23:36:04] aharris6: undefined method `full_path'
[23:36:39] aharris6: micah`: https://gist.github.com/alexharris/0eb5ccff9222aa4fc525
[23:47:41] boytoy: I'm blocking Tor IPs with my OS and Nginx: https://gist.github.com/kakekake89/5888836 -- but is there a way to show /home/www/myapp/app/layouts/tor.html.erb to banned IPs via Rails?
[23:48:28] chelbs: boytoy: why do such a thing?
[23:49:09] boytoy: chelbs: If I can render tor.html.erb via Rails I can include translations and stuff
[23:49:21] boytoy: and render say google analytics partials
[23:49:39] boytoy: oh you mean why im blocking tor?
[23:49:42] chelbs: no - i mean why block
[23:49:57] boytoy: offensive, illegal images.
[23:50:17] boytoy: Threats. Shit talking.
[23:50:57] chelbs: Hmmm seems like a heavy handed approach. Can you ban individual users and the content they generate instead?
[23:51:17] chelbs: (just an idea)
[23:52:46] boytoy: chelbs: I do that too!
[23:52:58] chelbs: oh jez...
[23:53:28] chelbs: well a naive approach would be to filter on IP address http://stackoverflow.com/questions/3887943/ip-address-in-rails
[23:56:08] Radar: fulcan: please do not spam the chnanel
[23:56:36] superscott[8]: anybody know how to redirect_to from a nested controller to the parent controller? https://gist.github.com/superscott/5888997
[23:58:31] bratsche: superscott[8]: Do you have the resources defined in your routes file?
[23:58:52] superscott[8]: bratsche: just the resources :contacts
[23:59:07] bratsche: superscott[8]: If so hit 'rake routes' to see what the named path is and use contact_manager_contact_manager_path or whatever it's called.
[23:59:16] bratsche: That's faster than using hash paths the way you're doing there.
[23:59:27] bratsche: And it's more easily greppable if you need to refactor.