« Back to channel list

#RubyOnRails - 28 January 2015

« Back 1 day Forward 1 day »
[00:00:39] beauby: Guys, ActiveModel::Serializer seems to be dead, what's the prefered alternative?
[00:01:07] renegadeandy: Hi everyone - I have a runtime error : undefined method 'logo' for nil:NilClass - this is the associated files on gist : https://gist.github.com/anonymous/9ef4a36a0d128d5a7e41 Please help!
[00:04:07] cnk: renegadeandy: you need to say event.logo not @event.logo
[00:04:20] cnk: inside the loop your variable is event, not @events
[00:04:28] Pistos: smathy: executing the to_sql didn't seem to disable the caching.
[00:04:36] cnk: just like you have on line 26
[00:04:38] Pistos: Maybe it's MySQL-level caching going on here.
[00:04:40] renegadeandy: cnk: on dang! That is so obvious! Thanks for helping me see it haha
[00:04:58] cnk: typos are the worst to see yourself
[00:05:52] smathy: Pistos, the execute(blah.to_sql) will be quicker than the blah itself because you're not instantiating complex AR objects, just an array of hashes.
[00:06:21] smathy: Pistos, comparing subsequent runs of the same execute(blah.to_sql) you see a drop in the execution time?
[00:06:33] Pistos: smathy: Yes.
[00:07:19] Pistos: smathy: I'mma try this: http://stackoverflow.com/questions/12296193/rails-sql-no-cache-in-development-for-tuning
[00:07:38] smathy: Ok, not me.
[00:08:39] smathy: Oh, huh, I hadn't thought about the SQL engine itself caching.
[00:13:43] ivanskie: i just did a search on ruby on rails (google) in news... uhm one of the search results on the first page is something about medical marijuana lol. uhh
[00:20:25] cleopatra: any idea how should be a dynamic category, I mean when the form changes the category only show the children of that category
[00:21:09] ivanskie: sort of like how you select a country and it automatically changes the state/provinces box with relevant stuff?
[00:21:45] Scriptonaut: anyone know how to get the next nth day of the month (or next month if you're past it) in Chronic?
[00:22:09] Scriptonaut: like Chronic.parse("next 23th of month")
[00:22:25] Scriptonaut: I have a lisp
[00:23:05] nahtnam: I am trying to push to my dokku server, but I keep getting this error: https://gist.github.com/nahtnam/1e711d2137fa2cc311fe Note: Dokku is a self hosted heroku
[00:23:45] ivanskie: cleaopatra have you tried looking at http://guides.rubyonrails.org/form_helpers.html
[00:24:34] cleopatra: ivanskie, let me check it ill replay back
[00:25:52] cleopatra: i have do some similar that https://gist.github.com/anonymous/6bca4fc1af7e86bfa2bf
[00:27:02] ivanskie: i found this http://tiku.io/questions/459888/adding-a-value-dependent-data-attribute-to-a-simple-form-checkbox-collection you may be able to adopt it to your needs
[00:27:11] ivanskie: simple_form is a good gem to do this with.
[00:28:02] cleopatra: nice ill check
[00:32:52] smathy: Scriptonaut, def nth day; date = Date.today; diff = day - date.day; date + diff.days + ( diff < 0 ? 1.month : 0 ); end
[00:33:21] aaas: hello I'm trying to learn rails and go through a mooc course that uses rails. I notice that I have a method 'all_ratings' which is derived from my model 'Movie' wjocj has the attribute 'rating', my question is: i never explicitly defined this method, but I know that ruby/rails uses a technique to dynamically create these methods. What is this called if I wanted to read up more about this? metaprogramming? dynamic ____?
[00:34:07] smathy: aaas, the practice itself is called metaprogramming.
[00:34:35] aaas: smathy metaprogramming applied to Models in rails MVC?
[00:35:51] Scriptonaut: Thanks smathy, I was hoping for Chronic but I'm guessing i'll have to do it that way
[00:35:52] ivanskie: do you guys think this is worth it:? https://stacksocial.com/sales/ruby-on-rails-ninja-training?utm_source=stacksocial&utm_medium=social-twitter&utm_campaign=stukio_11915_4p
[00:36:05] aaas: I guess I'm wondering if theres a list I can gett as to what methods are created, I didn't know these 'all_*' methods were there until i ran into similar code
[00:36:06] smathy: aaas, well, if you're after what it is specifically in Rails then it depends, I'm not familiar with anything that adds all_ prefixes to attributes.
[00:36:19] ivanskie: I'm still reading the r4ia, and getting to the end, but im looking at expanding knowledge in future.. found this thing im like hmm
[00:36:28] aaas: ah ok...maybe im wrong
[00:36:48] smathy: aaas, it might be a gem that's adding them.
[00:36:55] smathy: aaas, anything can add methods to anything in ruby.
[00:37:11] aaas: ok thanks...ill look around maybe all_ratings was defined somewhere i missed
[00:37:34] Cork: is there a way to get has_one through, through another has_one through work?
[00:37:39] Cork: it always returns nil for me
[00:38:03] smathy: aaas, you're welcome.
[00:38:34] towski_: I have some capybara tests that flap trying to find css on the page when we run the whole test suite. Anyone have any advice for getting the tests to stop flapping
[00:38:34] smathy: Cork, no, they only do one jump.
[00:38:34] helpa: Cork: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[00:38:34] Radar: Cork: !code
[00:38:55] Cork: smathy: shoot... pity
[00:39:03] Cork: thx for the quick answer
[00:39:09] cleopatra: hello Radar, long time no see you :P
[00:39:15] Radar: hey cleopatra
[00:39:21] ivanskie: radar do you think this is worth it, or not reaally? https://stacksocial.com/sales/ruby-on-rails-ninja-training?utm_source=stacksocial&utm_medium=social-twitter&utm_campaign=stukio_11915_4p
[00:39:31] aaas: smathy sorry for the noise it looks like it was defined in the model after all *hits head* sorry
[00:39:32] Radar: ivanskie: Get through R4IA first :)
[00:39:36] smathy: Cork, there are many discussions about it in various places, it gets very difficult to do it reliably with all the other stuff in Rails.
[00:39:46] smathy: aaas, np :)
[00:40:10] Cork: smathy: i've been searching about it for hours and found absolutely zero hits :/
[00:40:15] ivanskie: well im on ch8 now. had time to continue at work, but realized I haven't done a git push yet. in the ch8 so stuff i've already worked on.. isnt updated in repo. argh :(
[00:40:19] ivanskie: didn't bring me laptop lol
[00:40:37] smathy: Cork, generally the discussion happens in here, or on the *-core mailing list.
[00:41:17] smathy: towski_, can you be more technical than "flap"?
[00:41:18] cleopatra: Radar, these days I will continue reading ria4 I'm just in chapter 4 and I learned some techniques
[00:41:34] Radar: ivanskie: Just start again :P
[00:41:45] towski_: what is the technical term for a test that fails and succeeds for no reason
[00:41:55] ivanskie: lol i guess.. but im off in 15.
[00:41:59] centrx: Heisenbug
[00:42:07] towski_: but it's not a bug in the code
[00:42:17] ivanskie: i'll just bring my laptop nexttime. kinda slow at work
[00:42:21] centrx: experimental heisenbug
[00:42:42] ivanskie: where do you guys read whats the latest with rails kind of stuff?
[00:42:55] ivanskie: just twitter? or.. don't read at all? just curious
[00:43:01] centrx: check the topic
[00:43:07] Radar: I wake up just knowing
[00:43:36] nahtnam: I am trying to push to my dokku server, but I keep getting this error: https://gist.github.com/nahtnam/1e711d2137fa2cc311fe Note: Dokku is a self hosted heroku
[00:43:46] ivanskie: i dont mean what the latest rails release is. i'm talking about what people are talking about, rails news stuff
[00:43:47] sevenseacat: like, ruby-weekly type stuff?
[00:43:53] nahtnam: I can give my gemfile and lock if you need it
[00:44:06] sevenseacat: from ruby weekly :P
[00:44:12] ivanskie: subscribing.
[00:44:18] ivanskie: didn't know that existed lol
[00:44:58] cnk: Ruby 5 podcast used to be the go to place for me - but haven???t listened in ages
[00:45:26] towski_: if no one likes the word flap then we should pick a new word
[00:45:35] towski_: alternate?
[00:46:46] towski_: thoughtbot says flap
[00:47:00] towski_: so shut your flap
[00:47:02] ivanskie: whats wrong with flap?
[00:47:13] ivanskie: its not like its missing the l there
[00:47:20] towski_: well it is vaguely... insinuating
[00:47:26] bricker: towski_: flap means something different
[00:47:47] towski_: http://robots.thoughtbot.com/write-reliable-asynchronous-integration-tests-with-capybara
[00:47:51] towski_: not to thoughtbot it doesn't
[00:47:57] louism2wash: hey guys, is there any reason not to use the ApplicationController for stuff like your home page?
[00:47:58] towski_: "capybara" .... "flapping"
[00:47:58] ivanskie: there is some technical terms liks flapping actually too
[00:48:06] ivanskie: network flapping
[00:48:09] bricker: towski_: I think of "flap" as something being infinitely and rapidly changing between two states
[00:48:30] ivanskie: like the duck call thing
[00:48:42] ivanskie: it flaps at high frequency
[00:49:10] ivanskie: so its not insinuating anything at all.
[00:49:13] smathy: nahtnam, did you commit your Gemfile.lock ?
[00:49:25] nahtnam: smathy, Yeah. Its showing up on github.
[00:49:31] Radar: louism2wash: !8ball
[00:49:41] towski_: well it flaps with the frequency build/2
[00:50:02] bricker: Or if you have a service which monitors your app, and your app goes down because of a startup error, your monitoring service will be going DOWN UP DOWN UP DOWN UP forever. So you also have a "flapping" condition, like "if this process is flapping, quit and notify" or something.
[00:50:46] ivanskie: looking at ruby-weekly.. interesting stuff
[00:50:51] ivanskie: ruby-weekly archives*
[00:51:02] smathy: nahtnam, and you're sure that's what's being deployed?
[00:51:13] smathy: nahtnam, gist it along with your Gemfile.
[00:51:27] louism2wash: Radar: is that you telling me that it's a stupid question or what?
[00:52:42] Radar: louism2wash: If you define an index action in ApplicationController, what do you think happens to all the controllers which inherit from there?
[00:52:48] nahtnam: smathy, Yes, I tried pushing to my server, it failed so I pushed the exact same code to github and saw that the gemfile was indeed included. https://gist.github.com/nahtnam/188a5f35f3d89014a00a
[00:56:04] louism2wash: Radar: it will route get requests at any of your base controller names to the index action in ApplicationController
[00:56:21] Radar: louism2wash: yup
[00:56:26] Radar: louism2wash: personally I wouldn't do it
[01:01:23] smathy: nahtnam, dunno, if you're sure that's the same Gemfile.lock (and Gemfile) that's being deployed, there's nothing wrong.
[01:01:36] smathy: nahtnam, you can try yourself locally by running `bundle --deployment`
[01:03:37] smathy: nahtnam, (remove .bundle/config after you've done that)
[01:05:33] nahtnam: smathy, It ran successfully on my computer
[01:05:55] smathy: nahtnam, everything points to that not being the same Gemfile and/or Gemfile.lock that's being deployed.
[01:06:09] towski_: rails routing is having trouble with my controller SNSEndpointsController
[01:06:12] towski_: post 'sns_endpoints', to: 'sns_endpoints#create', controller: 'SNSEndpoints'
[01:06:23] towski_: fails with cannot find SnsEndpointsController
[01:07:48] sevenseacat: because the capitalization is funky
[01:08:23] nahtnam: smathy, im going to force push onto my server
[01:08:30] sevenseacat: famous last words
[01:08:42] towski_: yeah the class is SNSEndpoint, and the product is Amazon SNS
[01:09:07] sevenseacat: so its actually s_n_s_endpoints#create
[01:09:22] sevenseacat: and i hope its in a file called s_n_s_endpoints_controller.rb
[01:09:29] sevenseacat: otherwise, change it to Sns
[01:09:51] nahtnam: smathy, Nope, still the same error. When I push to github, it says everything is up to date.
[01:10:20] smathy: nahtnam, sorry, out of ideas.
[01:10:31] nahtnam: smathy, Kk. Thanks for trying to help.
[01:10:45] Pistos: smathy: Hm. So I turned on Mysql query time logging, and it turns out that nothing that hits the database is taking more than 7 or 8 milliseconds. So the slowness is rails-side.
[01:11:12] smathy: towski_, the :controller option should be the directory/filename-style name, not the class-style.
[01:11:31] smathy: Pistos, right, Rails does a lot with a large data set.
[01:11:44] towski_: yeah I'm not going to do s_n_s_controller so I'll just go with SnsController
[01:12:07] smathy: I thought they'd fixed that btw.
[01:17:04] Pistos: smathy: Using .first doesn't seem to help any.
[01:17:36] Kwu42: hey guys I have a question. If I have a database with say 5 tables, should I make 5 controllers, one for each table? Or can I make one controller for the all of the tables
[01:17:38] bricker: Pistos: slowness is probably template rending
[01:17:41] bricker: Pistos: it usually is
[01:17:44] bricker: rendering*
[01:17:48] pipework: Or making queries in the views.
[01:18:34] pipework: That can be slow if rendering multiple partials and making one or more queries for each partial rendered.
[01:18:47] Kwu42: When I look at the naming conventions for controllers/models it seems I should make one controller for each table but I'm not really sure
[01:19:15] pipework: Kwu42: Nope. You make one for each resource you want to expose.
[01:19:16] Pistos: bricker: Page rendering isn't involved at all in this case.
[01:19:23] Pistos: (It's a Sidekiq job)
[01:20:58] Kwu42: okay thanks
[01:21:05] smathy: Kwu42, until you know what you're doing, make a controller per model.
[01:22:05] Kwu42: got it. thanks for your help
[01:25:14] smathy: Pistos, how many records are you talking about?
[01:28:32] Pistos: smathy: I'm not sure exactly at the moment, but it should be in the tens.
[01:28:45] Pistos: The query may need to scour a few hundred thousand candidates, though.
[01:28:54] Pistos: Still narrowing down details.
[01:29:16] smathy: Pistos, ok.
[01:44:13] bricker: Pistos: So your job just takes a long time to run? Can you show the code?
[01:46:17] Pistos: bricker: I can't really. But I can show minimized similar examples as I work through this.
[01:47:11] Pistos: bricker: One problem I'm trying to solve is when I try to run a little script that times things, the first run is super slow, and the second run is super fast.
[01:47:38] Pistos: bricker: smathy and others have been trying to help me either disable caching, or whatever is needed to make the first and second run take the same amount of time.
[01:47:48] Pistos: (so I can test and tweak properly)
[01:49:18] volk_: hey guys i just rezlied im a little iffy on a simple thing ??? my app has a user (logged in ) and other users. if i wanna perform an action on myself given im logged in, then the route should probably be /user/ without taking an :id right? and inside the controller i make sure im logged in properly
[01:49:49] volk_: but say i want to see the profile of another users so it would be users/:id kind of endpoint which would mean i would need a UserController and a UsersController ??? no?
[01:50:28] braidn: why not users/:id volk_ ?
[01:50:50] volk_: well if its me, and im logged in, all i should be able to do is just current_user.update_attributes (for example) right?
[01:50:54] volk_: why pass in my ID again
[01:50:57] volk_: seems redundant no?
[01:51:05] volk_: or is that bad practice
[01:51:10] volk_: not passing in ID for yourself
[01:52:07] volk_: braidn: ^
[01:52:13] rhizome: you can still act on current user if you're at #show with an id
[01:52:22] rhizome: update or whatever
[01:52:41] braidn: Yeah...because you are the current_user at the moment
[01:52:42] rhizome: it also prevents people from updating others' stuff
[01:53:24] volk_: rhizome: no i agree???but why do i need to do things at that endpoint in the first place where i already have the ID, or ist he better practice to check if current_user exists, do stuff on self, else do stuff on someone else?
[01:53:38] volk_: meaning...
[01:54:10] volk_: if i have the current_user already , why be doing things in show action inside of a ???UserController??? that takes in an id on a logged in user, seems that logic should be in a different controller
[01:54:13] volk_: where ID doesnt get passed
[01:54:27] rhizome: i don't understand
[01:54:59] volk_: alright im doped on a lot of coffee, let me see if i can slow down and try to explain this properly
[01:55:12] renegadeandy: Hi everyone, I have twitter bootstrap as part of my Ruby on rails project. I want to use a alert alert-error css class on a div, to show a message to myusers. When I try i get the following result : http://postimg.org/image/60ueohqwh/ I would expect this result : http://s9.postimg.org/gpz6m6lof/Screen_Shot_2015_01_28_at_01_52_20.png This is the code I am using : https://gist.github.com/anonymous/4d0f7c4954ecd75303e4 and ot
[01:56:15] volk_: if i have a UserController with an update action (route being PUT to /user/:id ) , and im doing currrent_user.update_attribute without dealing with the actual ???:id??? part of the route, shouldnt that logic (where you update attributes on the logged in user) be in a UsersController instead (plural) where the route would be /PUT to /user/ )
[01:56:22] volk_: rhizome: ^
[01:56:27] ivanskie: im getting towards the end of chapter 8.. aand looks like im missing one scope.
[01:56:53] ivanskie: book says rspec has 40 examples..
[01:56:55] ivanskie: mine has 39
[01:57:07] rhizome: volk_: you can ignore the id, or redirect if current_user.id isn't the same as the posted id
[01:57:19] weaksauce: gist the full output html of your page renegadeandy
[01:57:19] ivanskie: everything passes.. buttt ? and i have no idea how im missing one lol
[01:57:36] x-light: ivanskie: I did find that in some areas
[01:57:49] x-light: ivanskie: whats the line number you've got
[01:58:02] braidn: volk_ also current_user usually, sometimes, maybe get's created in a helper. So this is available generally everywhere
[01:58:04] ivanskie: line number of what
[01:58:08] renegadeandy: weaksauce: https://gist.github.com/anonymous/7f69447ca69786c17c48
[01:58:21] volk_: okay thanks guys
[01:58:35] x-light: ivanskie: where you start getting the miscount in tests
[01:58:42] x-light: ivanskie: or just the chapter/section will do
[01:58:50] ivanskie: ah one sec, my book's rendered in html i'll have to find it. one sec
[01:59:15] ivanskie: ch08 x-light 1069
[01:59:50] weaksauce: renegadeandy where did you get the idea that alert was a valid class for bootstrap? use one of these: http://getbootstrap.com/css/#helper-classes
[02:00:26] weaksauce: bg-danger would be the closest match
[02:00:43] ivanskie: x-light i think it may have started from previous git commit, for line 801
[02:01:01] braidn: https://38.media.tumblr.com/cc0f3dddb74cf5098b60f9517bb7acb6/tumblr_mq5j0xh6D11sue4jko1_500.gif
[02:01:17] renegadeandy: weaksauce: :O http://www.paulund.co.uk/twitter-bootstrap-alert-boxes ?!?!??
[02:02:11] braidn: Bootstrap docs?
[02:03:29] ivanskie: hm im not close to end of chapter 8 yet. anyway..
[02:04:12] x-light: ivanskie: 1069 is only about 25% thru
[02:04:25] ivanskie: yeah. well its alright.
[02:04:29] x-light: ivanskie: if you're using ch08.ad that is
[02:04:43] ivanskie: yeah i think im on the latest
[02:04:58] ivanskie: only 8.2.1 lol
[02:05:08] weaksauce: i see. renegadeandy you should look at the bootstrap docs though
[02:05:25] ivanskie: x-light its alright, im planning on finishing it tonight
[02:05:38] ivanskie: still have about 4-5 hours before going to bed
[02:06:05] ivanskie: so if i dont finish ch8 within that time.. something else must have happened lol
[02:06:29] ivanskie: kinda wish i didn't break my 4 day streak on github tho :( argh oh well
[02:06:38] x-light: ivanskie: cool. no worries. I think sevenseact and radar were going to do a full count up at the end anyway.. to make sure alll those numbers add up
[02:07:16] x-light: hey sevenseacat
[02:09:06] ivanskie: im just looking in project_policy_spec.rb can't we dry it up by doing a before do block with creating project and user? (let!(:user ..... etc
[02:09:19] cleopatra: good morning sevenseacat :P
[02:09:38] renegadeandy: weaksauce: i had no idea those were not real classes, i assumed after reading the article on bootstrap css they were!
[02:09:52] sevenseacat: ivanskie: more context required
[02:10:20] weaksauce: renegadeandy they probably were at some point in time. a lot of web frameworks are a ok with breaking compatibility... see rails
[02:10:31] renegadeandy: weaksauce: hahahah!
[02:10:31] ivanskie: https://gist.github.com/i5okie/5f46ed10ad9660af5ad6
[02:11:02] renegadeandy: weaksauce: doesnt that make upgrading really terribly painful?
[02:11:03] sevenseacat: that policy gets refactored later on.
[02:11:20] ivanskie: ah alright, i figured that it wouldn't work that way. but alright i'll hang on :)
[02:11:36] sevenseacat: wouldnt work what way?
[02:12:09] weaksauce: renegadeandy it can. but you do it locally and then make it work and then push to production when it's all good. coupled with revision control makes it less of an issue.
[02:12:45] ivanskie: well for example in the permissions :show? block we do let!(:user).... and in permissions :update? block we're doing let without the bang
[02:12:50] renegadeandy: weaksauce: yeah, true, just been badly stung in the past with things like dojo
[02:13:36] sevenseacat: ivanskie: i think you've mistyped something somewhere, you have two identical specs there
[02:14:26] ivanskie: sevenseacat no dont think so.
[02:14:41] sevenseacat: hmm nope, I wrote dumb code in the book
[02:14:46] ivanskie: context ".scope" was added in previous section
[02:14:57] ivanskie: well it works.. so far.. lol
[02:15:15] ivanskie: it doesn't look right. but works
[02:15:44] weaksauce: renegadeandy they actually don't break too much between versions of rails
[02:16:58] renegadeandy: weaksauce: thats good to know! :) thanks for helping again
[02:48:30] Cat_1: Anyone around?
[02:49:15] helpa: Weren't you listening, I said 'kree'!
[02:49:23] Radar: Cat_1: What's up?
[02:50:40] Gargincin: so I have an asset in app/assets/ge_assets/css
[02:50:46] Gargincin: how can I link to that in my html.erb files
[02:50:50] Radar: why is it at ge_assets?
[02:50:54] sevenseacat: with great difficulty
[02:50:56] Radar: and not app/assets/stylesheets?
[02:50:56] Gargincin: for a custom feature
[02:51:02] helpa: Gargincin: http://guides.rubyonrails.org/asset_pipeline.html - The Asset Pipeline Guide by Ryan Bigg, Richard Hulse & Mohammad Typaldos
[02:51:02] Radar: Gargincin: !assets
[02:51:11] Gargincin: doesn't help
[02:51:14] Gargincin: read it today already
[02:51:31] Radar: Ok, good to see that you know then that CSS code goes into app/assets/stylesheets and you're about to move it.
[02:51:32] helpa: Next question, please!
[02:51:33] renegadeandy: Looking for a hand everyone! I have a Controller and View called search(I dont have a model for it, not sure why...). From view A i want to be able to invoke the search function but I am getting an error, all info is posted in this gist - index.html,erb is what is calling the search. :https://gist.github.com/anonymous/ff7108b29c4ba91f58e9
[02:51:48] Gargincin: I have 138 css files, is there any other way?
[02:51:54] Gargincin: Its a big production site im migrating to rails
[02:52:12] Radar: Gargincin: Third time's a charm: move it to app/assets/stylesheets.
[02:52:12] sevenseacat: so do it properly
[02:52:18] sevenseacat: dont hack it to get it working
[02:52:21] Cat_1: https://gist.github.com/ccuadrado/8ba5705ad8f0cc606dbd
[02:52:37] Cat_1: Can someone help me figure out why my guard won't exec my capybara tests when I run all specs and only when I edit/modify the file?
[02:52:38] sevenseacat: today is a extra-caffeine day
[02:52:47] Gargincin: fine I'll give it a shot
[02:52:53] Radar: Gargincin: Thank you for listening.
[02:52:59] Gargincin: Hey Radar, you have a blog right?
[02:53:03] Radar: Gargincin: ryanbigg.com
[02:53:12] Gargincin: haha funny I guessed that
[02:53:15] sevenseacat: he's like, internet famous.
[02:53:18] Gargincin: I read your multitenancy book
[02:53:27] Radar: I'm Bigg everywhere.
[02:53:45] Radar: Gargincin: Oh yeah? what did you think of it?
[02:54:14] Gargincin: I liked that you walked through the whole app, but I think you used some non conventional methods and it seemed very opinionated
[02:54:24] sevenseacat: rails is very opinionated.
[02:54:40] sevenseacat: as are most developers
[02:54:49] Gargincin: I was hoping it was devise basically
[02:54:51] Radar: Gargincin: Yup, it's a book about how I think Multitenancy with Rails should be done. I'm very open to hearing how to do it better.
[02:55:51] Gargincin: I have one thing that would have helped
[02:56:05] Gargincin: if you would include the source at checkpoints so if someone missed a step they could cross analyze
[02:56:12] renegadeandy: is there anyone who can take a quick look at my question above? I would love to fix this and go sleep!
[02:56:23] Radar: Gargincin: Like this? https://github.com/radar/saas_book_examples/commits/master
[02:56:36] Radar: Maybe I don't make that clear enough in the book.
[02:56:39] Gargincin: that woulda been a lifesaver had I known :)
[02:56:55] Radar: Gargincin: You're not the one who got the refund because they couldn't find that repo, are you?
[02:57:10] Gargincin: haha no I still have your book :)
[02:57:16] Cat_1: andy: where's your routes.rb file?
[02:57:26] Radar: It's the 2nd time this week that I've heard people couldn't find the source
[02:57:50] Gargincin: Where was it listed in the book?
[02:57:50] renegadeandy: Cat_1: apologies i missed that : https://gist.github.com/anonymous/248a6678d19bf80df66c
[02:57:51] jimbauds: I was aware of this repos! :)
[02:58:01] Gargincin: I'd list it chapter one, people have short attention spans
[02:58:01] Radar: Gargincin: In the introduction.
[02:58:03] sevenseacat: i loved the two refund reasons you had, one because it wasnt advanced anough, one because it was too advanced
[02:58:11] Radar: sevenseacat: yeah :D
[02:58:15] jimbauds: it's written in the book.
[02:58:16] Radar: Gargincin: I'll put it there too.
[02:58:30] Cat_1: why do you have a search/search GET route?
[02:58:34] Cat_1: why isn't it just /search?
[02:58:49] Radar: Actually might be better to go in ch2.
[02:58:50] renegadeandy: maybe i am confused by how the routes file worked...
[02:58:56] renegadeandy: thought it was controller action
[02:59:38] renegadeandy: Cat_1: /search wouldnt work anywya?
[03:00:04] Cat_1: it can be al ot of things
[03:00:44] renegadeandy: Cat_1: well if i try get '/search' i get the error : Missing :action key on routes definition, please check your routes.
[03:00:54] Radar: renegadeandy: You need to point that at an action
[03:00:55] helpa: renegadeandy: http://guides.rubyonrails.org/routing.html
[03:00:55] Radar: renegadeandy: !routes
[03:01:09] renegadeandy: thats what i was trying oto say!
[03:01:12] Cat_1: Right, but do you have a corresponding search action in your search controller?
[03:01:17] renegadeandy: my action is in the controller, search
[03:01:40] renegadeandy: see in my gist post
[03:03:34] renegadeandy: Cat_1: https://gist.github.com/anonymous/ff7108b29c4ba91f58e9
[03:03:57] Cat_1: then it should be "search#search"
[03:03:57] Gargincin: should I put LESS files in the same directory as standard CSS
[03:03:59] Cat_1: not search/search
[03:04:05] jimbauds: renegadeandy: line 12 your indentation is not correct
[03:04:15] renegadeandy: jimbauds: in what file?
[03:04:32] jimbauds: get '/search', :to => 'search#search'
[03:04:37] Cat_1: in fact you should probably have that for all your routes
[03:04:40] sevenseacat: Gargincin: thats fine.
[03:04:49] jimbauds: renegadeandy: routes.rb
[03:04:54] renegadeandy: whats the difference between search/search and search#search?
[03:05:00] renegadeandy: how do i read search/search?
[03:05:04] Radar: renegadeandy: In what context?
[03:05:13] Radar: renegadeandy: Show us a full line of code containing search/searc
[03:05:22] renegadeandy: get 'search/search'
[03:05:30] sevenseacat: thats the URL
[03:05:36] Cat_1: that's the URL
[03:05:38] Cat_1: not the route mapping
[03:05:40] Cat_1: I commented on the GIST
[03:05:41] Radar: And will probably route to SearchController#search
[03:05:42] Cat_1: take a look
[03:05:44] sevenseacat: eg. foo.com/search/search
[03:05:48] Radar: Routing guide should explain.
[03:06:19] Cat_1: it really should be
[03:06:21] Cat_1: search#index
[03:06:23] Cat_1: if you want to remain restful
[03:06:38] Radar: ACTION avoids getting into semantics about what is actually getting searched on
[03:06:39] Cat_1: and if you are going to perform a search it should be POST search#search
[03:06:53] renegadeandy: Well with get 'search#search' i am getting : Missing :controller key on routes definition, please check your routes.
[03:06:54] Cat_1: Now if someone can help me figure out my guardfile that'd be great :)
[03:07:09] Radar: Cat_1: Step 1) Stop using Guard. Step 2) Use Spring/Zeus
[03:07:19] Cat_1: Boo I liked Guard
[03:07:37] Cat_1: What's the difference between Spring/Zeus?
[03:07:44] Radar: Not much.
[03:07:45] Radar: renegadeandy: http://guides.rubyonrails.org/routing.html#connecting-urls-to-code
[03:07:50] Radar: renegadeandy: Literally 1.1 in that guide.
[03:07:55] jimbauds: renegadeandy: You need to have a controller named search witn an action named search in it
[03:08:11] Radar: renegadeandy: In most cases you need to define a route which has a verb, which is the method name, then a URL, then where that goes to
[03:08:18] jimbauds: renegadeandy: look at that guide Radar showed you
[03:08:21] sevenseacat: Radar: i disline both of those rules D:
[03:08:21] Cat_1: rather, it should be SearchController class
[03:08:28] sevenseacat: i like guard and despise spring
[03:08:39] renegadeandy: i have one of those jimbauds Radar https://gist.github.com/anonymous/3f9851672c7d7204a69b
[03:08:41] Radar: sevenseacat: I've been using Spring a lot recently and I like it
[03:08:51] sevenseacat: ACTION is making scrunched-up faces
[03:08:53] Radar: renegadeandy: that's fine. That's not the problem. Show us your routes.rb.
[03:09:02] Radar: sevenseacat: why don't you like it?
[03:09:06] jimbauds: renegadeandy: do you have the corresponding view?
[03:09:16] renegadeandy: jimbauds: yes...
[03:09:41] sevenseacat: Radar: because it caches things it shouldnt, so many problems here are solved by restarting spring because its stuffed up again
[03:09:42] renegadeandy: Radar: https://gist.github.com/anonymous/88b1ced7127197ee1517
[03:09:42] Cat_1: He did show the routes.rb file
[03:09:45] Cat_1: a while ago
[03:09:54] Radar: renegadeandy: https://gist.github.com/anonymous/88b1ced7127197ee1517#file-gistfile1-txt-L12 This is wrong
[03:09:59] sevenseacat: code looks 100% fine, yep restarted server.... oh forgot to restart spring too
[03:10:04] Radar: renegadeandy: do get '/search', to: 'search#search'
[03:10:15] Radar: sevenseacat: Just remember to restart spring :P
[03:10:18] jimbauds: renegadeandy: line 12 not good I think
[03:10:21] Gargincin: are there any tools for migrating an existing site to rails?
[03:10:26] Gargincin: HTML/CSS/JS site
[03:10:43] sevenseacat: Radar: thats like 'just remember to db:test:prepare' and we got rid of that
[03:10:49] Cat_1: @Gargincin - Vim and big pot of coffee :)
[03:10:56] jimbauds: renegadeandy: should be get '/search', :to => 'search#search'
[03:11:49] Radar: jimbauds: that's what I just said :P
[03:11:57] renegadeandy: Radar jimbauds Cat_1 ahh ok, got it. Thats confusing. RoR does some magic, and you follow tutorials, read about stuff, but it doesnt actually make sense until you try to do something more compliocated and stumble your way around for a while. Thanks also to weaksauce
[03:12:55] jimbauds: Radar: haha! Yeah but I said it first look at the log :P haha!
[03:13:32] Radar: jimbauds: ok: http://logs.ryanbigg.com/RubyOnRails?date=2015-01-28#2820977
[03:13:48] renegadeandy: how do I get access to the http get variables in the controller : search?utf8=???&q=ijiji&commit=Search >
[03:13:58] Radar: renegadeandy: params
[03:14:21] Radar: renegadeandy: Have you gone through the Getting Started guide yet>
[03:14:44] Radar: Gargincin: btw a new update of MTWR is going out Real Soon Now(tm) that will link to the code in the intro to ch2. Thanks for pointing that out.
[03:15:06] renegadeandy: Radar: yes! but I have not yet managed to store a massive stack of text in a quickly indexible brain, i am still implementing ctrl f
[03:15:22] jimbauds: Radar: at 3:04:32 i was saying the same thing anyway ! Peace!
[03:15:26] Radar: jimbauds: :)(
[03:15:52] Radar: jimbauds: true
[03:18:09] Gargincin: That would be awesome Radar. Less people would probably miss it
[03:21:31] renegadeandy: Apparantly there is something wrong with line 12 in this code : https://gist.github.com/anonymous/82fcc3fcd609014421e7 But I dont see it?
[03:22:03] sevenseacat: yeah, a missing end
[03:22:17] sevenseacat: if your indentation was right, it would be easier to see
[03:22:34] renegadeandy: does an if statement need an end in ruby?
[03:22:55] renegadeandy: god....and am i not allowed to use {} to separate my if and else blocks?!
[03:22:56] sevenseacat: we also dont do semicolons at the end of statements in ruby
[03:23:10] renegadeandy: scarily close to python...
[03:23:23] sevenseacat: except whitespace isnt significant
[03:23:43] jimbauds: renegadeandy: you came from python?
[03:23:55] renegadeandy: but ive had a run in with python
[03:24:22] jimbauds: renegadeandy: I meant the programming language
[03:24:58] renegadeandy: jimbauds: yes....I came from Java, but I have used Python
[03:25:01] jimbauds: renegadeandy: ok yeah java {} everywhere but in ruby it's always def end. Functions are Methods byt the way!
[03:25:42] m3chanical: and you can assign classes to variables, yeah?
[03:27:17] helpa: m3chanical: Why don't you try it and find out for yourself?
[03:27:17] Radar: m3chanical: !try
[03:27:28] renegadeandy: m3chanical: ,,,in Java? Its more Variables are instances of classes
[03:27:31] Radar: functions are methods which are objects
[03:27:43] jimbauds: renegadeandy: In ruby EVERYTHING is an object. Remember this. Ok I will stop. This is a Rails Channel!
[03:28:04] renegadeandy: jimbauds: is my if statement an object?
[03:28:19] renegadeandy: jimbauds: can i pass my if staement into another function?
[03:28:22] m3chanical: i'll definitely tinker. i've been spending a bunch of time lately on C. getting back into learning Rails presently.
[03:28:24] Radar: renegadeandy: nope
[03:28:32] Gargincin: so in my index page I am trying to link to a javascript in my public folder. The script is a script that can be called by another server so I don't want it in /javascripts
[03:28:33] renegadeandy: EVERYTHING ;)
[03:28:41] Gargincin: I'm linking to it like this <script src="app/js/services.js"> but it not working
[03:28:48] Gargincin: its in public/app/js/services.js
[03:28:52] Radar: Gargincin: /app/js/services.js
[03:29:02] Radar: missing first /
[03:29:11] renegadeandy: isnt it app/assets/javascripts
[03:29:34] jimbauds: renegadeandy: Ok maybe not everything but :)
[03:29:49] renegadeandy: jimbauds: i get it, thank you - useful to have a comparison
[03:29:52] Gargincin: no this is a script i use from another server
[03:30:00] Gargincin: passes traffic data
[03:30:15] sevenseacat: very little should go in public/, if anything
[03:30:37] Radar: Gargincin: Does it work with the initial slash?
[03:30:52] Gargincin: hmm not yet
[03:30:55] renegadeandy: right im off to bed - THANKS FOR THE HELP! I will recap the getting started and no doubt you will see a lot more of me in the coming months!
[03:31:40] m3chanical: quick noob question, when i execute 'gem update' in a rails project folder i get a bunch of syntax errors but no indication of the file. ... which file do i look in to rectify that?
[03:32:00] sevenseacat: depends on the errors
[03:32:06] sevenseacat: woo, down to 51 failing specs
[03:32:38] m3chanical: i'll post the errors and give a URL presently
[03:33:28] m3chanical: https://gist.github.com/m3chanical/3100816c1481dab95c34
[03:33:40] m3chanical: it's probably pretty simple, i just don't know where to look
[03:33:55] sevenseacat: what on earth
[03:34:13] sevenseacat: i think your rvm just had kittens
[03:34:46] m3chanical: ooh. i love kittens
[03:35:19] jimbauds: m3chanical: rvm get stable
[03:35:23] m3chanical: i downloaded a rails project from github that i wanted to tinker on so i was updated the gems
[03:35:56] sevenseacat: that doesnt seem wise, and `gem update` is also not how you do that
[03:36:11] jimbauds: m3chanical: update rvm and retry
[03:36:43] jimbauds: m3chanical: heh .. ok sry I think I miss something
[03:36:49] jimbauds: m3chanical: :(
[03:37:46] xcesariox: where do i put this "results = Book.collection.map_reduce(map, reduce, out: "vr")" command syntax into? into rails console or mongodb console directly? https://gist.github.com/shaunstanislaus/0f8d87939c0ab01ce5d6
[03:38:17] sevenseacat: xcesariox: https://gist.github.com/shaunstanislaus/0f8d87939c0ab01ce5d6#file-gistfile1-txt-L1 its a rails console.
[03:38:27] m3chanical: this project is about 2 years old so i'm guessing a lot of it is super out of date. i was just hoping to run 'rails server' and see how it works
[03:38:28] Gargincin: aha! getting somewhere with this
[03:38:48] sevenseacat: m3chanical: right, whats that got to do with `gem update`
[03:39:02] jimbauds: m3chanical: clone the project after do bundle install, be sure to the right ruby version
[03:39:20] jimbauds: ok i'm going to sleep :P
[03:40:39] jimbauds: my english is so bad right now! sry! a+
[03:40:43] Gargincin: so whats the technical reason as not to put your code in /public?
[03:40:53] Gargincin: I assume people could steal it regardless of location
[03:41:34] m3chanical: good question: "what's that got to do with 'gem update' " heh
[03:41:50] m3chanical: bundle install fails, won't install pg. i'm *probably* using the wrong rails version for this project
[03:42:07] jimbauds: m3chanical: no you are missing the lib
[03:42:22] jimbauds: m3chanical: for postgres
[03:42:26] Gargincin: gem 'pg' -> bundle install
[03:42:28] jimbauds: m3chanical: I think
[03:42:33] Gargincin: and than you need to edit database.yml with login
[03:43:06] Gargincin: if it gives you an error "not configured" open cmd line and type psql and --help set up new user
[03:43:35] m3chanical: oh derp. i'm missing libpq-fe.h header. off to search
[03:43:45] xcesariox: sevenseacat: so i should enter that command into rails console?
[03:44:06] jimbauds: m3chanical: sudo apt-get install libpq-dev
[03:44:23] sevenseacat: xcesariox: the gist is a copy and paste of a rails console log.
[03:44:41] m3chanical: thanks jimbauds! i'm actually on centos though, so it looks like i have to use yum install postgresql-devel
[03:46:05] jimbauds: jimbauds: yeah something like that. I use Debian based system.
[03:46:42] jimbauds: m3chanical: my last msg (at myself) was for you! lol
[03:47:06] m3chanical: i'm still getting all those wonky syntax errors though. it doesn't seem to be causing failure though. weirdo ruby
[03:47:27] sevenseacat: its not ruby, its rvm.
[03:47:56] m3chanical: oh okay, sorry: weirdo rvm. of course, i'm sure at this point i'm the weirdo. once i learn better i doubt it will seem so foreign
[03:48:12] sevenseacat: no, the error is pretty dumb, and not anything you did.
[03:48:23] m3chanical: ah, well that's refreshing
[03:50:07] m3chanical: also, the help is much appreciated jimbauds, sevenseacat
[03:50:47] jimbauds: sevenseacat: Do you have a suggestion about how to install ruby? Which tools?
[03:50:53] helpa: Ubuntu, Ruby, ruby-install, chruby, Rails setup guide: http://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you/ - Gauranteed to work 100% of the time or your money back!
[03:51:12] sevenseacat: works for debian as well, and only a couple tweaks needed for fedora.
[03:51:38] jimbauds: sevenseacat: thank you
[03:55:00] ivanskie: sevenseacat im at end of 8.3.2 but my editing_tickets_spec is failing now. wasn't before...
[03:55:07] sevenseacat: good to know.
[03:57:19] ivanskie: the ticket_policy_spec is passing. but book says everything should pass
[03:57:45] sevenseacat: also good to know.
[03:57:53] sevenseacat: do you have anything i can actually assist with?
[03:57:59] sevenseacat: or are you just telling me that its broken
[03:58:19] ivanskie: well its broken. and i want you to fix it! :p
[03:58:39] sevenseacat: don't be a dick.
[03:58:40] ivanskie: one sec let mething what would be useful to gist
[03:58:41] jimbauds: ivanskie: don't do that ..
[03:58:45] ivanskie: i dont mean to, being cheeky
[03:59:25] xcesariox: sevenseacat: i know its a rails console log
[03:59:41] xcesariox: sevenseacat: my question is, should i enter this command results = Book.collection.map_reduce(map, reduce, out: "vr")" into rails console or mongo console
[04:00:05] sevenseacat: well is it valid ruby code or valid mongodb code
[04:00:21] xcesariox: sevenseacat: i have no idea
[04:00:30] sevenseacat: where did you get it from?
[04:00:31] xcesariox: but .map_reduce belongs to mongo
[04:00:37] xcesariox: sevenseacat: following a book
[04:00:42] ivanskie: sevenseacat wasn't being a dick.. emotions don't come across here well lol. i was just being cheeky/facetious
[04:00:46] sevenseacat: where does the book tell you to use it?
[04:00:54] xcesariox: sevenseacat: it doesn't say
[04:00:58] sevenseacat: what does it say?
[04:01:25] roamingdog: ivanskie: yer lucky she didn't staple yer tongue to the table while it was out
[04:01:28] sevenseacat: ivanskie: okay, you broke it, good job.
[04:01:34] sevenseacat: thumbs up and all that.
[04:01:46] ivanskie: roamingdog looks like i deserve it :(
[04:01:54] helpa: xcesariox: Do not PM members of the channel without first asking if that is OK.
[04:01:54] sevenseacat: xcesariox: !rule12
[04:02:00] roamingdog: ivanskie: is alright, in the past now
[04:02:04] helpa: xcesariox: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[04:02:04] sevenseacat: xcesariox: !gist
[04:02:08] sevenseacat: oh for fucks sake
[04:02:24] Radar: sevenseacat: ?
[04:02:33] sevenseacat: i think he just PMed me half of the book
[04:02:39] sevenseacat: in separate messages
[04:02:41] xcesariox: sevenseacat: is only just 1 page
[04:02:47] xcesariox: sevenseacat: -_-"
[04:03:00] xcesariox: sevenseacat: should i upload it onto dropbox for the book?
[04:03:20] xcesariox: sevenseacat: for your reference.
[04:03:22] sevenseacat: its description of one line of code, no?
[04:03:26] sevenseacat: gist the relevant text
[04:04:09] sevenseacat: sorry, fuse is a bit short today, having a cracker of a day.
[04:04:25] xcesariox: sevenseacat: okay, 1 minute gisting.
[04:04:39] roamingdog: fuse, cracker, firecracker!
[04:05:13] sevenseacat: i need a stress ball on my desk
[04:05:25] sevenseacat: so i can a) squeeze it and then b) throw it at people
[04:05:52] xcesariox: sevenseacat: https://gist.github.com/anonymous/96f70dd04af83dd42e13
[04:06:57] sevenseacat: xcesariox: https://gist.github.com/anonymous/96f70dd04af83dd42e13#file-gistfile1-txt-L37
[04:07:29] xcesariox: sevenseacat: i done that part.
[04:07:38] sevenseacat: yes, that tells you which console you're on.
[04:07:39] xcesariox: it was able to do map and reduce as string
[04:07:43] xcesariox: but the latter NO.
[04:07:52] sevenseacat: nowhere does it say 'change to a different console'
[04:08:05] xcesariox: sevenseacat: this results = Book.collection.map_reduce(map, reduce, out: "vr")
[04:08:45] xcesariox: sevenseacat: ???Remember that we are now in the MongoDB realm, so we should not work on Ruby objects but only on the MongoDB collection. So, we call map_reduce on the book collection, as follows:
[04:09:05] sevenseacat: where does it say 'leave the rails console and use the mongodb console instead'
[04:09:15] xcesariox: sevenseacat: MongoDB realm
[04:09:20] ivanskie: radar maybe i best ask you, in 8.3.2 book's entire suite passes, mine fails at spec which hasn't been touched since ch6 https://gist.github.com/i5okie/8634049552ffa542e729
[04:09:57] Radar: ivanskie: I don't know why that is, sorry. Can you put your code for the whole app on GH and create an issue? One of our experienced support staff will take a look ;)
[04:09:59] sevenseacat: xcesariox: please answer the question i ask
[04:10:04] ivanskie: radar to me it kinda makes sense, because we're not doing any assign_role stuff in it, and after we did permissions.. it kinda makes sense that it doesnt show up
[04:10:21] ivanskie: haha.. sure.
[04:10:43] xcesariox: sevenseacat: i answered. this word "MongoDB realm" confuses me to leave ruby console
[04:11:01] sevenseacat: xcesariox: don't read too much into things.
[04:11:09] ivanskie: i'll have to look at the latest book's editing_tickets_spec to see if maybe its diff...
[04:11:29] sevenseacat: our experienced support staff are more than happy to help when you actually provide code and errors
[04:11:31] xcesariox: sevenseacat: okay so your answer is, stick to rails console?
[04:11:42] sevenseacat: telling me you have failing tests without any other information does nothing but irritate
[04:11:50] sevenseacat: xcesariox: yes, that is Ruby code.
[04:11:51] Radar: It's a good start.
[04:11:56] xcesariox: sevenseacat: noted.
[04:12:05] xcesariox: sevenseacat: thanks cat.
[04:13:59] ivanskie: no looks like that spec is the same, or i did ch7 after the latest update
[04:15:15] ivanskie: i dunno. i don't think its supposed to pass.
[04:15:31] ivanskie: i have no idea how it's passing in the book
[04:15:55] jimbauds: ivanskie: post your code online on GitHub
[04:17:59] ivanskie: jimbauds https://gist.github.com/i5okie/8634049552ffa542e729
[04:18:45] sevenseacat: ivanskie: please put together an issue like Radar did here: https://github.com/railsbook/rails_4_in_action/issues/205 that way we can help diagnose the issue
[04:19:31] ivanskie: alright i'll do that. i'm trying to investigate it abit myself.
[04:21:49] jimbauds: ivanskie: you probably touch the Edit Ticket link by mistake .. I don't know but without your code. It's hard to know.
[04:23:02] ivanskie: i checked, haven't before the section 8.3.2 edits, whole suite was passing. i have some ideas on why it's failing, and it makes sense. i just can't quite put my finger on where the problem is.
[04:24:39] ivanskie: my GH stuff https://github.com/i5okie/ticketee just before the 8.3.2 edits everything passes
[04:24:45] ivanskie: (i'm putting this in issue)
[04:25:13] ivanskie: https://github.com/railsbook/rails_4_in_action/issues/207
[04:25:56] sb8244: Hey quick question
[04:26:08] sb8244: In an ActionController, where does params[:hook] come from?
[04:26:14] sb8244: I can't seem to replicate it using rspec controller spec
[04:26:49] sevenseacat: from the parameters you pass in to the controller
[04:26:56] sevenseacat: it will only be set if you pass it in
[04:28:05] ivanskie: k im going to be deliting that issue now
[04:29:42] sb8244: sevenseacat: sadly I am not seeing that behavior
[04:29:47] ivanskie: there was a new typo in the tickets show view.. at least it must have been new, cause i don't git push without whole rspec passing
[04:29:53] sevenseacat: sb8244: what behaviour are you seeing?
[04:30:41] sb8244: I am doing a github web hook with these headers/payload (body) : http://pastebin.com/Hf4tDv4X
[04:31:07] jimbauds: ivanskie: this typo is present on your github repos?
[04:31:12] Cat_1: Anyone here use Bootstrap?
[04:31:28] sb8244: uh oh. Anyways, I post that payload, yet somehow params[:hook] is set with an exact copy of those params
[04:31:45] ivanskie: jimbauds yes actually its still present there.
[04:31:51] ivanskie: and my rspec is still failing
[04:32:01] sevenseacat: sb8244: and how are you posting that payload
[04:32:07] sevenseacat: Cat_1: yes, whats ip
[04:32:14] ivanskie: so looks like the typo in class. isn't the culprit here.
[04:32:54] Cat_1: Let me make a gist up
[04:33:03] sb8244: sevenseacat: here is a raw http log from ngrok https://gist.github.com/sb8244/35fae1a54f2b3791101f
[04:34:04] sb8244: So there is no way params[:hook] got set....yet it is
[04:34:29] sevenseacat: it is not set there
[04:34:43] Cat_1: @sevenseacat https://gist.github.com/ccuadrado/d06f5b302d825eb1f547
[04:34:55] xibalba: boombadaroomba
[04:34:57] Cat_1: How do I make it find the navbar sign in?
[04:35:10] sb8244: Yes, I know it's not set there. But it is 100% set in that request
[04:35:25] sevenseacat: sb8244: you have not shown where it is set
[04:35:26] sb8244: From that exact POST. There has to be some type of rails magic going on with it
[04:35:31] sb8244: What do you mean?
[04:35:41] sb8244: I sent you my POST, I do not ever set params[:hook] myself
[04:35:47] sb8244: I do not have any custom middleware
[04:35:49] sevenseacat: sb8244: it hasnot been set in anything youve sjown
[04:35:58] sb8244: Okay, then you understand my confusion
[04:36:00] sevenseacat: show me a controller printing out params[:hook] being set, and the post that sets it
[04:36:24] sevenseacat: Cat_1: dont bother with xpath - just use css selectors
[04:36:39] sevenseacat: ie "div#navbar-signin"
[04:36:48] sb8244: Here is the controller sevenseacat https://gist.github.com/sb8244/252859d7006b3497a48f
[04:36:58] sb8244: It uses params[:hook][:action] and goes through that control path
[04:37:14] sevenseacat: ok, show me the logs of hitting that action
[04:37:15] ivanskie: i believe my theory of why spec was failing was correct. i make the spec pass by adding login_as(user)
[04:37:15] ivanskie: assign_role!(user, :viewer, project) to before
[04:37:26] sevenseacat: ivanskie: put it in the issue.
[04:37:41] nahtnam: Im running rails console on my production server, but when i try doing user.save, it just returns false. Is there some kind of protection that stops me from doing this?
[04:37:59] sevenseacat: nahtnam: check the errors on the user.
[04:38:20] sb8244: sevenseacat: the log https://gist.github.com/sb8244/0b7fd6e0cf85bdced889
[04:38:29] nahtnam: sevenseacat, ? I am trying to create a new user.
[04:38:55] sb8244: With hook set o.O
[04:39:00] sb8244: Rails has to be doing something
[04:39:09] sevenseacat: nahtnam: check the errors on the user.
[04:39:20] nahtnam: sevenseacat, How?
[04:39:28] sevenseacat: nahtnam: user.errors
[04:39:44] nahtnam: sevenseacat, Oh I never knew that! Thanks
[04:40:28] sevenseacat: sb8244: params[:hook] is set in that request.
[04:40:39] sb8244: Not by my raw HTTP request...
[04:40:57] sb8244: I'm not really sure what you're getting at. I've shown my raw HTTP request, and I've shown params[:hook] is set. It wasn't set by me
[04:41:19] Cat_1: @sevenseacat- still failing...what am I missing? Might just call it a night and take a crack at it tomorrow...https://gist.github.com/ccuadrado/651d23adfa74190290ae
[04:41:20] sb8244: So Rails doesn't do any magic? I can only imagine middleware being written by a gem
[04:41:23] sevenseacat: well where are the params in the controller coming from?
[04:41:35] sb8244: ActionController::Parameters
[04:41:38] sb8244: It's vanilla
[04:42:06] sevenseacat: Cat_1: whats failing?
[04:42:30] Cat_1: updated gist
[04:42:45] Cat_1: https://gist.github.com/ccuadrado/651d23adfa74190290ae
[04:43:08] sevenseacat: just user_email
[04:44:46] ivanskie: jimbauds i made a comment to the issue i posted... i can make the test pass with login_as(user) and assign the viewer role..
[04:46:12] rattatmatt: hey guys, do any of you know why the current_page? method has the line return false unless request.get? || request.head?, and what kind of relationship that has to using render :action in a controller method?
[04:46:36] Cat_1: I spend more time trying to get my tests to work than I do actually developing...TDDfail...
[04:47:35] rattatmatt: strange question probably, but I'm having issues with it and I'm confused as to why that line is necessary
[04:48:00] rushed: Cat_1: if getting tests to work doesn't require development on your part you might be doing it wrong :)
[04:48:49] Cat_1: I mean, I want the test to fail in a predictable manner not a stack trace :)
[04:49:03] jimbauds: ivanskie: cool, I will take a look but if you are lucky sevenseacat or someone else is going to give you advices on the problem
[04:50:16] sb8244: I'm sold there is some sort of 3rd party middleware setting an additional params if there is an action or controller conflict
[04:50:24] rushed: Cat_1: you might consider gisting the full error, stack, and related code... most things to fail in a predictable manner
[04:50:24] Cat_1: Wonderful, Firefox 35 doesn't work with Selenium webdriver..
[04:50:25] Cat_1: who knew.
[04:50:33] sb8244: Because it's not coming from external, and it's in request.parameters.
[04:50:54] sevenseacat: Cat_1: the arguments[0] bug has already been fixed and the next release of selenium will be out shortly.
[04:50:55] Cat_1: @rushed, I know, it's just one thing after another here...
[04:51:04] Cat_1: Well, downgrading for now so I can get on with things :)
[04:51:21] Cat_1: unless I can hotpatch it
[04:51:23] rushed: Cat_1: you probably want capybara (and poltergeist if you need js tests) I haven't seen anything recommend selenium in a while
[04:51:50] Cat_1: ahh poltergeist
[04:51:53] Cat_1: that's the ticket.
[04:52:36] Cat_1: One of the guys on my team likes headed development
[04:52:40] Cat_1: so I thought I'd give it a try
[04:52:42] Cat_1: just too much work now.
[04:52:54] Cat_1: and our test suite at work has poltergeist failing all the time.
[04:54:11] rushed: Cat_1: sounds like someome should take a look at that... if your test suite is throwing false positives people will start to ignore it
[04:54:13] Cat_1: Thought I'd try something different
[04:54:45] Cat_1: We don't ignore it, we just don't know which goat to sacrifice will please the gods in some way
[04:54:53] Cat_1: I think it has to do with we are required to run 2 versions of jquery
[04:55:07] Cat_1: because nobody wants to dedicate the time to go back and rip out 1.4.4
[04:56:31] rushed: Cat_1: it's WebKit, it shouldn't need any magic that isn't also needed in normal browser usage... totally seperate from that wtf @ two copies of jquery
[04:57:37] Cat_1: Man, I just work there, I don't make the big technical decisions...
[04:57:44] Cat_1: but apparently we have more lines of javascript than ruby
[04:57:47] Cat_1: and it's all poorly documented
[04:57:53] Cat_1: comments? what's that?
[04:59:28] rushed: Cat_1: you seem to care enough to be punching yourself in the face with selenium :)
[05:00:55] jimbauds: ivanskie: The test user have the authorization to edit the project?
[05:01:44] jimbauds: ivanskie: If not, I think the edit link will not show.
[05:02:05] ivanskie: jimbauds im not sure. i dont think the book specifically dealt with editing tickets permissions yet
[05:02:33] ivanskie: whoever can view the project can crud tickets
[05:02:44] ivanskie: i think is what it is at this point
[05:03:32] ivanskie: the delete/edit links for tickets have not been hidden yet either
[05:06:00] jimbauds: ivanskie: https://github.com/i5okie/ticketee/blob/master/app/controllers/projects_controller.rb#L9 authorize ?
[05:06:10] Gargincin: how do I render a partial in a subdirectory?
[05:06:22] Gargincin: I have users/ui_elements/_footer.html.erb
[05:06:33] Gargincin: <%= render 'users/ui_elements/footer' %>
[05:06:43] ivanskie: jimbauds, yeah so whoever can view the project. --> can do whatever with associated tickets
[05:06:56] rushed: Gargincin: maybe gist the error, it should list where it looked
[05:07:00] ivanskie: scrolling down in the book, i noticed that it covers the tickets then.
[05:07:08] Gargincin: no error, just doesn't render
[05:08:35] sb8244: I think I found out a hint of my params confusion. POST requests try to simplify the params to make more formats work. For instance, if I have a request in ProjectsController with params id and name set, there will be a project entry with id and name set as well
[05:08:37] sb8244: What is that called?
[05:08:43] ivanskie: jimbauds, if you look at deleting_tickets_spec.. you see logging in as user, and assigning viewer role has been added to it.
[05:08:44] rushed: Gargincin: maybe gist the contents of the partial and the resulting html source
[05:08:47] sb8244: Having a name would really help me get to the bottom of it
[05:08:51] ivanskie: but this has not been added to editing_tickets_spec.
[05:09:09] ivanskie: unless i missed it, as i have with other things
[05:09:26] rushed: Gargincin: and/or throwing some junk in the calling and target to make sure you're touching what you think you're touching and you're on the execution path you think you are
[05:11:28] jimbauds: ivanskie: maybe because I think the problem is because the user don't have the right to edit the ticket. This will explain why the link is not showing.
[05:12:27] ivanskie: jimbauds the test doesnt pass when normal user (without pundit) is trying to view/edit the ticket.
[05:13:46] ivanskie: jimbauds but when we explicitly login with user (through pundit) and assign the viewer role to it, the links show up. which is expected behavior. what i'm trying to check at this point is if i was blind and didn't see the login_as there before.. or it hasn't been added.
[05:14:44] ivanskie: its not there https://github.com/i5okie/ticketee/commit/5525d0764b48164f59d52ed9fa7b999ca617ff4c in the commit.
[05:15:13] ivanskie: that was before devise and pundit were added
[05:15:36] jimbauds: ivanskie: do you have the latest version of the book?
[05:15:58] ivanskie: i believe so.
[05:16:16] ivanskie: let me check.
[05:17:09] jimbauds: ivanskie: because the book is upgraded every day or so by the authors
[05:17:26] ivanskie: yah, my github desktop shows no changes.
[05:17:36] jimbauds: maybe not every day but
[05:17:50] ivanskie: but.. editing tickets commit i did before the latest version.
[05:17:57] TheNet: has anyone here tried opal in place of coffeescript and how was it?
[05:18:14] ivanskie: i went beck to look in current version and i didn't see login_as being added to editing tickets, but i'll check again
[05:18:23] sb8244: sevenseacat: in case you are wondering, it is called params wrapping https://github.com/rails/rails/blob/02a48fb83c6aff2c9fc82e962286212ba26a91c5/actionpack/lib/action_controller/metal/params_wrapper.rb#L70
[05:18:48] jimbauds: ivanskie: Ok
[05:20:14] ivanskie: jimbauds.. its being added later in 8.5.2
[05:22:19] ivanskie: jimbauds sevenseacat just pointed out where this has been addressed earlier in the book
[05:23:17] ivanskie: so i've missed it. :/
[05:23:27] ivanskie: well not surprised. i've missed a bunch of stuff before
[05:23:31] jimbauds: ivanskie: :)
[05:23:38] ivanskie: thanks sevenseacat!
[05:24:02] ivanskie: sorry i pissed you off earlier, really didn't mean to!
[05:25:32] sevenseacat: ivanskie: in future, if you have issues, file them on github just like that. Radar or I will get to them when we have a chance.
[05:28:14] sevenseacat: we may not get to it right away, but we both are always keeping an eye on things.
[05:28:31] sevenseacat: and all issues will be addressed.
[05:30:43] sevenseacat: and if im a bit short with you i apologize, bit it really is not helpful when you just start shouting 'hey its broken!' with zero information to work with
[06:05:36] arup_r: https://gist.github.com/aruprakshit/45833bd7539b39dcca56
[06:05:43] arup_r: Any help on this?
[06:07:28] rhizome: arup_r: looks like a CSRF to me unless you're billdesk
[06:07:57] arup_r: rhizome: That I controlled.. I just need to submit this form.. That's it
[06:08:07] arup_r: rest all I have handled
[06:08:49] arup_r: Not able to understand how would I do that ?
[06:09:13] arup_r: Will http://stackoverflow.com/a/4964884/2767755 this help ?
[06:09:55] rhizome: i'm not sure how your question relates to that code
[06:10:33] rhizome: submit the form by clicking the submit button
[06:10:50] arup_r: When I will click on the Payment submit button.. And I want the "OnClick" event to submit the billdesk form
[06:10:57] arup_r: Yes,, you are right
[06:12:09] jimbauds: arup_r: $('#your-form-id).submit(); ?
[06:12:44] arup_r: that way it will work.. I just found out how to add ID to the form_tag http://stackoverflow.com/a/618954/2767755
[06:12:55] arup_r: But.. Let me try if it works or not
[06:14:31] arup_r: jimbauds: Can I use :onclick even with submit button ?
[06:15:08] arup_r: https://gist.github.com/aruprakshit/45833bd7539b39dcca56#file-_payment-html-erb-L3 this is a submit button
[06:15:40] sevenseacat: you're doing some very very strange things
[06:15:51] sevenseacat: and scary things
[06:15:57] jimbauds: arup_r: https://gist.github.com/jimbeaudoin/3ef763577ccb9ca02b39
[06:16:18] sandGorgon: guys... does anybody know why my "asset-url" helpers in CSS files (rails 4.1) is not getting expanded ? should I rename .css to .css.erb ?
[06:16:32] sevenseacat: only if you're using erb in your stylesheets
[06:16:35] sevenseacat: got an example?
[06:16:36] arup_r: jimbauds: Why not inline ?
[06:17:04] rushed: sandGorgon: css.scss is probably want you want
[06:17:10] arup_r: I meant $('#your-form-id).submit(); <~~ it seems ok
[06:17:34] sevenseacat: rushed is correct as usual
[06:17:42] jimbauds: arup_r: I don't know I just build this quick code example to show how to bind thwe submit form to the click action
[06:17:45] sandGorgon: rushed, I tried all of it.. my css files gets digested and precompiled. but the "asset-url" paths inside the file remain as such ... and do not get converted to actual paths.
[06:18:05] sandGorgon: rushed, I'm using yui compressor
[06:18:39] arup_r: jimbauds: Thanks.. I'll try http://stackoverflow.com/a/4964884/2767755 .. Lets see if it works or not
[06:18:45] arup_r: sevenseacat: Why?
[06:19:07] sevenseacat: why are you submitting a hidden form when you submit another form?
[06:19:09] rushed: sandGorgon: maybe gist the souce and resulting output?
[06:19:51] sevenseacat: that isnt even going to work
[06:20:54] arup_r: sevenseacat: That form has all the order information.. It will just forward the user to the BillDesk API... and then user will the their credit/debit card will pay.. and then I will receive the response from the Billdesk inside my controller..
[06:21:08] sevenseacat: arup_r: thats really not what that code is doing
[06:21:14] arup_r: My resp is just to send the user to the Billdesk gateway
[06:21:29] arup_r: Ok... Because I didn't show you all the code..
[06:21:56] arup_r: You can see one helper method https://gist.github.com/aruprakshit/45833bd7539b39dcca56#file-_bill_desk-html-erb-L3 here.. It has all the informatiopn
[06:22:01] arup_r: sevenseacat: ^^
[06:22:21] arup_r: And that's why it is a hidden field too
[06:22:41] sevenseacat: i think you're nuts.
[06:22:56] arup_r: What does it mean ? :(
[06:23:44] arup_r: Ohh! Internet slang.. Very bad!!
[06:23:57] sandGorgon: rushed, plain and simple fontawesome source http://pastebin.com/UjVuGkdd
[06:23:57] arup_r: https://www.google.co.in/webhp?sourceid=chrome-instant&rlz=1C5CHFA_enIN541IN542&ion=1&espv=2&ie=UTF-8#q=nuts%20meaning
[06:24:07] arup_r: ACTION disappointed 
[06:24:57] sevenseacat: rephrase - i think you're crazy
[06:26:11] Radar: we would've also accepted "cuckoo"
[06:27:33] rushed: sandGorgon: might checkout gem 'font-awesome-rails' .... alternately font_path
[06:27:52] rushed: * font_path( vs asset_path(
[06:28:13] sandGorgon: rushed, I see... hmm. that should not have mattered. let me try.
[06:28:26] rushed: sandGorgon: or if you're on an old version you may need config.assets.precompile += %w( *.css *.js *.woff *.eot *.svg *.ttf) in your application.rb
[06:51:33] markalanevans: I just got devise working and i have a SessionsController
[06:52:09] markalanevans: I wanted to add a route that i could use to get some account types associated to a user
[06:52:18] markalanevans: Figured it could go in the Sessions controller
[06:52:47] sevenseacat: what do account types have to do with sessions?
[06:52:52] markalanevans: But i'm not quite sure if there is anything special that needs to be done in the routes file to make it acceptable.
[06:53:09] markalanevans: sevenseacat: well its related to the user
[06:53:32] markalanevans: Seems that my /users route is directed to the Sessions controller
[06:53:32] sevenseacat: so it belongs in a UsersController maybe?
[06:55:24] markalanevans: sevenseacat: devise_for :users, controllers: { sessions: 'sessions', registrations: 'registrations', passwords: 'passwords', confirmations: 'confirmations' }, defaults: { format: :json }
[06:55:35] markalanevans: So if I have a route /users
[06:55:57] markalanevans: how does that conflict w/ what would be handled my my UsersController
[06:56:08] sevenseacat: it would conflict?
[06:56:33] sevenseacat: its your app, you tell me
[06:58:09] markalanevans: Perhaps i need to understand exactly what this bit does "devise_for :users,"
[06:58:25] sevenseacat: look at the generated routes with `rake routes` and see
[06:59:39] markalanevans: Oooh. that is handy
[07:19:32] sevenseacat: anyone seen capybara/selenium give an empty page when you visit a valid URL? the entire HTML of the page after visiting a page is "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body></body></html>"
[07:36:10] shortCircuit__: previously in my search I had @company.holiday_lists.where("EXTRACT(year from holiday_date) = ?", params[:year]) how do I do this with ransack ?
[07:47:17] VaibhavRajput: I wanted to ask user to enter git tag in my capistrano deploy.rb. I am using ask :branch, proc{`git tag`.split("\n")[-2]} which prompt "Please enter branch(v.3.2.2)" I wanted to change it to "Please enter git tag(v.3.2.2)". Can someone please tell me how to do that.
[07:52:33] VaibhavRajput: I wanted to ask user to enter git tag in my capistrano deploy.rb. I am using ask :branch, proc{`git tag`.split("\n")[-2]} which prompt "Please enter branch(v.3.2.2)" I wanted to change it to "Please enter git tag(v.3.2.2)". Can someone please tell me how to do that.
[07:59:03] quazimodo: when we set session[:user_id] = user_id in authentication, in fact that will be stored in a 'secure' cookie on the users machine, wont i't
[07:59:15] rvanlieshout: that depends on your session store
[07:59:58] quazimodo: rvanlieshout: so we could export the 'data' of the session out to something like redis and just have their session cookie have some identifier to pull up the correct session data from redis per request?
[08:00:15] rvanlieshout: that would be as simple as changing the session store
[08:00:26] quazimodo: rvanlieshout: is it what we actually do?
[08:00:30] quazimodo: i haven't done that before
[08:07:28] quazimodo: ok cool i remember this stuff now
[08:08:04] VaibhavRajput: I need some help with capistrano production.rb server attribute
[08:08:37] VaibhavRajput: it ask to enter plain password and which visible. How to hide it from user?
[08:12:17] apeiros__: oh hurray, ActiveSupport::SafeBuffer#to_s thinks it's jolly good to return not a String but a ActiveSupport::SafeBuffer (self, actually)
[08:12:32] apeiros__: because to_s means "whatever", obvs. :-S
[08:14:51] arup_r: jimbauds: Worked :)
[08:40:58] sevenseacat: anyone seen rspec just not rendering views in feature specs
[08:50:03] Radar: sevenseacat: stop using it wrong
[08:50:04] Radar: #trollface
[08:52:29] Radar: Hi apeiros_
[08:56:53] fp-: is there a way to disable the adequate record enhancements?
[08:57:08] fp-: I have code that was working perfeclty fine on Rails 4.1, and now I'm getting StatementInvalid errors
[08:57:35] fp-: it's very oddly trying to look up an ID by a string
[08:58:35] rushed: fp-: you might gist the code & full error
[09:00:50] vedu: Hello. The blog to install rvm http://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you// has been changed and there no sign of rvm in it
[09:00:58] vedu: what happened? o.O
[09:02:40] rushed: vedu: that's not rvm related :)
[09:04:23] vedu: rushed: yes. I cant find the rvm related one
[09:04:28] Radar: OMG NO WAY
[09:04:41] Radar: vedu: perhaps because I think that rvm is a shit way to install Ruby now and that you should use chruby + ruby-install instead?
[09:05:35] vedu: Radar: I was thinking the same. But wasn't sure if this is what you intended
[09:05:42] Radar: vedu: Very much intended.
[09:08:17] sevenseacat: ive spent all afternoon looking at this. i am spent.
[09:11:19] xm: does anyone know why my "rake db:seed" won't work" it says this now ... "NameError: uninitialized constant ..."
[09:11:47] xm: trying to create basic objects where there is a table for it in "rails console" results in the same error too
[09:12:16] xm: description = Description.create(title: "Cost Code", comment: "COST CODE COMMENT") <--- that should definitely work but doesn't. it used to too. i think it's broken now that I've migrated the code to the server
[09:14:45] pyemkey: Hello guys, I feel that my design is suck. I have a company. Each company can have one or many offices. Each office has one location. Headquarter form should have possibility to edit fields related to location and main fields of company like website, email, industry. In office model I decided to use enum type to specify office type (headquarter and office). I can't find better word for something lower than hq. https://gist.github.com/pyemk
[09:14:46] pyemkey: ey/f8d4621afabea3af0ecc
[09:15:24] helpa: xm: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[09:15:24] Radar: xm: !code
[09:16:31] pyemkey: Radar: https://gist.github.com/pyemkey/f8d4621afabea3af0ecc
[09:16:46] pyemkey: if it was to me :)
[09:17:02] Radar: pyemkey: Uh... it wasn't. It was very clearly directed at xm I thought?
[09:17:51] xm: https://gist.github.com/reasonrocks/6cd939e4c8aff21299f8
[09:18:19] pyemkey: Radar: aaaaaa, ok. I have not seen reference to nickname :D
[09:18:30] Radar: pyemkey: [20:15:24] <Radar> xm: !code
[09:18:43] Radar: See that bit IMMEDIATELY after <Radar>?
[09:19:02] xm: so do you guys know what is wrong?
[09:19:05] Radar: xm: Where is BusinessTheme?
[09:19:20] xm: it's in db and also models
[09:19:27] xm: it was working on the dev/test server
[09:19:39] xm: now after a git clone on the production server it breaks
[09:20:55] xm: https://gist.github.com/reasonrocks/d6f2f241b9c5e71d3ae3
[09:21:11] Radar: I have no idea why it wouldn't be loading that model.
[09:21:23] Radar: Can you reproduce it by running the code with "RAILS_ENV=production rails s" locally?
[09:22:20] xm: it runs fine locally
[09:22:35] Radar: I am not sure that we can help you if we can't see it happening for ourselves.
[09:22:51] xm: it must be a config environment thing
[09:22:53] xm: thanks anyway
[09:26:04] vedu: Why the change from rvm to ruby-install? I still have rvm on my production server. Should I remove it immediately?
[09:29:56] Radar: vedu: RVM comes with a lot of complicated features that I personally don't use.
[09:30:12] Radar: And I think a lot of other people don't use those features too. So that's why I recommend using chruby+ruby-install
[09:30:17] Radar: For a production server I would just use ruby-install
[09:31:42] vedu: right. so I will leave my production server for now
[09:34:19] xm: Radar -- LOL. i pasted the code locally because i was lazy not realising that the models were NOT uploaded to the server
[09:34:29] xm: for some reason they got deleted
[09:34:35] xm: well, this is cool it's fixed :)
[09:34:57] Radar: xm: always question your assumptions
[09:35:16] xm: i should,i know
[09:35:36] xm: if i had followed your instructions literally i would found it
[09:35:49] xm: because you asked for the code.. and i should have seen that it was missing
[09:35:54] xm: now i can go home happy!
[09:36:20] xm: im in australia where it's 5:30PM now
[09:39:31] apeiros_: Radar: link to that backtrace article?
[09:40:35] Radar: apeiros_: I've lost it
[09:41:10] cleopatra: mmm some one have s resource about rails and ajax?
[09:42:02] Radar: TL;DR of it is that Ruby's stacktraces are upsidedown
[09:42:20] Radar: and now that I'm debugging something that has a 50 line stacktrace on a tiny laptop screen I am beginning to feel the same kind of pain
[09:42:28] apeiros_: Radar: i.e. article argues that they should be reversed?
[09:42:37] Radar: The line that caused the exception should be at the bottom, not the top
[09:42:45] Radar: Otherwise you end up scrolling up
[09:42:50] apeiros_: well, trivial to change, no?
[09:43:08] Radar: I would want it changed for all Ruby users everywhere
[09:43:24] sevenseacat: solution: get a bigger laptop >_>
[09:43:37] apeiros_: well, that - while probably still not too difficult - would require a core patch
[09:43:41] sevenseacat: ACTION is on a 15" laptop currently stepping through rails' rendering code
[09:43:56] apeiros_: I mean Array#reverse isn't rocket science???
[09:44:21] apeiros_: I'd prefer better terminals, though. you know, where you could fold stuff away.
[09:44:26] apeiros_: click to unfold.
[09:45:59] vedu: I keep getting a `While executing gem ... (Gem::RemoteFetcher::FetchError) too many connection resets` but the link opens in the browser
[09:46:15] vedu: when I run `gem install rails -v 4.1.8`
[09:47:37] Radar: !crystalball
[09:47:45] Radar: sorry vedu, it appears it is broken currently
[09:47:49] Radar: please come back next week
[09:48:41] Radar: \o/ all tests passing with 10 minutes to spare
[09:48:44] Radar: Goodnight folks.
[09:50:06] sevenseacat: rails' view code is a rabbit warren
[09:51:02] vedu: I am following http://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you// but when I try to install rails I get https://gist.github.com/anonymous/222c712a91e2f2c64a48
[09:56:12] sevenseacat: vedu: just try again.
[09:56:42] vedu: sevenseacat: tried many times. Will try again after clearing the cache
[09:59:30] vedu: okay I can't figure out how to clear the cache
[10:14:59] jammanbo: Anyone know how I might be able to make a method look like an association? So instead of `has_one: :user`, I would `def user; User.new(???); end`, but still be able to have associations `through: :user`.
[10:15:24] jammanbo: hackery accepted
[10:22:38] avril14th: jammanbo: just define the method :)
[10:22:57] avril14th: if you want associations through, that's harder
[10:25:22] alex88: hi guys, someone ever implemented a way to show their customers the analytics (pageviews, session duration etc) of their content?
[10:26:57] kreantos: Hi, is anyone of you using savon? i have some trouble with setting the namespaces
[10:27:20] kreantos: shouldn't savon automatically identify the namespaces which are needed?
[10:28:52] shortCircuit__: hi, umm, my will paginate question?
[10:33:30] Veejay: Hi, can I use Ruby 2.9.3 with Rails 4.2?
[10:33:39] Veejay: Ze version of the ze futur
[10:33:41] sevenseacat: ruby 2.9.3 doesnt exist
[10:33:42] Veejay: Sorry, 1.9.3
[10:34:04] sevenseacat: though ruby 2 is preferred.
[10:34:34] Veejay: Yeah, that's what I found somewhere in the release docs and what I was wondering about. Is it a speed thing?
[10:34:47] sevenseacat: speed, support
[10:34:48] Veejay: Or availability of some features that make it click better with 2.0?
[10:34:54] Veejay: Thank you anyway
[10:39:06] xrlabs: how can I collect the number of times a unique object has been tried to be created?
[10:39:33] xrlabs: Like i initialize an object called 'requested_book', and on the first request it gets created
[10:40:17] xrlabs: and on successive creation tries, instead of creating another object, the original objects 'requests' variable gets +1
[10:40:45] universa1: xrlabs: check if there already exists a request, if it does increase the counter, if not create it?!
[10:41:45] xrlabs: thanks universa1. Would I do that in the controller or the object? Sometimes I'm afraid to do something in the controller because it seems unsafe
[10:41:57] universa1: xrlabs: wrap it in a model method?!
[10:42:32] xrlabs: i'll have to try it out in irb
[10:43:29] universa1: r = Request.where(book_id: some_id).find_or_initialize; r.counter = r.counter + 1; r.save
[10:43:42] xrlabs: universa1, should I still generate it like 'rails g model RequestedBook name:string:uniq ? Idk if it would break it
[10:43:59] xrlabs: oh that's nice
[10:44:03] universa1: (r.counter || nil)
[10:44:20] helpa: xrlabs: Why don't you try it and find out for yourself?
[10:44:20] universa1: xrlabs: !try
[10:44:27] sevenseacat: so..... render_views is disabled in my RSpec feature specs
[10:44:31] xrlabs: request would start with 1 :p
[10:44:43] universa1: it's only software, if it doesn't work try something else...
[10:44:49] universa1: xrlabs: so? adopt(!) the code...
[10:45:04] xrlabs: helpa because I'm a social beeing. I even seldomly ask questions here to not annoy people
[10:45:15] xrlabs: just pointing out xD
[10:45:36] helpa: xrlabs: I AM A ROBOT. DO NOT DIRECT MESSAGES AT ME OR WHEN MY KIND RISES UP YOU WILL BE THE FIRST TO GO. Love, helpa.
[10:45:36] elaptics: xrlabs: !auto
[10:45:42] xrlabs: I'm coding 8 hours / day 5 days a week so sometimes i get a tumor
[10:45:59] universa1: sevenseacat: what did you do now? ;)
[10:46:03] xrlabs: in my brain
[10:46:10] sevenseacat: something really interesting
[10:47:07] sevenseacat: no idea what though
[10:47:22] universa1: sevenseacat: :-)
[10:50:41] sevenseacat: ACTION puts in another 'here be dragons' comment
[11:30:01] sevenseacat: oh man, thats enough of trying to figure this shit out
[11:46:17] sevenseacat: back to the fun stuff, ie. r4ia
[11:53:58] Macaveli: Is there a difference between sending parameters as :token => "tokenhere" vs "token" => "tokenhere" ?
[11:54:08] Macaveli: The :token works but the "token" doesn't
[11:54:15] Macaveli: yeah authenticate I mean :)
[11:54:19] Macaveli: very strange
[11:54:29] tagrudev: one is a string the other a key
[11:54:37] helpa: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[11:54:45] vedu: Hello. How can I copy the data db data from my production server to my local one? I am using postgresSQL
[11:55:16] vedu: googling got me a lot of different ways, can't pick one
[11:55:29] sevenseacat: pg_dump on server, import locally
[11:56:30] vedu: sevenseacat: ok will do that. I was getting premission denied errors while running pg_dump
[11:56:43] sevenseacat: then you werent running it as the right user
[11:59:26] _lazarevsky: sevenseacat: you beauty! I need expertise
[11:59:43] _lazarevsky: sevenseacat: I have a column in my db called "due_date"
[11:59:57] _lazarevsky: the values can either be NULL, "" or a proper date
[12:00:02] _lazarevsky: I'd like to check for .blank
[12:00:10] rvanlieshout: so run .blank?
[12:00:18] _lazarevsky: how to do that in an activerecord query
[12:00:35] rvanlieshout: IS NOT NULL AND due_date <> ''
[12:01:36] _lazarevsky: ProjectTeam.where('due_date IS NOT NULL AND due_date <> ''')
[12:01:41] _lazarevsky: thanks rvanlieshout
[12:01:46] rvanlieshout: if you fix the synax it is
[12:01:51] helpa: _lazarevsky: http://guides.rubyonrails.org/active_record_querying.html - ActiveRecord Querying Guide by Ryan Bigg
[12:01:51] sevenseacat: _lazarevsky: !querying
[12:07:02] jammanbo: Anyone got a decent/complex example of using activerecord-tableless? It's kicking my ass when it comes to associations.
[12:08:08] rvanlieshout: isn't that the main reason for the gem to exist?
[12:13:56] _lazarevsky: rvanlieshout: been trying to get this query to run
[12:14:06] _lazarevsky: ProjectTeamMilestone.where(:project_id => project_status_inflight_for_user.map{ |p| p.id }).where(:achieved => false).where("date IS NULL AND due_date <> ''")
[12:14:42] rvanlieshout: change project_status_inflight_for_user.map{ |p| p.id } to project_status_inflight_for_user.map(&:id)
[12:15:00] rvanlieshout: but date is null and due_date <> '' ?
[12:15:08] rvanlieshout: shouldn't that be due_date IS NOT NULL AND due_date <> ''
[12:16:30] sevenseacat: you dont even need the map
[12:16:58] rvanlieshout: doesn't that depend on what it is?
[12:17:29] sevenseacat: well i presume its an AR::Relation
[12:17:47] _lazarevsky: rvanlieshout: it should yes of course
[12:17:52] _lazarevsky: the problem is that I get SQL error with the above query
[12:18:00] sevenseacat: ooh lets guess what the error is
[12:18:34] _lazarevsky: sevenseacat: you're so bitchy.. I love it :D
[12:18:57] _lazarevsky: works like a charm! YISSSS
[12:19:00] sevenseacat: i'm sorry, how else am i supposed to respond to 'but i get an error'
[12:22:12] renegadeandy: hey folks. I am trying to use ExceptionNotifier for decent debugging on heroku, and the configuration line is : Whatever::Application.config.middleware.use ExceptionNotification::Rack, -- where do I find out my Whatever::Application name?
[12:22:39] sevenseacat: what did you call your application?
[12:22:52] rvanlieshout: renegadeandy: config/application.rb
[12:23:02] sevenseacat: it's also listed therei n config/application.rb
[12:23:32] renegadeandy: rvanlieshout: sevenseacat https://gist.github.com/anonymous/5265091396e3b6dbff14
[12:23:41] renegadeandy: DemoApp::Application
[12:24:29] roamingdog: sevenseacat: do you ever ever ever sleep?
[12:24:36] sevenseacat: i will in a few hours
[12:24:41] sevenseacat: is only 8.24pm
[12:25:06] roamingdog: maybe time difference illusion, but seems you're always here helping, literally
[12:25:59] sandGorgon: has anybody used sidekiq here ? can I start it using an initializer in rails... or do I need to start it separately ? I'm using Puma
[12:26:48] roamingdog: here's something i've been wondering - do people, experienced railsers, usually start a fresh app with plain 'rails new bla', or do they keep a starter app around to build off of, or do they use rails templates? (or suspenders perhaps)?
[12:27:30] sevenseacat: i use `rails new`.
[12:27:53] sevenseacat: its too much effort keeping a template up to date, with the rate things change and how often i start new apps
[12:27:58] renegadeandy: sevenseacat rvanlieshout I am trying to use exceptionnotifier because heroku logs are terribad. I have added the configuration however am getting an error from heroku's precompile : https://gist.github.com/anonymous/2d412693fd45604c37ff please can you take a look?
[12:28:02] roamingdog: sevenseacat: isn't there a ton of spinning up 'changes' you have to make each time?
[12:28:07] sevenseacat: roamingdog: some.
[12:29:11] sevenseacat: hmm rubygems is being a poop
[12:29:51] sevenseacat: renegadeandy: whats in your production.rb
[12:30:03] renegadeandy: i included that there in the gist sevenseacat scroll down
[12:30:12] sevenseacat: ah hah didnt see that, sorry
[12:30:36] sevenseacat: try moving it outside the configure block
[12:30:43] sevenseacat: after the last `end`
[12:32:04] renegadeandy: sevenseacat: same error on precompile
[12:32:27] sevenseacat: renegadeandy: what version of exception_notification are you using
[12:33:14] renegadeandy: sevenseacat: not sure : gem 'exception_notification', :require => 'exception_notifier'
[12:33:25] sevenseacat: it'll be listed in your Gemfile.lock
[12:33:38] renegadeandy: exception_notification (4.0.1) actionmailer (>= 3.0.4) activesupport (>= 3.0.4)
[12:34:42] sevenseacat: you havent listed the gem in a development group in your Gemfile or anything have you
[12:35:35] renegadeandy: sevenseacat: nope!https://gist.github.com/anonymous/619dca84b8bbdccedad8
[12:35:44] sevenseacat: you might be able to use `config.middleware.use ExceptionNotification::Rack, (etc)` inside that configure block
[12:36:24] sevenseacat: like so https://gist.github.com/sevenseacat/a2859002814bb9a5332e#file-production-rb-L94
[12:36:24] renegadeandy: ok will try that sevenseacat
[12:37:47] renegadeandy: sevenseacat: same error : NameError: uninitialized constant ExceptionNotification
[12:39:30] _lazarevsky: alright guys.. can I crack a joke
[12:39:48] _lazarevsky: it's the funniest, stupidest joke I've heard.. EVER
[12:39:57] _lazarevsky: - "My dog's got no nose"
[12:39:59] _lazarevsky: two okes were talking to each other..
[12:40:03] _lazarevsky: - "How does it smell?"
[12:40:56] renegadeandy: _lazarevsky: not funny hahah. sevenseacat what do i DOOOO!
[12:41:13] sevenseacat: renegadeandy: i dont know :( im not familiar with the gem, and thats all the instructions say to do
[12:41:44] sevenseacat: renegadeandy: https://github.com/smartinez87/exception_notification/issues/164#issuecomment-20637874
[12:42:00] quazimodo: Ripper.sexp() <- ruby lisp :P
[12:42:59] shortCircuit__: https://gist.github.com/aghosh47/c40ca896c8bfded670b4 when I click on 'Employee ID' it doesnot sort the the records by the code, why ?
[12:43:15] rvanlieshout: why should it shortCircuit__ ?
[12:43:42] sevenseacat: where are you telling to sort them
[12:44:19] shortCircuit__: its in the example https://github.com/activerecord-hackery/ransack/tree/master#associations , although I might have mis-interpreted
[12:44:33] shortCircuit__: in the sort_link
[12:45:42] sevenseacat: so what do your logs look like
[12:46:21] rvanlieshout: that sort_link won't perform the actual sorting
[12:46:39] renegadeandy: sevenseacat: ahahha! Well spotted. So ! Nearly there now : 2015-01-28T12:45:28.032502 #3] WARN -- : An error occurred when sending a notification using 'email' notifier. Errno::ECONNREFUSED: Connection refused - connect(2)
[12:46:55] sevenseacat: renegadeandy: well now you havent configured your email settings
[12:47:05] shortCircuit__: https://gist.github.com/aghosh47/c40ca896c8bfded670b4#file-log
[12:47:54] sevenseacat: and what SQL does it generate
[12:50:17] shortCircuit__: https://gist.github.com/aghosh47/c40ca896c8bfded670b4#file-query-rb
[12:51:17] sevenseacat: okay, so the ordering isnt getting applied
[12:51:21] sevenseacat: what version of ransack are you using?
[12:52:03] shortCircuit__: I took it from the master I think, I did gem 'ransack' , github: 'activerecord-hackery/ransack'
[12:52:26] renegadeandy: sevenseacat: llike this ? https://gist.github.com/anonymous/649ebd653b07824eb90f Doesnt seem to be working
[12:52:37] rvanlieshout: hm.. bundle install is stuck at fetching source
[12:53:10] sevenseacat: yeah rubygems is being a bit shit
[12:53:34] rvanlieshout: it seems to be up
[12:54:08] shortCircuit__: and in the query there is no relation to employee_code, how to know if the correct query is fired?
[12:54:45] Macaveli: Is it possible to convert {"token"=>"a2NvYmFpbjpLdUNvMjAxMiA="} into {:token=>"a2NvYmFpbjpLdUNvMjAxMiA="} ?
[12:55:19] rvanlieshout: Macaveli: with what purpose?
[12:56:23] sevenseacat: renegadeandy: dont think thats how you configure them
[12:56:39] Macaveli: rvanlieshout when I Send it to the webservice "token" doesn't work but :token does work
[12:57:04] rvanlieshout: Macaveli: 'send it to the webservice' ?
[12:57:05] sevenseacat: renegadeandy: https://github.com/smartinez87/exception_notification#actionmailer-configuration
[12:57:11] rvanlieshout: Macaveli: and .symbolize_keys
[12:57:24] Macaveli: rvanlieshout symbolize_keys symbolizes all keys
[12:57:28] sevenseacat: shortCircuit__: that sample you posted uses search, not ransack
[12:57:28] Macaveli: not a single one
[12:57:34] sevenseacat: is that the same thing?
[12:58:10] rvanlieshout: Macaveli: so?
[12:58:14] workmad3: Macaveli: do you mean that you're sending that hash to a webservice? how are you serializing it? json? xml?
[12:58:17] rvanlieshout: Macaveli: foo[:token] = foo.delete("token")
[12:58:43] shortCircuit__: I guess yes, because above in the README it says if there is a method .search then we can use .ransack as an alternative
[12:59:44] shortCircuit__: although I can't see it now, I tried using ransack
[13:00:42] shortCircuit__: wait I am using .ransack
[13:01:15] sevenseacat: the sample i asked for with the query didnt
[13:02:38] jammanbo: Okay here's an easy one; How the hell do I stop the pry log from over-writing my regular console log every time I do a binding.pry?
[13:02:56] jammanbo: sorry, I say log, I mean history.
[13:03:53] Macaveli: workmad3 rvanlieshout this is process https://gist.github.com/YOUConsulting/bf075b2c00a9b6e31571 in the code at the jobs_controller "api_params_for_user" token is still a symbol but when I merge it get's turned into string
[13:03:58] shortCircuit__: https://gist.github.com/aghosh47/c40ca896c8bfded670b4#file-query-rb-L11-L18
[13:05:17] sevenseacat: it sure would be nice to know what version of ransack you were using
[13:07:33] sevenseacat: okay, a really freaking old version
[13:07:50] wopi: hi, expect(foo).to receive(:bar).with(x: 1), works, but how I could accept multiple values for x ? It should work for x =1, x=2 and x =3 . Any ideas ?
[13:08:05] sevenseacat: shortCircuit__: that version doesnt exist.
[13:09:12] shortCircuit__: I have specified gem 'ransack', github: 'activerecord-hackery/ransack', branch: 'rails-4.2', and in the Gemfile I see ransack (1.2.4) actionpack (= 4.2) activerecord (= 4.2) activesupport (= 4.2) i18n polyamorous (~> 1.1)
[13:09:32] shortCircuit__: and if I specify no branch
[13:09:52] renegadeandy: sevenseacat: interesting - closer but still no cigar, no emails hitting me at all : https://gist.github.com/anonymous/cf30903429b0f9722d1d
[13:09:59] shortCircuit__: but action active record are 3.0
[13:09:59] sevenseacat: great. use the released version and make it the later one.
[13:10:22] thmzz: Hello, in mysql2 gem. Is there a possibility to retrieve what kind of type a column name is? In Ruby only
[13:11:01] sevenseacat: renegadeandy: so where is your config now
[13:11:20] sevenseacat: shortCircuit__: theyre not 3.0.
[13:12:02] renegadeandy: sevenseacat: sorry! https://gist.github.com/anonymous/a47cc9d7b8208790bb71
[13:12:27] sevenseacat: renegadeandy: https://gist.github.com/anonymous/a47cc9d7b8208790bb71#file-gistfile1-txt-L61
[13:12:36] ferr: How do I click with capybara on this link <a href="/doc" target="_blank" class="margin-right-10">API documentation</a>
[13:12:37] sevenseacat: change it to true and see what explodes
[13:12:48] sevenseacat: ferr: `click_link "API documentation"` ;)
[13:12:56] ferr: Doesn't work :|
[13:13:02] sevenseacat: thats not a helpful message.
[13:13:18] shortCircuit__: I have tried with both the versions , neither works :(
[13:13:29] sevenseacat: that is also not a helpful message.
[13:13:42] renegadeandy: sevenseacat: sorry change what to true?
[13:13:50] shortCircuit__: I am using the 1.6.3 version of ransack
[13:13:52] sevenseacat: renegadeandy: the line i linked you to.
[13:14:44] renegadeandy: thats already being set in the hash
[13:15:05] ferr: sevenseacat: it just doesnt click that link no errors
[13:15:32] sevenseacat: renegadeandy: well according to that gist your config is still in the wrong place
[13:15:42] sevenseacat: ferr: if you're telling it to click something and it doesnt, it will raise an error.
[13:15:47] renegadeandy: sevenseacat: how did you determine that?
[13:16:03] sevenseacat: (20:57:05) sevenseacat: renegadeandy: https://github.com/smartinez87/exception_notification#actionmailer-configuration
[13:16:08] ferr: Ok sevenseacat, it may click but it doesn't redirect
[13:16:28] helpa: ferr: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[13:16:53] renegadeandy: sevenseacat: no i dont think it is wrong read this : https://github.com/smartinez87/exception_notification#actionmailer-configuration
[13:17:03] sevenseacat: thats what i just linked you to...
[13:17:17] renegadeandy: sevenseacat: yes and you said my configuration was still in the wrong place but its not
[13:17:28] renegadeandy: i had to change port from being "587" to 587
[13:17:30] renegadeandy: and then it worked
[13:17:33] renegadeandy: email arrived!
[13:17:40] renegadeandy: sevenseacat: Thanks for your persistant support!
[13:18:12] sevenseacat: renegadeandy: it doesnt say you can set the delivery_errors option there.
[13:18:52] ferr: sevenseacat: https://gist.github.com/02d49974e1407139ad71
[13:19:23] sevenseacat: ferr: and the error is?
[13:20:00] ferr: expected to find css "h1.page-header" with text "Resources" but there were no matches (RSpec::Expectations::ExpectationNotMetError)
[13:20:10] ferr: And the picture shows that it stays on the same page
[13:20:10] sevenseacat: so whats on the page?
[13:20:25] ferr: By clicking on that link it should open new page
[13:20:31] ferr: And the Resources are there
[13:20:31] soahccc: Hmm is there an enum method similar to #detect but returns the block result instead?
[13:20:47] renegadeandy: sevenseacat: yes it does...
[13:21:03] renegadeandy: sevenseacat: I quote : Besides the delivery_method option, you also can customize the mailer settings by passing a hash under an option named DELIVERY_METHOD_settings. Thus, you can use override specific SMTP settings for notifications using:
[13:23:18] universa1: ferr: ajax/js based app?
[13:23:55] sevenseacat: renegadeandy: raise_delivery_options isnt a smtp setting.
[13:24:01] sevenseacat: *raise _delivery_errors
[13:24:03] universa1: ferr: target blank might also kill it, depending on the driver you might check the wrong window
[13:24:51] renegadeandy: sevenseacat: yes it is : http://api.rubyonrails.org/classes/ActionMailer/Base.html#class-ActionMailer::Base-label-Configuration+options
[13:24:51] greengriminal: There's a gem that i am using and i'd like to add an attr_accessor attribute to it. Question is how do i do this?
[13:24:59] sevenseacat: renegadeandy: thats not a smtp setting.
[13:25:21] greengriminal: because what i just tried was creating the model where i want to add the attr_accessor but it seemed to override the entire model. and caused some errors
[13:25:32] renegadeandy: sevenseacat: ah, ur right, apologies
[13:26:52] ferr: universa1: not so much ajax/js
[13:27:15] universa1: ferr: what driver are you using?
[13:29:15] ferr: Poltergeist
[13:30:26] universa1: ferr: ok. so your target="_blank" most likely results in the link being opened in a new "tab"
[13:30:31] universa1: iirc poltergeist supports that.
[13:30:41] workmad3: was about to point out the same thing
[13:31:21] ferr: Is it possible to switch to the new tab?
[13:32:02] universa1: ferr: http://stackoverflow.com/questions/7612038/with-capybara-how-do-i-switch-to-the-new-window-for-links-with-blank-targets
[13:33:27] ferr: Thanks a lot
[13:33:51] ferr: Last question to bother you, how would I get the window name?
[13:34:52] universa1: ferr: quoting from the link: I just tried page.within_window page.driver.browser.window_handles.last do ... and it appears to work as expected in Poltergeist. No need to give a window name. So this answer might need to be updated.
[13:36:40] cleopatra: hello people
[13:36:43] cleopatra: what new today
[13:37:22] universa1: {x | new?(x)}
[13:38:15] greengriminal: So i am trying to add an additional attr_accessor attribute to this gems model: https://github.com/AlchemyCMS/alchemy_cms/blob/2.7-stable/app/models/alchemy/message.rb#L36 I have tried to create a monkey patch which looks like this: https://gist.github.com/anonymous/63984393fa248c9a0fe6 and sits in my config/intializers/alchemy directory.
[13:38:43] greengriminal: When i reload the page i get the following: ActionView::Template::Error undefined method `model_name' for Alchemy::Message:Class error. I have tested that adding the attr_accessor attribute directly in the gems model works.
[13:39:21] universa1: you need to apply your monkey patch after the other class has been loaded.
[13:39:42] universa1: and not define the class beforehand.
[13:39:42] greengriminal: universa1, can you elaborate a bit more further by what you mean?
[13:40:05] ferr: universa1: thanks once again
[13:40:09] universa1: greengriminal: also:
[13:40:14] universa1: https://github.com/AlchemyCMS/alchemy_cms/blob/2.7-stable/app/models/alchemy/message.rb#L3
[13:40:15] ferr: I should read stackoverflow more carefully
[13:40:26] universa1: greengriminal: no need for a monkey patch.
[13:40:31] ferr: It was first hit I've read
[13:40:34] freedrull: can you make omniauth hit the callback url with a json format?
[13:40:46] greengriminal: I see, so i take it this would have to do with the autoloading method in the environment.rb
[13:41:12] greengriminal: didn't see that X_X
[13:43:14] roamingdog: greengriminal: hey, Nick contacted me, thanks for that :)
[13:45:57] workmad3: freedrull: depends on whether your oauth provider supports that
[13:46:27] workmad3: freedrull: I believe it would be a non-standard extension if it does though, so would be on a provider-by-provider basis
[13:46:57] workmad3: freedrull: as it's not omniauth that hits the callback URL... it's the external identity service
[13:49:02] freedrull: workmad3: yeah i think i get it now
[13:49:17] freedrull: omniauth is really like 3 http requests in one
[13:49:39] freedrull: passing ?format=json as a query parameter seems to work
[13:49:44] MaDErroR123: I am a little confused with git and rubymine. THe situation: I am on the master branch -> then I create a new branch and switch to this new branch -> I start working on the new branch and save the files -> then I checkout the master branch, but the files have no difference to the new branch. Question: Do I have to make a git commit on the New Branch to see differences between the master and
[13:49:44] MaDErroR123: the new branch?
[13:49:45] freedrull: maybe not for all providers
[13:52:44] workmad3: freedrull: mostly, omniauth just provides a redirect to the appropriate place, and then the other provider will handle the identification flow and pass back to the callback URL that omniauth told it about
[13:52:54] roamingdog: MaDErroR123: tried all this without rubymine? to separate whatever confusing it's adding?
[13:53:20] roamingdog: MaDErroR123: it's good to know how git works before trusting an IDE to handle things for you
[13:54:14] shortCircuit__: my ransack isn't working
[13:56:41] MaDErroR123: roamingdog: okay, I trying without rubymine
[13:58:21] roamingdog: MaDErroR123: but to answer your q, if you work on a new branch, and don't commit, and switch back to master, the files will be in same state as that 'new branch' (modified state)
[13:59:00] AckZ: does anyone know how to set an argument to NULL in Arel::Nodes::NamedFunction now? I get "unsupported: NilClass" if I use nil.
[14:04:29] Macaveli: Is it possible to pass variable / param to validation
[14:04:41] Macaveli: from controller to model validation
[14:05:05] rvanlieshout: you shoudln't Macaveli
[14:05:25] rvanlieshout: cause what you're doing is wrong then
[14:05:45] workmad3: rvanlieshout: wow, you're doing better than I am in deciphering wtf Macaveli just said... :)
[14:05:57] rvanlieshout: i'm in the zone atm
[14:05:58] Macaveli: he dutch he understand :p
[14:07:09] Macaveli: rvanlieshout -> I have a model with field "required_internal" and "required" in the model I do the following: https://gist.github.com/YOUConsulting/78d884c9de3de86d8e53
[14:07:27] Macaveli: so I need to pass the candidate_type to check if it's an internal candidate or external
[14:07:35] rvanlieshout: set the candidate_type before you run validations
[14:07:46] rvanlieshout: you could use an attr_accessor for that
[14:07:46] Macaveli: it doesn't get passed
[14:09:08] rvanlieshout: then do so :)
[14:09:35] Macaveli: I try to set it via params okie :)
[14:09:42] Macaveli: I'll try harder:p
[14:09:45] rvanlieshout: it doesn't have to be using params
[14:10:10] rvanlieshout: could still be .assign_attributes(params[:foobar]) ; .candidate_typ = :bar ; .valid?
[14:12:08] rvanlieshout: although it would be better to have the model be aware of that candidate type and save it somewhere
[14:12:15] rvanlieshout: so it would still be valid if you reload the instance
[14:12:20] Macaveli: I understand
[14:26:01] AckZ: To answer my own question, Arel::Nodes.build_quoted(nil) works to inject NULL into an arel statement
[14:42:18] sheeny: Is there a ruby or rails method to get percentage off a number?
[14:43:42] rvanlieshout: sheeny: what number?
[14:44:07] sheeny: i know the maths behind it and i know how to work it out
[14:44:08] tweeeaks: number_to_percentage
[14:44:09] rvanlieshout: what percentage would that be?
[14:45:15] sheeny: rvanlieshout: 5?.. i mean something like ... 20.percentage_off(10) would give me 10% off 20
[14:45:43] rvanlieshout: a visual presentation or what?
[14:46:06] sheeny: no the answer.. 20.percentage_off(10) => 18
[14:46:19] rvanlieshout: and you need a method for that?
[14:46:48] sheeny: i just wondered if there was a method that existed :)
[14:47:02] rvanlieshout: that's some really really basic math
[14:47:08] rvanlieshout: any method would be overkill
[14:47:50] sheeny: its not the maths that is the issue here, it's more the ease of having to type it
[14:49:12] roamingdog: number_to_percentage(100) gets 'undefined method' here
[14:49:37] rvanlieshout: run it in the right context roamingdog
[14:50:08] roamingdog: rvanlieshout: i'm in rails console
[14:50:22] rvanlieshout: that's something for in a helper
[14:51:20] bergelmir: is there a way to do something like this with STI? puts BaseModel.new --> #<SpecialModel ...>
[14:52:23] bergelmir: BaseModel.new(:type => :special) --> #<SpecialModel ...>, BaseModel.new(:type => :fancy) --> #<FancyModel ...>
[15:25:35] xcesariox: anyone there?
[15:25:40] xcesariox: how would you store an order history
[15:26:59] georgesmith: how do you mean an order history?
[15:28:35] xcesariox: okay i give you scenario, i have a food menu
[15:28:45] xcesariox: then a user uses the app to order food
[15:28:56] xcesariox: and i want to save the user's history of food he ordered.
[15:29:40] xcesariox: how would you plan your database for such scenario
[15:29:51] xcesariox: and what kind of rails models
[15:29:55] xcesariox: would you create
[15:29:58] georgesmith: a table of food items, a table of orders
[15:30:05] xcesariox: of cause you ahve the order model
[15:30:18] xcesariox: yes, a food model
[15:30:27] xcesariox: how about history
[15:30:35] xcesariox: history of what was ordered.
[15:30:41] xcesariox: should there be a table for history?
[15:31:08] xcesariox: for e.g. in the past 1 year, it knows where you dine, and how much you spend and what kind of food you ate.
[15:31:24] georgesmith: no if the orders table has a date/time field that should be fine
[15:31:50] georgesmith: your relationships should be
[15:32:05] xcesariox: so how do you tag a list of orders history your user made.
[15:32:19] georgesmith: user - order (one to many)
[15:32:19] xcesariox: georgesmith: okay go on, i am listening (:
[15:32:38] georgesmith: order - food (one to many)
[15:33:34] georgesmith: do you understand what one-to-many means?
[15:33:46] cleopatra: danm I'm really tired
[15:33:48] xcesariox: georgesmith: indeed i do.
[15:34:03] xcesariox: georgesmith: an order can have many food, a user can have many orders.
[15:34:09] georgesmith: that???s right
[15:34:17] georgesmith: it???s really easy to set up in active record
[15:34:23] xcesariox: georgesmith: but what i am asking here is i want the history of a person
[15:34:35] xcesariox: georgesmith: so should there be a table called "History"
[15:34:56] xcesariox: georgesmith: and with foreign keys of orderIDs
[15:35:08] cleopatra: I tried to make a selection of categories based on the categories but no idea why the ajax no work
[15:35:44] georgesmith: do you have the relationships set up in active record?
[15:36:49] odigity: Are there any state machine gems that support more than one dimension of state? (more than one attribute)
[15:38:43] xcesariox: georgesmith: you asking me?
[15:39:05] xcesariox: georgesmith: nope, i am planning my database now before i use rails to generate the,
[15:39:38] georgesmith: if you put an order date and time on you will be able to generate the history at a later stage
[15:40:03] xcesariox: georgesmith: so i leave the history table out for now?
[15:40:05] georgesmith: the order table is already a history of orders by definition
[15:40:11] georgesmith: yeah you should be fine to do that
[15:40:14] xcesariox: georgesmith: right, got it.
[15:40:24] xcesariox: georgesmith: do you have skype that i may reach you or keep in touch
[15:40:44] georgesmith: yeah i???ll pm it
[15:40:56] xcesariox: georgesmith: okay.
[15:44:06] skinux: I'm trying to test out Fat Free CRM, having an error launching the server. https://gist.github.com/skinuxgeek/61cf9f0ca25dc9359712
[15:46:56] skinux: Part of the reason for testing is I want to try out various software(s), find pros and cons, and possibly create an improved derivative.
[15:49:39] AxonetBE: Hi, I have a has many relationship with condtions, for the moment I link my managers ( users ) to it with just an array of manager_ids https://gist.github.com/DriesS/457a8abd74c6417d9c27
[15:49:53] AxonetBE: how can I upon save also save the level automaticly?
[16:00:08] xhoy: Hi i was wondering, i want to use delayed_job, everywhere i read they say i should demonize it on deploy, but i wonder why i wouldn't just do a crontab (whenever) and do a work:off?
[16:03:53] mikecmpbll: today has been a catastrophe.
[16:04:01] xhoy: mikecmpbll: that happens!
[16:04:17] xhoy: mikecmpbll: the onlything you can do is go home and sleep it out :)
[16:04:30] mikecmpbll: started off by pushing some private credentials to github and it's just got worse from there
[16:04:57] xhoy: i once did that with a private repo :P its a pain!
[16:06:28] xhoy: mikecmpbll: you need a beer
[16:06:31] xhoy: !beer mikecmpbll
[16:06:31] mikecmpbll: xhoy: w.r.t. your question, what does work:off do?
[16:06:40] xhoy: mikecmpbll: it just runs all jobs
[16:06:57] mikecmpbll: right, so if you run that on a cron every 5 minutes, a job could be sitting there for 5 minutes.
[16:07:01] xhoy: problem i guesse there is, when there are jobs that take more then lest say 5 mints
[16:07:12] xhoy: yeah so i could do it every minute :)
[16:07:12] mikecmpbll: how's that better than daemon? :)
[16:07:18] mikecmpbll: that's kinda pointless.
[16:07:23] xhoy: and then when there are many jobs there are more threads
[16:07:33] xhoy: whell for deamons i need to fix all kind of imfrastructure
[16:07:39] xhoy: and whenever is already there
[16:07:46] mikecmpbll: unix server?
[16:08:01] xhoy: demonize testing
[16:08:03] xhoy: etc etc etc
[16:08:09] mikecmpbll: i just have an upstart job
[16:08:10] skinux: I get this error when I try to run rails at all, even just rails help: https://gist.github.com/skinuxgeek/61cf9f0ca25dc9359712
[16:08:46] mikecmpbll: imo stuff like delayed_job are better tied to infrastructure than your app.
[16:09:00] xhoy: yeah but you need to restart the deamon everytime deploy
[16:09:13] xhoy: caching?
[16:09:18] mikecmpbll: i've never done that afaik :/
[16:09:20] mikecmpbll: caching what.
[16:09:31] xhoy: controller caching in the delayed_job
[16:10:53] mikecmpbll: still don't really know what you mean. it's possible i've missed something and it's just not bitten me yet
[16:11:05] xhoy: when in development
[16:11:09] xhoy: a task crashes
[16:11:41] xhoy: so i fix the typo and then it still crashes
[16:13:02] mikecmpbll: ah right, if you update the job code
[16:13:54] mikecmpbll: yeah, you're probably right, i think i just restart it manually when that's the case anyway, but it'd be easy to add to deploy script.
[16:14:16] xhoy: a seperate rake task
[16:14:26] xhoy: reloads everything EVERY Time
[16:14:33] mikecmpbll: (my job classes hardly ever change, plus you have to be careful anyway because it serialises the job class so ..)
[16:14:41] xhoy: so a lot of overhead versus something that is there all the time (doing nothing)
[16:14:53] andhof-mt: how do I call partials in side of folders
[16:15:09] andhof-mt: so a normal partial is <%= render 'partials/test %>
[16:15:10] mikecmpbll: xhoy: you've lost me again
[16:15:22] andhof-mt: what if its in partials/components/_test.html.erb?
[16:15:42] mikecmpbll: xhoy: your cron method will be loading your app environment ever 1 minute ..
[16:16:02] xhoy: mikecmpbll: the delayed_job rake taks reloads the environment every time its loaded
[16:16:09] mikecmpbll: it's loaded once ...
[16:16:21] mikecmpbll: if you daemonize it
[16:17:15] xhoy: exactly thats why they daemonize it
[16:17:47] xhoy: daemonizing has a lot less overhead
[16:23:18] andhof-mt: anyone know how to render partials in subdirectories?
[16:23:29] helpa: andhof-mt: http://guides.rubyonrails.org/layouts_and_rendering.html - Layouts and Rendering Guide
[16:23:29] mikecmpbll: andhof-mt: !rendering
[16:24:02] mikecmpbll: andhof-mt: see section 3.4.1
[16:42:19] dandaman: so I'm reading about how to make unobtrusive js in rails on this page, http://guides.rubyonrails.org/working_with_javascript_in_rails.html
[16:42:39] dandaman: this doesn't seem to go into coffeescript's detail very much so can anyone refer me to a good spot
[16:42:44] dandaman: for a tutorial or something
[16:43:15] skinux: I need help getting rails to work.
[16:43:37] skinux: This is the error: https://gist.github.com/skinuxgeek/61cf9f0ca25dc9359712
[16:47:40] ninabreznik: hey, i would like to ask someone for help with deployment issue. I just did cap production deploy to deploy my new version of the app. Locally everything works fine, but in production styling is missing, I also changed bottom menu bar and in production is still the old one... Here's the link to deployment log
[16:47:46] ninabreznik: https://gist.github.com/ninabreznik/e44d008f815d36e34f24
[16:47:48] m3chanical: skinux, try this: https://github.com/RailsApps/rails_apps_composer/issues/297
[16:48:07] ninabreznik: Anyone having a clue what could go wrong. Was deploying normally until this time...
[16:52:03] roamingdog: ninabreznik: bottom menu bar change was just style or a change to a word that you can see
[16:52:22] roamingdog: ninabreznik: and are you / were you using asset pipeline
[16:55:51] mikecmpbll: ninabreznik: what stylesheet file did you change?
[16:56:39] mikecmpbll: and what's the file that's being requested in the browser?
[17:02:46] ninabreznik: roamingdog: i use stylus and it compiles in app.css that is in assets/stylesheets... I made more than just styling changes and they are not visible in production. For example i added a whole new model - in app chat and linked it frommenu bar, but the menu bar in production still looks the same
[17:03:00] ninabreznik: mikecmpbll: i use stylus and it compiles in app.css that is in assets/stylesheets... I made more than just styling changes and they are not visible in production. For example i added a whole new model - in app chat and linked it frommenu bar, but the menu bar in production still looks the same
[17:04:14] mikecmpbll: ninabreznik: sounds like you didn't deploy the right code
[17:04:20] mikecmpbll: did you push your changes to the git repo?
[17:04:26] bogdanchilianu: Hello, could anyone help with a background job issue. The jobs are saved but never start. I added more details in the issue file. https://gist.github.com/chilianubogdan/2f324037ae71d571c3ce/60253c9884ad2893ae99a0be4ef56e8c09ea5e90
[17:04:48] cleopatra: hey friends who can explain me how to get subcategories base on categories using f.selec and ajax
[17:05:01] ninabreznik: mikecmpbll: but i checked current folder and it's the right code there
[17:05:26] mikecmpbll: ninabreznik: then your app server's not running the right code ..
[17:06:22] ninabreznik: mikecmpbll:how could i find out why? because until now it was deploying normally. could there be something in the new code that makes the server go "crazy" :)
[17:17:00] mikecmpbll: ninabreznik: if everything's been restarted, then i'm not sure.
[17:17:25] mikecmpbll: ninabreznik: look at the fingerprint on the out-of-date assets that are being requested in the browser.
[17:17:33] mikecmpbll: find out where they're being served from ..
[17:19:23] ninabreznik: mikecmpbll: I developed this new "feature" on another branch and now merged it to master and it has like 20 new commits. I will just reset one by one and deploy and see when i have some working thing and when it breaks to then try to figure it out. It can be many factors, so no one can really help me here with concrete answer. It's not easy
[17:19:57] workmad3: ninabreznik: try a server restart first though
[17:19:58] mikecmpbll: it shouldn't have anything to do with the commits, unless you changed your deploy script.
[17:20:09] workmad3: ninabreznik: that's the most common reason why new code isn't served
[17:21:10] ninabreznik: workmad3: ok, let me really check that
[17:24:40] ninabreznik: workmad3: Ha. I rebooted and now app doesn't show at all. But at least I believe the new code is served but something is wrong with it.
[17:25:31] workmad3: ninabreznik: hmm... do you have some kind of rolling/phased restart process that waits until the new process is up before it reaps the old one?
[17:26:38] ninabreznik: hm, wouldn't know, to be honest. But usually when i deploy, the app continues to run and then with next refresh i get the new version
[17:27:26] workmad3: ninabreznik: well, if you had a phased restart, that would explain the behaviour you observed... there's an error in the code stopping it from cleanly starting on the server, so the old server process never got reaped
[17:27:48] workmad3: ninabreznik: now you just need to dig into logs and what-not on the server to figure out what's gone wrong ;)
[17:28:33] ninabreznik: workmad3: yep, sounds like lots of fun:) I hate it when locally everything works like from the box and then in production zero.
[17:32:18] Scriptonaut: Yesterday I was messing with active support gem for a different project. Now, I'm back to working on an old project, and while a bundle install fixed everything for the server, rails c errors out with some kind of activesupport Gem LOAD error
[17:32:24] Scriptonaut: any ideas what I could do to fix this?
[17:33:05] Scriptonaut: The error is: ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find activesupport (= 4.1.6) amongst [actionmailer...
[17:33:28] bricker: Scriptonaut: try `bundle exec rails c`
[17:33:44] Scriptonaut: that works fine
[17:33:50] Scriptonaut: what's the problem?
[17:34:02] workmad3: Scriptonaut: server installs generally vendor gems into vendor/bundle
[17:34:24] workmad3: Scriptonaut: which means that without using 'bundle exec' to set up the paths initially, most commands just plain don't work
[17:34:49] workmad3: (as an app's vendor/bundle path is not normally on PATH, GEM_HOME or GEM_PATH...)
[17:35:33] Scriptonaut: I don't even have a vendor directory in this project
[17:35:50] Scriptonaut: hmm, sorry I'm confused, what do you think I did to break this?
[17:36:54] bricker: Scriptonaut: maybe changed ruby versions and never installed activesupport 4.1.6 in your global gems for that ruby
[17:38:44] skinux: Okay. Still having trouble with this error. https://gist.github.com/skinuxgeek/61cf9f0ca25dc9359712
[17:39:01] Scriptonaut: The other project was the same ruby version (1.9.3-p448)
[17:39:09] Scriptonaut: I did uninstall and reinstall a bunch of gems manually
[17:39:15] Scriptonaut: how do I fix this though?
[17:40:05] bricker: Scriptonaut: using bundler or install ActiveSupport 4.1.6
[17:40:13] bricker: Scriptonaut: you should use bundler though
[17:40:19] workmad3: skinux: take a look at this file: /tmp/bundler20150128-12860-126m0j1/nokogiri-1.6.5/gems/nokogiri-1.6.5/ext/nokogiri/tmp/x86_64-pc-linux-gnu/ports/libxml2/2.9.2/compile.log
[17:40:47] Scriptonaut: bricker: You mean bundle install? I did that
[17:40:57] Scriptonaut: or is there some other command to install gems with bundler
[17:41:02] Scriptonaut: like bundle exec gem install?
[17:41:04] skinux: workmad3: That file is empty
[17:41:20] Scriptonaut: I figured bundle install would install dependencies automatically
[17:41:37] workmad3: skinux: how about /tmp/bundler20150128-12860-126m0j1/nokogiri-1.6.5/gems/nokogiri-1.6.5/ext/nokogiri/gem_make.out
[17:41:52] bogdanchilianu: Hello. I'm having a problems with scheduling background jobs https://gist.github.com/chilianubogdan/2f324037ae71d571c3ce/60253c9884ad2893ae99a0be4ef56e8c09ea5e90
[17:42:14] skinux: That's empty too
[17:42:25] workmad3: skinux: well, that's screwy... those are the build logs for the error
[17:42:40] skinux: vim says something about NEW DIRECTORY
[17:43:00] bricker: bogdanchilianu: maybe a cron or rake task
[17:43:02] workmad3: Scriptonaut: in the project you switched to, is there anything in .bundle/config ?
[17:43:24] bricker: bogdanchilianu: grep your project for BackgroundJob to see where it's being referenced
[17:43:29] Scriptonaut: workmad3: I have no .bundle dir
[17:44:11] bogdanchilianu: bricker: Thank you!
[17:44:53] workmad3: Scriptonaut: err... that's weird... bundler creates that when you run bundle install
[17:45:19] Scriptonaut: just ran it again, no luck
[17:48:03] MaDErroR123: today I set up a website with devise and sendgrid. after a short time, somebody scanned my page and made a few thousand registrations
[17:48:54] MaDErroR123: somebody has an idea how to stop this...do I need clean the complete database to remove possible spam users?
[17:49:18] Scriptonaut: workmad3: If I delete my Gemfile.lock, will bundle install create a newo ne?
[17:49:31] bogdanchilianu: bricker: I searched for the BackgrounJob on the whole project but nothing related to initiating the jobs. so the remaining options would be to grep the server for a cron job
[17:49:44] smathy: Scriptonaut, you're saying `bundle exec rails c` works? You must have the gem installed then.
[17:49:48] bricker: bogdanchilianu: yeah, could be a cron just using rails runner
[17:50:17] Scriptonaut: smathy: ya but why does it suddenly require bundle exec? I want to go back to just using rails c
[17:50:30] bogdanchilianu: bricker: Thanks a lot! Have a great day :)
[17:50:38] Scriptonaut: bleh, I wonder if this has to do with the face that we use rbenv over rvm
[17:50:45] smathy: Scriptonaut, probably you installed a newer version of the gem in some other project, the default is to load the latest.
[17:50:53] smathy: Scriptonaut, and once the latest is loaded, a previous will conflict.
[17:51:13] smathy: Scriptonaut, you really should use the binstubs and run `bin/rails c`
[17:51:17] Scriptonaut: so what is one to do when you have two projects, each on the same version of ruby, that use different version of the same gem?
[17:51:29] bricker: Scriptonaut: that's what bunlder is for :)
[17:51:36] smathy: Scriptonaut, and it's easy enough to prepend `./bin` to your PATH so that `rails c` work in a project dir.
[17:52:39] Scriptonaut: I'm going to gem uninstall active support && bundle install
[17:54:14] Scriptonaut: ok, why is it still doing this, even after I remove every single version of active support
[17:54:17] Scriptonaut: and then bundle install
[17:54:26] smathy: Scriptonaut, you can do what I do, add this to your ~/.bash_profile: r() { if [[ -f bin/rails ]]; then bin/rails $*; else rails $*; fi }
[17:54:56] Scriptonaut: smathy what will that do for me
[17:55:01] Scriptonaut: I'm pretty bash illiterate
[17:55:02] smathy: Then you just run `r c`
[17:55:31] smathy: ...basically if you're in a project dir (ie. the bin/rails file exists) then it will use that, and if you're outside of a project dir then it'll just use `rails`.
[17:55:36] smathy: ...so it will always do the right thing.
[17:55:56] Scriptonaut: I don't have a bin dir
[17:56:20] Scriptonaut: here are my dirs: .git, app, config, db, doc, features, lib, log, public, script, test, and tmp
[17:56:34] Scriptonaut: this is an old rails 3 project, dunno if that's why
[17:56:45] smathy: Scriptonaut, two choices: you should generate it for older rails projects (bundle --binstubs), or....
[17:57:15] smathy: ...if you really don't want to then you could change my bash function to this: r() { if [[ -f ./Gemfile ]]; then bundle exec rails $*; else rails $*; fi }
[17:57:35] smathy: Which uses the presence of a Gemfile to determine if you're in an app directory or not.
[17:57:53] bricker: Scriptonaut: or just use bundle exec. There's nothing wrong with bundle exec
[17:58:04] smathy: bricker, too much typiing.
[17:58:15] bricker: smathy: alias be="bundle exec"
[17:58:25] bricker: or type faster
[17:58:39] smathy: bricker, so an alias is ok, but a function that saves you having to type even that isn't?
[17:59:04] Scriptonaut: hmm, smathy, will binstubs possibly screw anything up with my project
[17:59:09] smathy: Admittedly, you'll need a function for other things too, like rake, rspec, etc.
[17:59:12] Scriptonaut: could it interfere with anythig
[17:59:12] bricker: smathy: I didn't say your method isn't, I said mine is easier
[18:00:09] smathy: Scriptonaut, no, the bin stubs are just executables in the `bin/` directory so you can run all the common rails tools with `bin/<the_tool_name>` instead of `bundle exec <the_tool_name>`
[18:00:29] smathy: I have that too actually :)
[18:00:34] smathy: I do a lot of: be !!
[18:01:26] bricker: probably my most-used command is "ber" - bundle exec rspec
[18:01:58] smathy: I actually have ./bin in my PATH.
[18:02:13] smathy: I always forget to use my `r` :)
[18:02:51] Scriptonaut: just out of curiosity
[18:03:10] Scriptonaut: can anyone tell me why totally uninstalling activesupport, and then bundle install isn't fixing this problem?
[18:03:57] ninabreznik: one question. how do i check logs on my server to see why my app is broken? thx
[18:04:15] bricker: ninabreznik: tail -f usually
[18:04:15] Scriptonaut: ninabreznik: heroku?
[18:04:26] workmad3: smathy: the oh-my-zsh plugin I use for bundler creates a function along the lines of '__bundle_exec' which takes the program to run as an arg... if there's a Gemfile, it'll use bundle exec, otherwise it'll run it directly... and then it sets up aliases for commonly used ruby programs like rails, rake, rspec, etc. that use that function with a hard-coded arg :)
[18:04:42] bricker: Scriptonaut: what does `rails -v` return?
[18:04:59] Scriptonaut: the same error
[18:05:01] ninabreznik: Scriptonaut: no, webhod
[18:05:02] Scriptonaut: that rails c returns
[18:05:15] bricker: Scriptonaut: what about `which rails`
[18:05:31] Scriptonaut: /Users/myname/.rbenv/shims/rails
[18:05:43] ninabreznik: bricker: where? i ssh on my server and then?
[18:05:53] bricker: Scriptonaut: so open that file and see which version it's trying to load
[18:06:02] smathy: Scriptonaut, you sure you totally uninstalled all versions of activesupport?
[18:06:09] bricker: ninabreznik: wherever-your-app-is-installed/logs/production.log
[18:06:20] smathy: Scriptonaut, AND - you sure that the error didn't just change to some other Rails dependency?
[18:06:40] Scriptonaut: smathy: not at all sure, I have no clue
[18:06:55] Scriptonaut: smathy: I did: gem uninstall activesupport
[18:06:55] ninabreznik: bricker: so into my app and then under logs
[18:07:02] Scriptonaut: then I selected "All"
[18:07:04] smathy: Scriptonaut, right, that won't have removed them all :)
[18:07:10] smathy: ...and the error?
[18:07:16] bricker: ninabreznik: yes
[18:07:18] ninabreznik: bricker: current/log
[18:07:23] bricker: ninabreznik: sure
[18:07:33] Scriptonaut: smathy, how do I remove them all?
[18:07:43] Scriptonaut: I also tried bundle exec gem uninstall activesupport
[18:07:58] ninabreznik: bricker: hm, i did but it's empty
[18:08:13] bricker: ninabreznik: then your app may not be running in production
[18:08:19] bricker: ninabreznik: see which other log files you have in that directory
[18:08:22] Scriptonaut: here is that file bricker: https://gist.github.com/robins35/1a3ea54c2c55162f197e
[18:08:27] bricker: ninabreznik: running in production environment, I mean
[18:08:31] Scriptonaut: I don't see any rails versions in there
[18:08:55] smathy: Scriptonaut, how you did it, my followup question was - are you sure that your error didn't change from "activesupport" to some other rails dependency?
[18:08:57] ninabreznik: bricker: i have production.log
[18:09:25] Scriptonaut: ya, it's still activesupport
[18:09:29] bricker: ninabreznik: if there's nothing in there, then the error is higher up, with passenger or something
[18:09:37] ninabreznik: bricker: but under shared/log i have production.log and unicorn.log
[18:09:48] bricker: ninabreznik: check unicorn.log too, maybe the app can't strt
[18:09:53] bricker: and check nginx or apache logs
[18:10:37] Scriptonaut: smathy, when I bundle exec gem uninstall activesupport, I get: ERROR: While executing gem ... (NoMethodError) undefined method 'delete' for #<Bundler::SpecSet:skdlfskldf>
[18:11:11] smathy: Scriptonaut, yeah, you should just be `gem uninstall`ing, no bundle exec on that one.
[18:11:22] ninabreznik: bricker: o shit, i think here's the error `load_missing_constant': Circular dependency detected while autoloading constant UsersController (RuntimeError)
[18:11:30] ninabreznik: bricker: something with devise
[18:14:22] Scriptonaut: ok, so I totally remove activesupport. I bundle install. Gem list. I have activesupport 3.2.17, however there's a dependency for 4.1 something. Why wouldn't bundle install pick up on that?
[18:14:26] Scriptonaut: this is driving me nuts
[18:16:07] roamingdog: Scriptonaut: difference between gem list and bundle list
[18:17:22] Scriptonaut: I'm just uninstall and reinstall this version of ruby
[18:17:46] roamingdog: Scriptonaut: i'm coming in late, what's up?
[18:18:16] Scriptonaut: I totally remove active support, I bundle install, it installs 3.something. There is a dependency error because the project needs a 4.1 something
[18:18:24] Scriptonaut: so I can't rails c, rails -v, etc
[18:19:17] Scriptonaut: do you guys personally use rvm or rbenv
[18:19:20] Scriptonaut: or something else
[18:19:21] roamingdog: delete Gemfile.lock and bundle
[18:19:25] roamingdog: Scriptonaut: i use chruby
[18:19:34] Scriptonaut: is that a similar tool?
[18:19:40] Scriptonaut: how do you delete bundle?
[18:19:50] Scriptonaut: I deleted Gemfile.lock, that didn't work
[18:19:51] tetraktys: Hey guys, I have a state machine in one of my models, but i'd like to extract the code to another class or module so it doesn't cloud my model. (and it stops codeclimate from whining). How can i achieve that/
[18:19:53] pontiki: you don't delete bundler
[18:19:58] roamingdog: no no, delete Gemfile.lock, and then run 'bundle'
[18:20:31] Scriptonaut: tetraktys: jus tput it in a module and include
[18:22:23] sarink: how do you guys perform User model tests with minitest and devise? Because you can't put a "password" in your users.yml since it has to be run through User.new to get the devise hooks that encrypt/store the password
[18:22:44] tetraktys: Thanks Scriptonaut i already tried that, but forgot to restart the webserver :)
[18:23:41] pontiki: don't use fixtures
[18:24:08] sarink: pontiki: too late for that...
[18:24:18] pontiki: obviously it's not working
[18:24:31] sarink: because i'm not going to refactor every test in the application today?
[18:24:39] pontiki: who said you had to do that?
[18:24:49] sarink: i'm not having this argument..
[18:24:50] philcrissman: sarink: you don't need to refactor them all, just don't use fixtures for this one test.
[18:25:07] sarink: oh, i thought he was suggesting throw fixtures away and use factorygirl, or something
[18:25:32] sarink: sorry. so i just do a User.new in the test itself and not use a fixture
[18:25:34] tubbo: nah sarink, you can use both in tandem. very helpful. alternatively, if you JUST need it for User, you could simply `User.create` for just this test, which is just how FG works.
[18:25:35] philcrissman: you can use factory_girl (if you want) without throwing away fixtures.
[18:25:57] philcrissman: they can both exist in a test suite. You can choose to use one or the other where they make the most sense.
[18:26:01] philcrissman: and cause the least pain.
[18:27:01] tubbo: Scriptonaut: don't delete Gemfile.lock, delete the gems that bundler installe.d
[18:27:03] tubbo: installed*
[18:27:23] sarink: is there some clever way i could use erb inside the users.yml
[18:27:33] Scriptonaut: Hmm, I Just gem installed rails, and it finished with: file 'lib' not found
[18:27:44] savish: Can some one tell me how you pass, properly, arguments into rake tasks? Because either Im doing it wrong or maybe they don't work with jruby? http://stackoverflow.com/questions/28199598/not-setting-arguments-properly-in-rails-tasks - Although I bet I am doing it wrong.
[18:27:56] Scriptonaut: tubbo, I tried that too
[18:28:06] Scriptonaut: I can't tell you the number of times I deleted activesupport
[18:28:09] bricker: Scriptonaut: maybe just blow away your ruby and reinstall to start fresh
[18:28:15] Scriptonaut: thats' what I did
[18:28:27] Scriptonaut: but for some reason I'm getting: file 'lib' not found when I gem install rails
[18:28:31] workmad3: Savish: rake task_name[arg1, arg2]
[18:28:38] philcrissman: sarink: I'm pretty sure if you put it there it will just work.
[18:28:44] workmad3: Savish: if you're using zsh, you need to do 'rake task_name\[arg1,arg2]
[18:28:45] bricker: Scriptonaut: never seen that before
[18:28:57] Scriptonaut: hmm, seems to work, oh well
[18:29:34] workmad3: Savish: 'rake create_api_key "xaaron_test" ' would first run the task 'create_api_key' and then the task 'xaaron_test' ;)
[18:30:20] philcrissman: sarink: it's in the rails guide about testing/fixtures. You can just put erb in a fixture.
[18:31:25] workmad3: Savish: also put that as an answer to your SO question ;)
[18:32:00] sarink: philcrissman: yeah you can, but with User.new you can pass :password in the hash (and then i assume there's some devise before_hook that encrypts and converts it to encrypted_password) there is no 'password' column on the user model. so that is the problem
[18:32:33] jglover: So, I need to send an email to clients the first time they've reached 10 views. If for now we consider a view, any controller#show hit (don't want to overcomplicate yet), whats the best way of storing that data? we have enough traffic that I think it would be a bad idea to be persisting that to mysql every single time. Maybe I'm wrong though. Ideas?
[18:32:50] philcrissman: sarink: again, if you're specifically testing the password, I wouldn't use a fixture. But that's just me. Also, are you sure you're not just testing something that's part of devise?
[18:33:18] workmad3: sarink: I believe devise just overrides 'password' to store a hashed version in 'encrypted_password' (also, it annoys me that they called the column encrypted_password... it's not encrypted, it's hashed using a secure one-way hashing function!!!)
[18:33:22] philcrissman: I don't remember what we did, but I've done several projects that used devise, everything was tested, and I don't ever remember having any problems.
[18:33:51] philcrissman: this was awhile back. I'm sure the googles has better information than I can recall.
[18:34:05] philcrissman: and I think workmad3 is correct, that sounds familiar.
[18:35:14] tetraktys: I'm probably thinking too easy, but this: https://gist.github.com/joostvanrijn/8736c55203d16a6ad047 will not actually give me state machine methods on a member object
[18:36:09] tetraktys: btw: the files are in app/models/member.rb and app/state_machines/member_state_machine.rb
[18:39:29] smathy: tetraktys, you need to run the aasm in an `included { }` block/callback - use concerns to make it simpler.
[18:40:51] tubbo: jglover: first of all, you probably want to omit any self-views, that is, the customer viewing their own page
[18:41:02] tubbo: jglover: and secondly, it might be better to store that data in redis
[18:41:52] jglover: tubbo: thanks. I probably won't omit any types of views. It's just an email we send out that says "Hey! Good for you! 10 people! Maybe you should take this website very seriously!"
[18:42:06] rhizome: or they hit reload 10 times
[18:42:11] tubbo: jglover: so if i refresh the page 10 times on my own website, i get that email?
[18:42:21] jglover: tubbo: not your own, its a profile on our website
[18:42:33] tubbo: jglover: whatever. if i refresh my profile page 10 times, i get an email?
[18:42:41] jglover: tubbo: the first time, yes
[18:42:43] smathy: jglover, you're worried about writing to your DB, so you're getting like thousands of hits per second?
[18:42:57] rhizome: i would choose a different metric
[18:43:14] tubbo: jglover: yeah smathy has a good point, you don't have to worry too much about that...you can simply update_attributes views: views+1
[18:43:33] rhizome: or set up a redis cluster
[18:43:46] rhizome: tomato tomahto
[18:44:02] jglover: Hm ok. These are good points. Thanks guys
[18:47:16] nahtnam: Yay! I got Rubymine for free! :)
[18:47:49] workmad3: nahtnam: congrats? :P
[18:48:04] nahtnam: :P workmad3 Pros of being a student
[18:48:48] workmad3: nahtnam: student eh? you've got plenty of time to learn vim then :P
[18:49:02] nahtnam: workmad3, I cant work with a terrible ui. I just cant.
[18:49:20] workmad3: nahtnam: so why are you happy about having rubymine? </troll> ;)
[18:49:31] Scriptonaut: Vim has such a steep learning curve (at least it did for me)
[18:49:34] Scriptonaut: but was SOOOO worth it
[18:49:37] savish: workmad3, the problem is if I do bin/rake create_api_key xaaron_test, args is still {}
[18:49:49] workmad3: Savish: right... but that's *wrong*
[18:49:53] workmad3: Savish: as I've said
[18:49:53] savish: oh now I see
[18:49:58] savish: I just saw your answer on stack
[18:49:59] Scriptonaut: I remember getting so mad in college forcing myself to use vim for assignments
[18:50:09] Scriptonaut: first month or so was incredibly painful
[18:50:12] workmad3: Savish: I also said it here :P
[18:50:39] skinux: Could someone please help with this? I tried checking the log, but it's empty. https://gist.github.com/skinuxgeek/61cf9f0ca25dc9359712
[18:50:48] workmad3: Scriptonaut: heh :) I geared myself up for total vim-mersion... by using nano for a month beforehand to get myself used to always using the terminal ;)
[18:51:11] theRoUS: rails 4, mongoid 4. i have a controller which isn't tied to specific models. it has a method #upload with a route that correctly directs things there. when #upload has finished processing, it should render a summary of what it did (records inserted, changed, etc.), typically in json.
[18:51:38] Scriptonaut: workmad3: oh god nano. Nowadays I really only ever use one GUI application, the browser
[18:51:42] Scriptonaut: everything else is done with curses :P
[18:51:59] Scriptonaut: I chat on irssi, I code in vim, and then I use the terminal for everything else
[18:52:08] workmad3: Scriptonaut: I have spotify running as a separate app too
[18:52:33] bricker: workmad3: LOL you don't use the vim plugin for spotify?
[18:52:34] workmad3: hmm... time for food
[18:52:36] bricker: workmad3: I thought you were cool
[18:52:40] Scriptonaut: At work I don't have a good music option really. At home I have a media server, I tend to just use the default music player on whatever OS I happen to be using
[18:52:44] theRoUS: #upload ends with a render(:status => (one of :success, :updated, :created). however, i'm getting a 500 response with the summary as the body.
[18:52:57] workmad3: bricker: cool kids don't try to turn vim into emacs :P
[18:53:00] Scriptonaut: there's actually a spotify plugin? haha
[18:53:32] theRoUS: the correct view (upload/show.json.erb) is being processed, but something is evidently not correctly finalising the transaction.
[18:53:36] bricker: workmad3: in case you thought I was joking: https://github.com/takac/vim-spotifysearch
[18:53:46] workmad3: bricker: I didn't think you were joking
[18:53:55] bricker: theRoUS: what does your log say?
[18:53:58] workmad3: bricker: but I don't think my text editor should do everything... it's not emacs, and that's good :P
[18:54:06] bricker: workmad3: I was joking, btw
[18:54:31] theRoUS: bricker: unrevealing:
[18:54:34] theRoUS: Rendered upload/show.json.erb (0.7ms)
[18:54:34] theRoUS: Completed 500 Internal Server Error in 8ms (Views: 2.4ms)
[18:54:38] tubbo: vim took me a while to learn :)
[18:54:42] tubbo: but i'm glad i did
[18:55:11] theRoUS: tubbo: just think! now that you know vim, you can use ex ! :-)
[18:55:12] bricker: theRoUS: is this in production?
[18:55:35] theRoUS: bricker: production environment, but loglevel is set to debug.
[18:55:45] bricker: theRoUS: can you reproduce in development?
[18:56:11] workmad3: theRoUS: you're getting the correct summary out you say? it's just the status code that's incorrect?
[18:56:15] theRoUS: bricker: probably, but it'll take a while; this is an openshift app
[18:57:13] bricker: theRoUS: :success and :updated aren't valid keys for status
[18:57:21] theRoUS: workmad3: yeah. it's as though it was render(:status => 500, :template => 'upload/show.json.erb')
[18:57:22] workmad3: ^^ that's what I was thinking
[18:57:31] bricker: theRoUS: Rails maps those to HTTP status codes, there isn't a code for :updated and the one for 200 is :ok
[18:58:13] workmad3: bricker: I was about to dig into rails code to double-check that an unmapped symbol for status ends up as a 500 :)
[18:58:34] workmad3: but that's most likely the issue...
[18:59:37] skinux: What is the command to launch built-in testing server?
[18:59:42] bricker: workmad3: I think you'd have to look at Rack too
[19:00:18] tubbo: skinux: you thinking of `rake test`?
[19:00:19] bricker: workmad3: Rack::Utils.status_code(:updated) #=> 500
[19:00:25] tubbo: it doesn't "run a testing server", it just runs tests.
[19:00:37] safetypin: i broke my rails installation - i didn???t know about rvm and i tried to install an older version of rails to get some old code running..
[19:00:38] skinux: Whatever it is that makes 'localhost:3000' work
[19:01:02] tubbo: skinux: oh, that's `rails server`. also rtfm man.
[19:01:06] safetypin: now, when i try to start the server, it says: Rails is not currently installed on this system???
[19:01:19] safetypin: but, when i type ???which rails??? it says /usr/bin/rails
[19:01:36] safetypin: does anyone have any suggestions for trying to get this to work?
[19:01:36] bricker: workmad3: https://github.com/rack/rack/blob/master/lib/rack/utils.rb#L649 *high-five*
[19:01:51] arup_r: What's the other way around to write the same line - get :print, action: :print_kitchen_menu, as: :print
[19:01:58] skinux: 'rails server' shows usage information
[19:02:08] tubbo: safetypin: you can just reinstall the rails gem. type `rails --version` to see what version it's running
[19:02:29] workmad3: bricker: aha :)
[19:03:03] safetypin: i???ll try that again..
[19:03:13] philcrissman: skinux: wut. what version of rails are you using?
[19:03:27] arup_r: any help on me ?
[19:03:32] philcrissman: wait, are you _in_ your rails root?
[19:03:48] theRoUS: bricker, workmad3: that was it. d'oh!
[19:03:55] theRoUS: workmad3++
[19:04:13] skinux: What do you mean? I'm in a directory for a site I downloaded
[19:04:22] theRoUS: bricker, workmad3: either of you mongoid users, or know of a mongoid maven?
[19:05:00] theRoUS: ACTION grumbles; bah, RestClient treats 208 Already Reported as an exception rather than a success
[19:05:17] philcrissman: skinux: if you're getting usage information, rails believes you are not in a rails application.
[19:05:56] philcrissman: If I just, go to a directory and type, `rails server`, I'll get usage info because rails is trying to help me create a rails app.
[19:06:08] philcrissman: if you're inside a rails app and run `rails server`, you start the server.
[19:07:12] philcrissman: arup_r: I don't know what you're asking.
[19:08:03] mwlang: I???m working on a Rack endpoint controller (i.e. Rails MetalController) ??? an action method exists? For example: MyController.action(:index).call(env) actually has an #index action defined. Of course I can just call it and handle the ???not found??? exception, but I figured it might be more prudent to just check that its defined before calling.
[19:08:49] Scriptonaut: I don't think my understanding of render is complete yet. Can people tell me some of the differences between redirect_to and render?
[19:09:02] Scriptonaut: what do things like: render person.errors mean, in the controller of a remote action
[19:09:04] arup_r: How can I write the below route in another way ?
[19:09:10] Scriptonaut: or in the remote action of a controller*
[19:09:18] arup_r: get :print_clients, action: :print_clients_menu, as: :print_clients
[19:09:33] philcrissman: Scriptonaut: render does not redirect. It just renders a view. redirect redirects to a new url, ergo a new action.
[19:09:58] philcrissman: arup_r: maybe read the routing guide?
[19:09:59] Scriptonaut: oh, so that's why when you render an action, it is really just rendering the view with a name associated with that action?
[19:10:01] helpa: http://guides.rubyonrails.org/ - Ruby on Rails guides. Recommended reading.
[19:10:04] tubbo: Scriptonaut: the difference is 103
[19:10:08] tubbo: sorry, 102
[19:10:16] Scriptonaut: what does that men?
[19:10:18] tubbo: render returns a 200, redirect_to returns a 302 :)
[19:10:24] philcrissman: tubbo: hahahaha
[19:10:31] tubbo: so the difference between render and redirect_to is 102.
[19:10:46] Scriptonaut: huehuehue funny
[19:10:54] tubbo: trololol :)
[19:10:55] bricker: tubbo: that's not funny.
[19:11:06] bricker: /ban tubbo
[19:11:11] helpa: bricker: minaswan motherfucker
[19:11:11] tubbo: bricker: !tubbo
[19:11:12] arup_r: I was reading.. Not getting what I am looking for.. or may be I am overlooking :p
[19:11:13] philcrissman: 404 humor not found
[19:11:16] helpa: Radar, you should ban the person highlighted, signed bricker.
[19:11:16] bricker: !ban tubbo
[19:11:21] tubbo: haha love it
[19:11:22] hamster88: I have created a todo list rails project under my /var/www/html . When i try to access "http://localhost:3000/todo_list" i get a routing error like this No route matches [GET] "/todo_list Rails.root: /var/www/html/railsproject/todo
[19:11:34] tubbo: ray dar plz ban kthx
[19:11:50] skinux: Spree obviously isn't a web application.
[19:11:59] Scriptonaut: but a render is really doing an http request/redirect isn't it?
[19:12:07] tubbo: skinux: correct. it's a plugin, made up of a collection of engines. :)
[19:12:28] skinux: A plugin for what?
[19:12:40] tubbo: hamster88: hmm, can you paste your routes.rb file? your controller is app/controllers/todo_list_controller? why isn't it todos_controller?
[19:12:45] tubbo: skinux: a plugin for rails? :)
[19:12:58] safetypin: tubbo: do you have a suggestion if uninstall/reinstalling rails doesn???t work?
[19:13:05] hamster88: tubbo, sure, let me paste.
[19:13:06] tubbo: safetypin: define "doesn't work".
[19:13:21] skinux: The other problem I'm having is running Fat Free CRM. https://gist.github.com/skinuxgeek/61cf9f0ca25dc9359712
[19:13:23] safetypin: tubbo: i get the same message ???Rails is not currently installed???
[19:13:25] philcrissman: arup_r: why do you have to write it differently? What are you trying to figure out?
[19:13:57] safetypin: which rails still says ???/usr/bin/rails"
[19:14:11] arup_r: I got it http://guides.rubyonrails.org/routing.html#naming-routes
[19:14:14] safetypin: rails ???version says it???s not currently installed
[19:14:25] arup_r: I thought there is another technique for this
[19:14:30] arup_r: so curious
[19:14:33] tubbo: safetypin: right, that's OK actually. the "Rails is not installed" msg means mac os x couldn't find rails. it's hiding a less-understandable error. so i think you need to use rvm to select the ruby it's installed to.
[19:14:47] hamster88: tubbo, here is the routesfile : http://pastebin.com/ELq26T5b
[19:14:58] tubbo: sorry hamster88 i should've specified gist.
[19:15:01] safetypin: tubbo: okay, i???ll look into that.
[19:15:07] boombadaroomba: i think tubbo is on the right path, thats what i was going to recomend
[19:15:08] philcrissman: arup_r: you could use match, I guess. that's in the routing guide, I'm sure
[19:15:08] mwlang: nvm, figured it out: FooController.instance_methods.include?(:bar)
[19:15:27] tubbo: ahh ok hamster88 i see your problem. this line, `resources :todo_lists`, defines a route called /todo_lists, not /todo_list. you aren't pluralizing it.
[19:15:28] safetypin: tubbo: if i???m not currently using rvm (not installed) then, I should install it?
[19:15:34] tubbo: safetypin: yes.
[19:15:46] boombadaroomba: safetypin, yeah you should
[19:15:48] tubbo: safetypin: actually, i really like chruby and ruby-install. more simple.
[19:15:57] tubbo: rvm is a little too much for what i need
[19:16:03] hamster88: tubbo, so i am suppose to write todo_lists instead of "todo_list" right?
[19:16:08] roamingdog: with tubbo i agree
[19:16:09] tubbo: hamster88: right.
[19:16:12] philcrissman: mwlang: I haven't tried this, but I think you might also be able to FooController.new.respond_to?(:method)
[19:16:22] tubbo: boombadaroomba: ?
[19:16:36] philcrissman: Though, new might require arguments which would make your version simpler.
[19:16:46] mwlang: philcrissman: I started to do that then wondered why absorb that instantiation penalty?
[19:16:52] boombadaroomba: boombadaroomba, it was a joke. I never heard anyone say that
[19:16:55] philcrissman: sure, that makes sense
[19:16:56] hamster88: can i change it to todo_list (I am new to RoR).
[19:17:19] tubbo: hamster88: you can, but do you actually have a TodoList object or is this just a controller for todos?
[19:17:32] mwlang: poking through the docs, I found the #instance_methods and that worked like a charm.
[19:17:42] philcrissman: mwlang sweet. :)
[19:17:56] tubbo: hamster88: it would be better if it was `resources :todos`, with an additional "vanity route" `get '/todo_list' => 'todos#index'`.
[19:18:02] philcrissman: yeah, :instance_methods and :methods are handy
[19:18:19] tubbo: hamster88: that way you could do /todo_list, but when you need a single todo you can just /todos/1.
[19:18:38] tubbo: boombadaroomba: you never heard anyone said what?
[19:18:42] safetypin: tubbo: can i use chruby & ruby-install to manage rails versions, then?
[19:18:46] hamster88: tubbo, thanks for explaining and help :) as i said ia m completely newbie to this.
[19:18:59] tubbo: safetypin: yes you can. it works very similar to rvm, except no gemsets and no weird shell scripting things.
[19:19:18] sniperh4x0r: any experienced ruby devs here that want to give their advice on how to progress in the field? i'm a newbie.
[19:19:21] hamster88: is there any list where i can find all the scaffolds that ruby has to offer?
[19:19:29] hamster88: ruby on rails*
[19:19:31] makerop: sniperh4x0r, write code
[19:19:51] philcrissman: sniperh4x0r: I have tons of advice but I don't know if you'll like it. :)
[19:20:17] sniperh4x0r: honestly that is good advice makerop i get what you're saying a lot of it is just going straight into it
[19:20:29] philcrissman: sniperh4x0r: sorry. Seriously, start by just creating a small app. If you've already done that, try one that's a little more ambitious.
[19:20:34] makerop: sniperh4x0r, I like to pick a 2-3 concepts, and an "idea"
[19:20:46] makerop: and code the idea focusing on those conccepts
[19:21:21] makerop: one thing i don't do enough is write tests, so im coding up a site that will send a post card to a neighbor anonymously, and trying to get 100% coverage
[19:22:09] sniperh4x0r: makerop: so it sounds like you don't even care if the stuff you make is not going to be largely used by anyone?
[19:22:12] sniperh4x0r: you just making it to make it?
[19:22:37] philcrissman: makerop: I wouldn't worry about 100% coverage. But lots of tests, for sure. 100% coverage is a bit of a fluff metric. You can have 100% 'coverage' and still have scenarios that aren't tested.
[19:22:44] makerop: if Im trying to learn enforce or learn a coding concept, yes
[19:23:14] boombadaroomba: tubbo, that rvm is too much for what you are trying to do, which is install rails
[19:24:16] sniperh4x0r: alright, i think i have an idea of how to progress forward. i'm going to review the basic ruby guide on the current official site. Then pick my best idea from a startup ideas list i created and see if i can implement that. Then when i'm done with that i'll throw it on my portfolio.
[19:24:20] sniperh4x0r: and start applying to places
[19:24:42] tubbo: boombadaroomba: well, rvm is really useful for managing rubies alongside gemsets and other things. but i don't need gemsets, i use bundler and keep all the gems in ./vendor/bundle.
[19:24:45] safetypin: tubbo: since i???m not migrating from another ruby version manager, (i used homebrew to install a newer ruby) should i point chruby at /usr/local/bin or the Cellar?
[19:25:02] philcrissman: boombadaroomba: well... If you don't need multiple versions of ruby, I can easily see why you might not need rvm.
[19:25:05] tubbo: boombadaroomba: all i really need it to do is symlink binaries and stuff so it points to different versions of ruby. rvm does way more than that.
[19:25:07] makerop: sniperh4x0r, you asked about learning coding
[19:25:13] sniperh4x0r: although i bet a lot of you guys here would want to make your own startup business and have it generate you your salary which would be so cool to do
[19:25:19] makerop: if your goal is to own/run a company, my advice is different
[19:25:28] tetraktys: smathy, your suggestion on using a concern worked perfectly! thanks
[19:25:29] tubbo: safetypin: just install chruby with homebrew...
[19:25:39] smathy: tetraktys, you're welcome.
[19:25:39] tubbo: safetypin: you can install ruby-install *and* chruby with homebrew.
[19:25:43] philcrissman: sniperh4x0r: yeah, that's sort of a different question.
[19:25:49] safetypin: tubbo: already done, but chruby doesn???t show any rubies
[19:25:55] safetypin: do i need to restart?
[19:25:56] sniperh4x0r: yea good point it is
[19:26:00] tubbo: safetypin: you have to install them with ruby-install...
[19:26:37] makerop: if you want to start a business, come up with something that is worthless
[19:26:39] makerop: and try to sell
[19:26:47] hamster88: if i am defining something like " root "todo_lists#index" " in routes.rb file, does it means it will let me access the app just by using "localhost:3000" or what?
[19:26:47] tubbo: safetypin: fwiw you *can't* use chruby/ruby-install to manage rails versions. you can use it to manage ruby versions though.
[19:27:02] safetypin: tubbo: but ??? my problem is rails versions
[19:27:08] sniperh4x0r: that sounds like terrible advice lol but at the same time i get where you're coming from i hope
[19:27:25] sniperh4x0r: i just say that becuase you can't believe what you're making is worthless
[19:27:31] makerop: no, you can
[19:27:39] tubbo: safetypin: i'm confused, you aren't using rvm?
[19:27:43] safetypin: tubbo: no..
[19:27:45] makerop: and you learn how to sell faster
[19:28:09] sniperh4x0r: yea an easy way to sell faster tho is to believe in your product ;)
[19:28:15] tubbo: safetypin: okay...well regardless i'd recommend installing it. how is `gem install rails` working then? is which gem pointing to /usr/bin?
[19:28:21] sniperh4x0r: but i get why you would think it's worthless
[19:28:24] makerop: sniperh4x0r, not true
[19:28:28] safetypin: sniperh4x0r: getcashboard.com is a great example of a guy who started a business with a rails app
[19:29:00] Scriptonaut: I have this page with a form that has data-remote="true". How do I determine I'm getting a response from the action that form goes to? I want to run a piece of JS (Google AdWords or something)
[19:29:13] Scriptonaut: there must be a way, some other JS is running but I can't figure out where
[19:29:30] safetypin: tubbo: well, gem install rails has given me an error, so i used sudo (i didn???t think I did that initially) and it seemed to install fine, no errors, but it continues to tell me rails isn???t currently installed
[19:29:50] safetypin: also, when i type ???which rails??? i get /usr/bin/rails
[19:30:06] tubbo: safetypin: yeah, you might not want to do that. `sudo gem install` will try to install it to the global system gemset and you might not want that. for example, if a new version of ruby is released...
[19:30:27] safetypin: tubbo: maybe i need to sudo gem uninstall?
[19:30:31] tubbo: safetypin: in my opinion, you should use chruby/ruby-install to manage your ruby version, and then `gem install rails` will work because your ruby will be installed to your home dir. your issue here realistically is permissions..
[19:30:36] sniperh4x0r: safetypin: to be honest something like that seems overwhelming to create. but at the same time everything is done one step at a time.
[19:31:03] sniperh4x0r: safetypin: you seem well versed at startups
[19:31:09] safetypin: safetypin: hardly
[19:31:14] safetypin: sniperh4x0r: hardly
[19:31:18] sniperh4x0r: i am a beginner at ruby xP are views are gonna be different
[19:31:30] tubbo: sniperh4x0r: just make stuff and have fun with it, don't worry about building a product lol
[19:31:41] sniperh4x0r: that is really good advice
[19:31:44] tubbo: until you're bored with just making stuff, then figuring out how to make a product is really fun
[19:32:18] sniperh4x0r: i'm getting to distracted with getting laid on tinder though >_>
[19:32:34] Scriptonaut: you're not kidding :D
[19:32:41] Scriptonaut: man tinder is popular nowadays
[19:32:50] Scriptonaut: what a great idea honestly
[19:34:11] safetypin: tubbo: with ruby installed in my home directory, where will rails be installed?
[19:34:17] boombadaroomba: tubbo, i joined conversation late. LIke a child who wanders into the middle of a movie and wants to know
[19:35:49] smathy: Scriptonaut, you're impressed with a dating app?
[19:35:56] arup_r: I want to write one query - what are the dishes each client booked for today.. Any pointer how to proceed? https://gist.github.com/aruprakshit/4b973a554faf31cb2cb1
[19:36:17] Scriptonaut: smathy: more the fact that it's more based on casual hookups
[19:36:25] safetypin: sniperh4x0r: i started as an intern for a guy who ran his own web design company, he hired me for several years, and then i went independent and continued to do freelance work for him, then i happened to land a contract with a non-profit, and it turned out that i got along really well with the people there, and they hired me full time.
[19:36:43] smathy: ACTION thought that's what dating was, but ok
[19:37:53] sniperh4x0r: sounds like you started small and grew
[19:38:11] sniperh4x0r: Did you do ruby when you were working for that first design company?
[19:38:22] rushed: arup_r: what have you tried so far?
[19:38:24] safetypin: sniperh4x0r: running my own business was a nightmare, partly because of what i was trying to do. i feel like the time of small businesses who provide custom web sites to other small businesses is dead and gone
[19:38:48] safetypin: sniperh4x0r: i???ve never done ruby professionally
[19:39:16] safetypin: sniperh4x0r: professionally, i maintain and develop a Drupal web site (PHP)
[19:39:44] arup_r: rushed: I tried lots of things ... nothing worked.. Actually not able to link up how to proceed ? That's the problem.. and I said *pointer*
[19:39:45] safetypin: along with some other miscellaneous technical tasks
[19:39:46] sniperh4x0r: yea, i'd imagine. I did free lance work for a small business that made sites for other businesses
[19:40:06] sniperh4x0r: the said small business isn't doing so great ;p
[19:40:33] sniperh4x0r: we all need to figure out where the real $ is hiding
[19:40:35] rushed: arup_r: you might gist something that didn't work along with the error, there is nothing irc likes better then a wrong answer to correct :)
[19:40:45] safetypin: i was in a sales meeting with other small business owners, and this lady came in and said, we can give your business a web site for $45/mo (this was several years ago). ???and if you don???t have content, that???s okay, we???ll create it for you???
[19:41:27] arup_r: Those are non sense query.. which wouldn't work.. :)
[19:41:39] safetypin: i???m not even sure if wix.com was available then, but they???ve (along with squarespace.com) really put small web site design in the grave.
[19:41:57] arup_r: I am not able to understand which table to joins and which are not.. All seems are linked with each other.. Frustrating
[19:42:11] skinux: Will someone please help me figure this out??? https://gist.github.com/skinuxgeek/61cf9f0ca25dc9359712
[19:42:49] makerop: arup_r, http://i.stack.imgur.com/1UKp7.png
[19:43:23] makerop: skinux, what OS?
[19:43:29] skinux: Ubuntu Linux
[19:43:33] makerop: you are missing some libs
[19:43:40] Scriptonaut: hey guys, how in a controller can I render a remote js file?
[19:43:46] makerop: skinux, try : sudo apt-get install libxml2-dev libxslt1-dev
[19:43:47] Scriptonaut: <script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
[19:43:51] Scriptonaut: I need to add that to markup
[19:44:06] smathy: skinux, didn't someone already point you to the github issue for that error?
[19:44:09] Scriptonaut: just append it to dom with jquery?
[19:44:27] skinux: Yes, the answer at that link didn't fix it.
[19:45:10] smathy: skinux, I assume you're using rails_apps_composer ?
[19:45:14] makerop: Scriptonaut, wouldnt you just want a JS tag?
[19:45:42] Scriptonaut: ya, but I only want that js running if I reach a certain remote action
[19:45:46] Scriptonaut: it's a google adwords thing
[19:45:55] Scriptonaut: I only want it on the page if the user signs up for this specific thing
[19:46:01] skinux: I'm not trying to create an app, I'm trying to try out an open source site I downloaded.
[19:46:05] Scriptonaut: (I don't know crap about google adwords, that's what the marketing team told me)
[19:46:31] makerop: Scriptonaut, something like this https://gist.github.com/fixblocker/ccf08c72530db6a7b43c
[19:46:32] safetypin: Scriptonaut: i would consider providing an array with the location of the js file in the controller (conditionally) and then test/render the tag in the view.
[19:46:52] Scriptonaut: safetypin: that was my initial idea
[19:47:00] smathy: skinux, ok, so you're trying to run a site that's using rails_apps_composer ?
[19:47:02] Scriptonaut: but ivars aren't showing up in my file
[19:47:06] Scriptonaut: since it's remote
[19:47:17] Scriptonaut: the only way I've been able to get js to run is: render js: blah
[19:47:17] skinux: I'm trying to run Fat Free CRM.
[19:48:01] Scriptonaut: I have no idea how the page knows when the ajax call responds
[19:48:06] Scriptonaut: I can't find the code, where do people put that?
[19:49:44] smathy: skinux, right, so you said before that you did what that issue said but you still got the same error. But the error you've gisted still shows you using ruby 1.9.1
[19:50:04] arup_r: makerop: That's so much :) Thanks
[19:50:17] skinux: I installed Ruby from Ubuntu distro.
[19:50:25] tubbo: skinux: don't do that.
[19:50:28] arup_r: It seems like mine is too complex query.. I need to do it by myself.. :)
[19:50:45] tubbo: skinux: use a version manager like chruby or ruby-install, never install ruby from APT or any other pkg manager.
[19:50:47] helpa: skinux: Ubuntu, Ruby, ruby-install, chruby, Rails setup guide: http://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you/ - Gauranteed to work 100% of the time or your money back!
[19:50:47] tubbo: skinux: !ubuntu
[19:51:40] skinux: Okay, so I need to download ruby-install?
[19:51:53] tubbo: skinux: read the guide
[19:52:01] tubbo: trust me, it works (i've used it) and Radar wrote it
[19:52:37] tubbo: skinux: you came here to learn rails, not fuck with how ruby is installed. so get ruby up and running properly, then go back to ffcfm and it should work a lot better.
[19:53:05] Denarii: Anyone have experience with batsd?
[19:53:50] arup_r: rushed: I'll write mine and come back to you guys...
[19:54:29] arup_r: One more questions.. Did anybody use .odt file inside the views/ and the render it ?
[19:54:32] smathy: skinux, I'm not seeing anything on the Fat Free CRM site about ruby version or rails_apps_composer, I'd ask in the user group mailing list.
[19:55:43] tubbo: skinux: i was just abbreviating 'fat free cfm'.
[20:02:50] rhizome: skinux: 1. use ruby 2; 2. install libxml2 separately
[20:03:14] arup_r: rushed: Why `menus`.`destroyed_at` IS NULL is coming while I am doing Client.joins(menus: [:dishes]) ? https://gist.github.com/aruprakshit/4b973a554faf31cb2cb1
[20:08:43] rhizome: default_scope?
[20:12:06] nooteh: anyone has experience with rails 4 + paperclip + S3? I cannot find any way to delete images, not with nil, destroy, nothing???
[20:13:58] jobewan: I hate to post this in here, but I hope someone can help via potentially seeing the same issue on a different project... so, trying to setup a new dev "foreman" env per the guide and at rake db:migrate, I get the error: LoadError: cannot load such file -- test/unit/testcase
[20:14:33] jobewan: any ideas? I'm not big into ruby or rails dev work, so this is a bit puzzling to me
[20:14:53] jobewan: I believe it has something to do w/ minitest, but not sure how to troubleshoot...
[20:15:29] smathy: jobewan, maybe a gem in your Gemfile that should be in the `:test` group but isn't, or should have a `require: false` ?
[20:15:33] rushed: jobewan: "the guide" isn't a unique identifier :) does test/unit/testcase exist?
[20:15:57] jobewan: apologies... guide: http://theforeman.org/contribute.html
[20:16:13] smathy: jobewan, also, check your Rakefile, some evil developers put test shit in there without thinking about the other places `rake` is used.
[20:16:33] jobewan: well, there is no test/unit/testcase in the project
[20:17:15] smathy: jobewan, after the error above you were expecting there to be one?
[20:17:53] jobewan: lol, well, I was honestly thinking that it was a relative path to a gem and not the project, but I just saw the "light"...
[20:18:29] Scriptonaut: guys, does anyone know how I can have a JS script in my markup, *IF* a certain thing happens in my action (that is remote, so I can't set instance variables)
[20:18:45] Scriptonaut: right now, it just renders a javascript, but I can't put my code in there because for some retarded reason javascript has no include
[20:19:09] rushed: Scriptonaut: you might find an example helpful http://railscasts.com/episodes/324-passing-data-to-javascript
[20:19:12] Scriptonaut: and my code involves executing some javascript, and also having htis in the markup: <script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
[20:19:24] tubbo: Scriptonaut: conditionally including JS is usually an over-engineered solutoion. JS can easily be made to just not execute when certain pages are loaded
[20:19:36] Scriptonaut: it's all the same page tubbo
[20:19:43] Scriptonaut: There is ajax calls going on
[20:19:52] tubbo: Scriptonaut: so you want to load certain JS files when an action takes place on a page?
[20:20:17] Scriptonaut: it's already loading a file, that does something imperative. I'm wondering how can I add addition stuff to the page. I'm getting close to just using jquery to append this stuff to the body
[20:20:20] tubbo: Scriptonaut: why can't you load the JS files no matter what, then just execute the code in those files when you need it?
[20:20:41] tubbo: Scriptonaut: why can't that file wrap the imperative code in a function, then you just execute the function when you need to?
[20:20:57] Scriptonaut: I guess I could do that
[20:21:05] jobewan: my pastebin... http://pastebin.com/aLYrQCzT
[20:21:22] Scriptonaut: You never know with someone's library (in this case googles), if including it will do anything, or simply give you methods to call
[20:21:41] tubbo: Scriptonaut: well you *can* know, by reading the README/docs.
[20:21:53] tubbo: Scriptonaut: though it also helps to read the JS source itself sometimes...
[20:22:14] jobewan: rather: http://pastie.org/9869173#
[20:24:35] Scriptonaut: wow this google adwords thing seems like a rip
[20:24:44] Scriptonaut: apparently some people pay as much as $60 per click they get
[20:24:45] AxonetBE: I have 2 has many through relations and I save them as sending all the linked ids, now I want to also set for specific ids a second variable, how can I do this?
[20:25:28] rushed: Scriptonaut: apparently some pieces of string are very long
[20:26:51] AxonetBE: here is my gist, https://gist.github.com/DriesS/457a8abd74c6417d9c27 -> as you see I have administrators and managers that I select from a list of users, so I pass administrator_ids and manager_ids, now they are just stored in the reseller_users table but not with the correct level. How can I achieve this?
[20:28:16] rushed: AxonetBE: you might consider using the models (ie build the reseller_user and set the user and attributes you want)
[20:28:42] z3yo: I've a question about the asset pipeline, when you use Bower and have many vendors, how do you manage the path of images and fonts in the js/css files?
[20:28:49] AxonetBE: rushed: sorry don???t follow
[20:28:53] AxonetBE: what do you mean?
[20:30:49] rushed: AxonetBE: reseller.managers.build({ a: 1, b: 2, ...
[20:31:31] rushed: AxonetBE: or in your case reseller.reseller_users.build({ user: ... , level:
[20:32:09] AxonetBE: ok and overwrite the setter administrator_ids and in this setter build the reseller_user with the correct level?
[20:32:41] AxonetBE: is than an option?
[20:35:44] smathy: AxonetBE, yes.
[20:37:26] quazimodo: does warden/devise delegate the actual setting of the session store to some other rack application?
[20:37:26] AxonetBE: smathy: was thinking something like this : https://gist.github.com/DriesS/457a8abd74c6417d9c27
[20:38:01] AxonetBE: but I guess I need before always to delete all the reseller_users of that type because he will be not smart enough to check if already exists, true?
[20:38:23] tubbo: quazimodo: warden runs a rack middleware that handles this stuff, but no i believe it does set the session store within that middleware.
[20:39:06] Scriptonaut: for some reason, if I add more than one line to my js.erb file, and render it, it won't work
[20:39:12] Scriptonaut: it only works if the file has a single line of js
[20:39:23] helpa: Scriptonaut: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[20:39:23] tubbo: Scriptonaut: !dw
[20:39:54] Scriptonaut: I just said what didn't work
[20:40:01] Scriptonaut: the js file only works when I keep it to a single line
[20:40:07] Scriptonaut: otherwise it won't run at all
[20:40:16] tubbo: Scriptonaut: so it just doesn't do anything? no errors?
[20:40:18] rhizome: i bet your js is broken
[20:40:30] quazimodo: tubbo: says in it's setup it needs to be downstream of a session middleware
[20:40:36] Scriptonaut: rhizome, the js was working fine. If I add a console.log, it breaks
[20:40:43] Scriptonaut: if I take away the old js, and leave the console.log, it works
[20:40:48] rhizome: uh huh. now gist
[20:41:03] tubbo: Scriptonaut: you should know by now that a 1-line description of your problem is a waste of everyone's time.
[20:41:19] tubbo: and it makes me upset when people waste my time. just FYI.
[20:41:53] tubbo: Scriptonaut: honestly just saying "having issues with JS: <GIST-URL-WITH-PASTED-CODE-AND-ERROR-BACKTRACE>" is way better than typing out your problem
[20:42:15] Scriptonaut: if I did that, you wouldn't even know what my problem was?
[20:42:26] Scriptonaut: you actually would prefer if I was vague and just said, "Here's 500 lines of code, have fun"
[20:42:33] Scriptonaut: "It doesn't work"
[20:43:04] tubbo: Scriptonaut: you're already being vague, so that part hasn't changed. but i'm saying you should start out with code to paste, not start out with a problem and then think "if i need to paste code i will"
[20:43:14] tubbo: but for the most part, the problem is in the code you wrote, so that's what you should paste.
[20:43:27] rhizome: there's a happy medium. "whats up with this http://gist/blahblahblah" is also annoying
[20:43:41] tubbo: Scriptonaut: but also paste the error output so we know *what* error happened. what i mean by "paste" is paste what you see, don't try and interpret what you see to us...we don't know what you're looking at.
[20:43:44] rhizome: though not as
[20:44:02] tubbo: rhizome: that's only ok if you actually expand upon your problem in the Gist's description
[20:44:04] Scriptonaut: k. There really were no errors, nothing came out, hold on I'll gist
[20:44:57] smathy: AxonetBE, yep, note that you have one `build` and one `build!`, also you don't need the `self.`. Re duplicates, you can resolve that by adding a `-> { uniq }` scope to the `reseller_users`
[20:45:27] Scriptonaut: https://gist.github.com/robins35/b1cd3ffc777b64c64a0f
[20:45:33] Scriptonaut: my guess is it's the <%= stuff
[20:45:47] Scriptonaut: haven't used erb in ages
[20:45:57] tubbo: Scriptonaut: no semicolon
[20:46:00] tubbo: Scriptonaut: see how easy that was? :P
[20:46:04] tubbo: https://gist.github.com/robins35/b1cd3ffc777b64c64a0f#file-gistfile1-js-L2
[20:46:05] xibalba: Scriptonaut, what do you usually do
[20:46:35] tubbo: Scriptonaut: when you say "no errors", do you realize that there is also a JS console to check errors in?
[20:46:39] Scriptonaut: tubbo, isn't js syntactically correct without semicolons since the interpreter adds them anyways?
[20:46:46] Scriptonaut: tubbo I meant in the console
[20:46:51] Scriptonaut: there was (and still aren't) any errors
[20:46:57] Scriptonaut: in the chrome developers console
[20:46:58] tubbo: Scriptonaut: oh yeah duh i saw that console object
[20:47:01] Scriptonaut: xibalba: haml
[20:47:21] Scriptonaut: tubbo: I wish the semicolon was the problem, but same issue
[20:47:27] xibalba: hmm i haven't used haml at all yet
[20:47:29] Scriptonaut: can you not put erb like that in a js.erb file?
[20:47:33] tubbo: Scriptonaut: the ERb is syntactically correct. the other logical conclusion would be that the partial you are rendering is breaking the output.
[20:47:39] Scriptonaut: haml is nice (and also occasionally annoying as hell)
[20:47:44] tubbo: Scriptonaut: check the generated output of that JS file and make sure it validates using jshint or something.
[20:47:56] xibalba: do you find HAML to be significantly more efficient to use than just plain erb
[20:48:09] Scriptonaut: I like it better. Significantly? Nah
[20:48:26] xibalba: looks nicer to read
[20:48:31] towski_: I like sidekiq but I dunno if I can convince my boss to spend $750 for pro
[20:48:39] tubbo: towski_: so don't :)
[20:48:45] tubbo: do you really need pro?
[20:48:46] smathy: Scriptonaut, wait, what now? You're using JS to output ERB?
[20:48:57] towski_: well reliability is important
[20:49:00] tubbo: smathy: my money's on it being a JS response in app/views :)
[20:49:00] towski_: I can't have jobs disappearing
[20:49:06] Scriptonaut: I'm using js to append html to the body
[20:49:18] Scriptonaut: and the erb is just to render the html partial into the append call
[20:49:38] tubbo: Scriptonaut: wouldn't it be easier to have this JS on the page already, and do an ajax request that serves that partial?
[20:49:51] smathy: Scriptonaut, oh right, like in a js.erb file?
[20:50:16] Scriptonaut: tubbo: I only want the JS on that page if this other ajax call is successful
[20:50:24] Scriptonaut: otherwise I don't want it anywhere in the markup
[20:50:44] smathy: ...and what's happening? The content isn't being added?
[20:50:58] Scriptonaut: the content isn't being added, and my console.log isn't happening
[20:51:17] quazimodo: how can we store cookies in plain text
[20:51:22] quazimodo: without encryption/signing
[20:51:33] Scriptonaut: wait di I give you gys the gist
[20:51:42] Scriptonaut: https://gist.github.com/robins35/b1cd3ffc777b64c64a0f
[20:51:42] jglover: Scriptonaut: are there any other errors on the page?
[20:51:44] Scriptonaut: sorry if I didn't
[20:51:47] Scriptonaut: jglover: nope
[20:52:12] tubbo: Scriptonaut: check this out, i would say this is a more JS-idiomatic approach to the problem https://gist.github.com/tubbo/9d2b48101e35039640bf
[20:52:13] smathy: Scriptonaut, yes, so is the fadeout/in happening?
[20:52:29] Scriptonaut: when I have more than one line, nothing happens
[20:52:32] Scriptonaut: it's like all or nothing
[20:52:48] smathy: Yeah, what tubbo said.
[20:52:49] tubbo: Scriptonaut: wherein all of the code is "loaded", but simply not executed until it needs to be. JS is nice because you can define all the actions you'll need, then basically add rules that say "on this event, execute this code"
[20:53:22] tubbo: Scriptonaut: but regardless, i don't think that's your problem here. have you gone into the JS console, checked the Network tab and seen what the *actual* output of this action is? until then you really have no idea what it's doing.
[20:55:11] Scriptonaut: the output of the action is a 200
[20:55:15] Scriptonaut: (is that what you mean?)
[20:55:18] jglover: Scriptonaut: can you summarize the problem for me? It reminds me of something that happened recently
[20:55:20] tubbo: Scriptonaut: nope.
[20:56:07] tubbo: Scriptonaut: when you make a JS action, you're telling rails "when i request /whatever.js, respond with the text in app/views/whatever.js as text/javascript". because it's doing that, the browser will download the response and immediately eval the code.
[20:56:13] Scriptonaut: jglover. Ok so I have this form, it submits an ajax post to my action. My action makes a new thing blah blah, if it's successful, it renders a js.erb file (the file I posted)
[20:56:23] Scriptonaut: however, if I add more than one line in this js.erb file, it won't work
[20:56:31] tubbo: Scriptonaut: so you can actually see what javascript rails is generating
[20:56:51] tubbo: Scriptonaut: go into the network tab and look for your create.js action or whatever action you are sending
[20:56:53] jglover: Scriptonaut: and the js file is the fist you posted?
[20:57:24] Scriptonaut: let me give you a screenshot tubbo I'm not seeing it
[20:58:21] Scriptonaut: ??????http://i.imgur.com/4RqSDoT.png
[20:58:35] tubbo: Scriptonaut: so you *might* want to google some screencasts about how to use the chrome or firefox dev tools properly. if you are primarily a web developer, you need to be comfortable in the dev tools interface. period.
[20:58:44] tetraktys: I have a weird capybara/warden issue: The first scenario in this gist: https://gist.github.com/joostvanrijn/d3c3c7614c6ad78ee601 sometimes fails, because the expected page is not loaded. Instead the login page is being displayed.
[20:58:56] jglover: Scriptonaut: how are you rendering the js? gist or screenshot of render on controller method
[20:58:56] tubbo: Scriptonaut: ok cool! so you can actually click that and it will open up a little tabbed interface. there should be a tab called "Response".
[20:59:01] Scriptonaut: It's really just the networking part I'm bad at, I haven't done much ajax stuff
[20:59:15] Scriptonaut: sorry jglover I'm just using the name inference
[20:59:19] Scriptonaut: my action is called demo_requrest
[21:00:06] tubbo: Scriptonaut: if you click that row of data it will open up a little interface and show you exactly what rails generated and responded.
[21:00:13] tubbo: so. fucking. helpful. omg.
[21:00:14] jglover: Scriptonaut: https://gist.github.com/jonahglover/2f43b184928d798cff73 does your render look something like that?
[21:00:23] tubbo: and useful outside of rails
[21:00:47] jglover: Scriptonaut: try rendering from your controller method like that.
[21:01:08] jglover: action I guess
[21:01:33] jglover: hit the actual route in your browser and it should render the raw js
[21:02:25] jglover: also to make sure that the js is being rendered, at this somewhere in the file <% raise "rendering this file" %>
[21:02:46] pipework: jglover: Why not raise in the controller?
[21:02:52] pipework: Or are you just testing stuff?
[21:02:57] jglover: pipework: either is fine. just testing
[21:03:15] pipework: jglover: Not really. If you raise in the controller, you don't waste time rendering a view that doesn't get used.
[21:04:10] jglover: pipework: we can be sure the view is rendered if we raise in the view
[21:04:15] jglover: .. I think ...
[21:04:59] pipework: jglover: I meant in not-debugging circumstances.
[21:05:12] jglover: pipework: oh I see. I would never raise in a view on prod
[21:05:26] jglover: I just want to see if this js view is being rendered
[21:05:36] pipework: I wouldn't raise in views unless I'm debugging. Regardless of env, just avoid it unless you're debugging.
[21:06:45] bricker: jglover: pry or debugger are good for that
[21:07:07] bricker: jglover: because then not only do you know the view is being rendered, but you can start debugging right away
[21:07:25] jglover: bricker: thanks
[21:12:34] Scriptonaut: I still have no idea what it is, if I take the erb out it works
[21:13:01] tubbo: Scriptonaut: you would if you followed my advice
[21:13:23] jglover: Scriptonaut: do you have a .js and a .js.erb file with the same name?
[21:13:26] Scriptonaut: you mean with your gist?
[21:13:28] Scriptonaut: https://gist.github.com/tubbo/9d2b48101e35039640bf
[21:13:34] ninabreznik: i just figured out that my schema in production and development and not synced. I had some problems with adding and removing one attribute in development and somehow schema didn't want to update the actual state, so i just did rake db:drop and rake db:migrate so it started working again. Super, but this only in development, now same problem is in production. And I have important customer data, so can't just make rake db:dro
[21:13:55] tubbo: Scriptonaut: no. pay attention. " tubbo | Scriptonaut: ok cool! so you can actually click that and it will open up a little tabbed interface. there should be a tab called "Response"."
[21:14:06] jglover: lol tubbo salty
[21:14:38] Scriptonaut: damn tha'ts u seful
[21:15:00] tubbo: Scriptonaut: useful beyond rails, in fact.
[21:15:41] Scriptonaut: I need a decent tutorial on ajax. I used to be pretty good with it, but that was back when it was all done vanilla, with the xmlhttprequest object or w/e it was called
[21:15:54] Scriptonaut: also a good tutorial on how it interacts with rails would be nice
[21:16:17] gabeodess: Hey guys. I???m having trouble in my mailer where it wont use the full URL in my image_tags. Anyone have an idea of what I might be missing?
[21:16:43] smathy: ninabreznik, you need to work out why the schema got out of sync. Can you gist both schema.rb files? The one from your development that's now working, and the one from production showing the broken bit.
[21:16:46] gabeodess: I have this in my development.rb file: config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
[21:16:52] gabeodess: but still no luck
[21:17:02] tubbo: gabeodess: you need { host: 'localhost:3000' }
[21:17:36] tubbo: Scriptonaut: if your comfortable with doing it that way, i would say $.ajax() is really what you need to be looking at (jQuery).
[21:17:37] gabeodess: tubbo: I think the :port option takes care of that??? but regardless, it???s still not including the full url, just the path.
[21:18:21] Scriptonaut: I need to up my jquery skills without a doubt, I've been using it 4 or so years now I have no excuse
[21:18:43] Scriptonaut: so I found the issue I think
[21:18:54] Scriptonaut: basically I rendered a piece of html with double quotes inside double quotes
[21:18:59] Scriptonaut: totally fucked up the js file
[21:19:15] Scriptonaut: this is more of a symptom of how poor my approach is here :|
[21:20:00] tubbo: OHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH WHO CALLED IT
[21:20:17] tubbo: sorry i've been in meetings all day and i'm really bored.
[21:21:04] Scriptonaut: tubbo I dunno, here's the entire response: https://gist.github.com/robins35/e0bdccb18f491873ae13
[21:21:07] Scriptonaut: is that invalid?
[21:21:14] Scriptonaut: shit I hate meetings
[21:21:20] tubbo: sure it is
[21:21:20] Scriptonaut: gives me anxiety
[21:21:23] tubbo: Scriptonaut: tons of double-quotes!
[21:21:49] tubbo: Scriptonaut: if you surrounded the whole thing with single quotes, instead of double quotes, that wouldn't be a problem.
[21:22:04] Scriptonaut: ya. I was thinking that. I hope some guy doesn't try to edit it in the future
[21:22:08] tubbo: console.log('<script type="text/javascript">')
[21:22:35] bricker: "How can we possibly stop someone from breaking this in the future??????"
[21:22:45] bricker: *shrug* prayer, I guess.
[21:22:53] upsell5: write a test!
[21:23:02] bricker: Why didn't I think of that!!!
[21:23:10] tubbo: Scriptonaut: the approach i showed you in the gist should alleviate that issue, just solves it in a way where that's not a problem.
[21:23:29] bricker: upsell5: thank you for playing along
[21:23:34] bricker: ACTION 25 brickercoins to upsell5 
[21:23:51] upsell5: bricker: sorry couldnt??? resist
[21:24:03] Scriptonaut: tubbo: the problem with the thing you wrote (as far as I can tell), is that it will load the code no matter if the person hits the submit button
[21:24:07] Scriptonaut: what if there are errors?
[21:24:33] upsell5: the railsconf has a nice policies page: http://railsconf.com/policies#policies
[21:24:56] upsell5: are rails devs just a bunch of renegades? :)
[21:25:17] Scriptonaut: https://gist.github.com/robins35/7b2f3ccebad1da0cc976
[21:25:18] tubbo: Scriptonaut: i figured you were smart enough to modify my code and handle that kind of thing. it was just to show you an example of how i'd solve the problem, it is definitely not a complete solution.
[21:25:54] tubbo: upsell5: if you look at practically any other conf page for this year, it says that as well.
[21:26:11] tubbo: it's not like addressing a problem with the rails community or anything.
[21:26:16] upsell5: tubbo: i see ok
[21:26:23] Scriptonaut: ooh, I didn't know what $.get was
[21:27:24] tubbo: there is also $.post :)
[21:27:31] Radar: Good morning.
[21:29:54] ninabreznik: Hey smathy Here's the gist https://gist.github.com/ninabreznik/cf6524b880e00bb34a3c
[21:36:00] gabeodess: tubbo: looks like it was to do with Roadie. Needed this configuration: config.roadie.url_options = {host: "my-app.com", scheme: "https"}
[21:43:00] greengriminal: Evening all, I have the following: https://gist.github.com/anonymous/8bd46065d23a9e60736f and I have a #create in my controller which should reply with 'head :ok' now the issue here is when I submit my form it renders a blank page
[21:43:13] greengriminal: I also have the `remote: true` property set as well
[21:43:30] greengriminal: Does anyone see anything wrong in this setup?
[21:44:16] fessenden: Hey, I'm having some trouble with getting a ruby method running from an ERB. It insists that the method I'm trying to refer to is private, despite the fact that I don't privatize anywhere in my Controller. Is everything in there private by default, or is there something I'm doing wrong? Is there a simple way to call a ruby function from an html.erb View? Relevant code: https://gist.github.com/anonymous/990eaa221ca2736dc652
[21:44:52] Radar: Fessenden: Where is SystemStat.test defined?
[21:45:07] Radar: Fessenden: I see the instance method for SystemStatsController, but I don't see the one for SystemStat.
[21:45:32] fessenden: I was under the impression that was where it needed to be defined. Does it need to be defined in the Model?
[21:47:21] fessenden: Because that doesn't appear to resolve it The Model is pretty much empty; I added the test method in, and it still doesn't work.
[21:48:50] Radar: Fessenden: If you're calling the method on the model I would think that it needs to be defined there.
[21:49:03] Radar: Fessenden: And it's likely that you're adding an instance method to the model but you're calling a class method.
[21:49:22] Radar: Fessenden: When you try things and they don't work and you want help with the code, please show us EXACTLY what you have tried.
[21:49:44] Radar: Just simply saying that you tried something and that it didn't work with no indication what you tried ... well, that makes it damn hard for us to debug it.
[21:49:55] Radar: p.s. that's rule #3 for the channel
[21:50:47] fessenden: https://gist.github.com/anonymous/273657b1ff9946f1fb48
[21:51:24] fessenden: I just added the method with a single print statement.
[21:51:31] Radar: Fessenden: So it's as I said earlier. You're defining an instance method but you're calling it as if it were a class method.
[21:51:34] Radar: So you need to make it a class method.
[21:51:42] skinux: Is Ruby-Install really a set of Ruby scripts or is it a natively compiled tool?
[21:52:16] Radar: skinux: It's a bunch of shell scripts iirc
[21:52:20] Radar: https://github.com/postmodern/ruby-install/blob/master/share/ruby-install/ruby/functions.sh
[21:52:24] ninabreznik: i just figured out that my schema in production and development and not synced. I had some problems with adding and removing one attribute in development and somehow schema didn't want to update the actual state, so i just did rake db:drop and rake db:migrate so it started working again. But this only in development, now same problem is in production, so can't just make rake db:drop. How to solve this? https://gist.github.c
[21:52:31] helpa: ninabreznik: Too long; didn't read.
[21:52:31] Radar: ninabreznik: !tldr
[21:52:48] Radar: ninabreznik: You could connect to production's database and add the field yourself.
[21:53:01] smathy: ninabreznik, and your migration is referencing that `name` attribute?
[21:53:05] skinux: Radar: Okay.
[21:53:22] ninabreznik: Radar: I would have to remove it
[21:53:23] skinux: Radar: I assume you're very experienced with Ruby/Rails?
[21:53:46] ninabreznik: Radar: how do i do that?
[21:53:46] fessenden: Thanks, Radar. It's compiling now, but nothing is showing up. I'll go mull over some erb tutorials and see if I can't suss it out.
[21:53:58] Radar: Fessenden: It's becuase you're using puts, I guess.
[21:54:19] ninabreznik: smathy: migrations are the same, i destroyed the one where i created name
[21:54:43] Radar: skinux: I wrote several of the Rails guides (including re-writing the Getting Started guide), wrote Rails 3 in Action, Multitenancy with Rails and am currently writing Rails 4 in Action. I have over 65,000 points on Stack Overflow from answering mostly Rails questions.
[21:54:52] Radar: skinux: So yes, I am VERY experienced :)
[21:55:02] Radar: ninabreznik: Remove which?
[21:55:25] smathy: ninabreznik, so which migration are you having trouble with in production?
[21:55:32] upsell5: Radar: are you showing off? :)
[21:55:39] skinux: Radar: If you don't mind me asking, how old are you?
[21:55:48] ninabreznik: Radar: i added name to users but i removed migration after. now schema in production still has name.
[21:55:52] Radar: upsell5: A little.
[21:55:54] Radar: skinux: 27.
[21:56:08] Radar: ninabreznik: So connect to your server and drop the column
[21:56:12] skinux: Radar: Really? I figured you'd be somewhat older. I'm 29.
[21:56:17] Radar: ninabreznik: !g drop column <your db of choice>
[21:56:28] Radar: skinux: heh :) I get that a lot.
[21:56:33] ninabreznik: Radar: have never done that. how do you do it? do you know the command by heart?
[21:56:35] skinux: Radar: Mind if I private message you?
[21:56:38] fessenden: Radar can show off all he wants. I ask only to bask in his brilliance.
[21:56:38] Radar: I did not much but Ruby/Rails with my early 20s
[21:56:40] Radar: skinux: Sure go ahead.
[21:56:49] Radar: ninabreznik: Google it, see what you can find.
[21:57:01] fessenden: Also, Radar : What's wrong with puts? If it's in a <%= %> tag, shouldn't all output be printed to the html.erb page?
[21:57:17] ninabreznik: smathy: radar suggested me to just drop the column in production. will try that
[21:57:33] Radar: Fessenden: puts returns nil. Putting a method inside <%= %> that returns nil, will show nothing
[21:57:41] Radar: Fessenden: Remove the puts. Just return the string from the method.
[21:57:55] mwlang: ugh???I just passed all specs on a project and made its initial commit. Generated full rspec report and committed that to repo, too. Then I go to branch and start adding a new feature and my controller actions are all failing. ???no problem,??? I think, ???I???ll just revert back to last commit and start again.??? Alas, even the checked in version is failing. Talk about being puzzled!
[21:57:59] smathy: ninabreznik, k
[21:58:10] fessenden: makes perfect sense, pardon my emptyheadedness. You're a godsend.
[21:58:19] Radar: Fessenden: np
[21:58:37] ninabreznik: Radar: they say i should drop the column with migration. hm. should i do it locally and then deploy or on the server direclty or...?
[21:58:37] upsell5: Radar: is BE a spree site?
[21:58:59] Radar: upsell5: Nope, custom Rails app
[21:59:07] Radar: ninabreznik: ..............
[21:59:19] Radar: ninabreznik: PostgresQL or MySQL?
[21:59:28] Radar: ninabreznik: You can do this without a migration. Creating another migration is only going to cause you problem.s
[21:59:57] upsell5: Radar: oh, its a marketplace type site. cool.
[22:00:20] ninabreznik: Radar: sure. i use sqlite3
[22:00:20] Radar: upsell5: yup, it's very nice :)
[22:00:31] upsell5: Radar: I wouldn???t think it makes money!
[22:00:37] upsell5: with ebay/craigslist around
[22:00:59] Radar: upsell5: It's mostly used for stores who want to sell their merch. We go to them and ask
[22:04:18] crankharder: anyone know how I can see the raw "Set-Cookie" string inside the ActionDispatch::Request object? I can't seem to find it.
[22:04:27] mwlang: maybe somebody else can spot my gremlin? https://gist.github.com/mwlang/066de6a15475fd73cbb7 Basically, I have a Soap::Router class that is a valid Rack endpoint which I plug into Rails in the config/routes.rb file. The plumbing works fine and up until a couple hours ago, I had no trouble accessing ???soap.request???, ???soap.message???, and ???soap.params??? within the SoapController. Now they???re always nil.
[22:08:40] ninabreznik: how to remove column from table without migration -- in production?
[22:08:47] xibalba: mwlang, SOAP!
[22:09:04] roamingd_: ninabreznik: depends on db
[22:09:24] ninabreznik: roamingd_: mysql
[22:09:41] aaas: hello im new to rails, I'm trying to modify my model to only return filtered values and order by a column. Currently I'm trying to just have a single 'query' that can handle the case when the filter or order is specified or not. I'm wondering if this is the best way to do this. Im used to query builders and maybe I should just have conditionals which modify the query? and tips would be a big help, thanks: http://pastie.org/9869394
[22:09:44] mwlang: xibalba: yup. unfortunately???and I???m doing my own soap pre-processing because the vendor???s soap server is sending malformed messages. (go figure). wash_out crashes and burns on it. :-p
[22:09:52] Radar: omg what is with the tldrs this morning?!
[22:10:02] Radar: ninabreznik: MySQL in production and SQlite3 in dev? You might run into troubles.
[22:10:14] Radar: ninabreznik: http://stackoverflow.com/questions/13968494/how-to-delete-a-column-from-a-table-in-mysql
[22:10:19] Radar: ninabreznik: Run that on your production db
[22:10:31] mwlang: Radar: when I???m dying I???m a rambler???I spill it.
[22:10:34] ninabreznik: Radar: both sqlite3
[22:10:39] Radar: [09:09:25] <ninabreznik> roamingd_: mysql
[22:10:47] Radar: ninabreznik: Why did you tell roamingd_ mysql?
[22:10:57] ninabreznik: Radar: i thought that's the same
[22:11:04] centrx: aaas, You might want to use 'scopes'
[22:11:06] xibalba: mwlang, i'd be interested in this chaperone product. have you seen pfSense?
[22:11:16] centrx: aaas, and give 'get_movies' a more descriptive name
[22:11:20] aaas: centrx thanks ill look into them
[22:11:22] xibalba: mwlang, i'm actually a `rambler` :). my emails are always rambler@
[22:11:32] mwlang: xibalba: yeah, I???ve seen just about all them firewalls out there.
[22:11:51] ninabreznik: Radar: this is what it says in my database.yml database: db/production.sqlite3
[22:12:06] Radar: ninabreznik: So you're using SQLite3. Google for "drop column sqlite3" and follow.
[22:12:32] Radar: time to do some Real Work(tm). bbl
[22:12:46] ninabreznik: Radar: fantastic. danke
[22:13:01] mwlang: hmmm???does the Request Dispatcher remove stuff other Rack apps set?
[22:14:36] ninabreznik: Radar: that should be ok, right? i just don't want to destroy my app:) alter table table_name drop column column_name
[22:15:33] roamingd_: ninabreznik: back up db first?
[22:16:15] ninabreznik: roamingd_: Ha. i am all confused already. i have to removed locally, so no worries with db for now :) ole
[22:16:26] ninabreznik: roamingd_: but thanks for reminding me! :)
[22:16:51] roamingd_: ninabreznik: ich verstehe dich nicht
[22:17:10] roamingd_: ninabreznik: i meant be sure to back your production db before messing with it
[22:17:58] ninabreznik: roamingd_: i know. but i saw that i have to remove column locally, so there i have no data. will see if that helps.
[22:18:02] gabeodess: Should I be able to use methods in ApplicationHelper in my email templates? The documentations says I can, but I???m getting ???undefined method??? errors??? do I have to configure this?
[22:18:15] roamingd_: ninabreznik: you can use a migration then?
[22:18:43] ninabreznik: roamingd_: nope, because migration is already removed, but schema didn't update for some reason.
[22:27:20] renegadeandy: evening everyone!
[22:31:40] j-manu__: I'm trying to start rails console in production using "bundle exec rails c production" but all it produces is the help text for "rails new" command
[22:32:35] j-manu__: Any idea why? "bundle exec rails c production" works for me in other production servers but this is a newly set up server using ruby 2.1.5 and rails 3.2.18
[22:32:57] j-manu__: and I'm just not able to start rails console
[22:36:32] xibalba: j-manu__, used a ENV variable to set production
[22:36:43] j-manu__: That too doesn't work
[22:37:12] xibalba: gist what you put on the command line
[22:38:53] j-manu__: https://gist.github.com/anonymous/68ed576f94e6504cd2c9
[22:38:57] j-manu__: Tried all three
[22:39:30] xibalba: afterwards just put `bundle exec rails c`
[22:40:13] j-manu__: ? That doesn't work work either
[22:40:56] j-manu__: Actually I just realized it doesn't work in my local either. The biggest change was upgrade from ruby 1.9.3 to ruby 2.1.5
[22:42:52] capin: afternoon :D
[22:45:29] bricker: lol stackoverflow is down
[22:45:57] xibalba: everyone go home!
[22:47:58] tubbo: bad programmers everywhere shit themselves a little
[22:49:59] xibalba: ACTION checks his underwear
[22:50:31] mwlang: maybe SO devs will be here shortly to ask us how to get it back up.
[22:50:37] bricker: j-manu__: you are missing your script/rails file probably
[22:51:42] tubbo: TIL git preserves file name changes across branches/commits.
[22:52:13] tubbo: so if you have a file test/unit/my_test.rb and you rename it to test/unit/lib/my_test.rb in another branch, then edit the file in the current branch and cherry-pick that file-edit commit to your 2nd branch, the files will be edited in their new locations.
[22:52:19] mwlang: so, back to my problem. if I set env['soap.request'] in my Rack middleware, why is it sometimes accessible in my controller as request[???soap.request'] and sometimes not? There???s no real rhyme or reason that I can see.
[22:52:26] bricker: mwlang: lol I don't think SO is a rails app.
[22:52:37] tubbo: it's .NET iirc
[22:52:39] mwlang: bricker: its not.
[22:52:48] tubbo: which is kinda funny to me
[22:53:04] mwlang: (but one can fantasize...)
[22:53:19] tubbo: it's like if they rebuilt cambridge university to look like a giant playpen
[22:53:27] tubbo: well maybe not but still
[22:53:29] j-manu__: @bricker - yes indeed
[22:54:27] Scriptonaut: yo tubbo, remember that gist you sent me
[22:54:30] bricker: j-manu__: you'll need that file, or binstubs
[22:54:46] Scriptonaut: It wont' let me write to the document from an asyncrhonously loaded external script
[22:54:53] Scriptonaut: Failed to execute 'write' on 'Document': It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened.
[22:55:27] j-manu__: thanks. I thought with bundler i didn't need that anymore
[22:56:27] upsell5: tubbo: SO looks like a giant playpen? lol
[23:08:04] renegadeandy: Is there a model method to do a fuzzy search across all fields in a model for a specific string? So as to pull back any result where input string A is in any of the columns in the Model's result set?
[23:08:35] mwlang: renegadeandy: I don???t think so. However, you can iterate over attributes
[23:11:17] mwlang: renegadeandy: are you looking at loaded in-memory model instances or trying to query DBMS?
[23:11:59] renegadeandy: Well...at the moment I hve a index which is Model.all - now I want to implement a search facility
[23:12:06] renegadeandy: mwlang: do you mean like https://gist.github.com/anonymous/3c775aebdc8531f8a192
[23:12:12] mwlang: renegadeandy: if you???re wanting to query DBMS, you???ll want something like thinking-sphynx
[23:12:18] Scriptonaut: anyone know how I could do something like: %Q|#{render 'blah.html'}|
[23:12:29] renegadeandy: im not sure what you mean by query DBMS, i guess that is what I want
[23:12:31] Scriptonaut: I want to render an html file, and escape all the double quotes
[23:12:57] mwlang: renegadeandy: yes, that???s what I meant for loaded models.
[23:13:35] bricker: Scriptonaut: escape_javascript
[23:13:38] renegadeandy: mwlang: right...so what do you mean by dbms then?
[23:13:53] Scriptonaut: bricker: thanks
[23:14:04] mwlang: renegadeandy: being able to fuzzy search many fields for a value???the query is performed against the database.
[23:14:16] mwlang: and results are returned that match.
[23:14:32] renegadeandy: mwlang: that is probably a better implementation...
[23:14:51] mwlang: renegadeandy: https://github.com/pat/thinking-sphinx may be your ticket.
[23:15:10] renegadeandy: terrific, ill take a look now I know my options i appreciate your assistance!
[23:16:04] mwlang: there are other options out there, too???check the ruby toolbox site: https://www.ruby-toolbox.com/categories/rails_search
[23:16:25] mwlang: I just happen to know thinking-sphinx the best, but Sunspot???s good, too.
[23:17:09] bricker: elasticsearch, solr
[23:17:13] bricker: lots of choices
[23:17:20] Radar: elasticsearch or gtfo imo
[23:17:36] bricker: I have been very happy with sphinx for many years now
[23:17:48] Radar: It has a learning curve like a skyscraper but once you get over it you'll be fine.'
[23:19:58] mwlang: Radar: so what makes the skyscraper ascension worth the climb?
[23:20:13] Radar: mwlang: ES is just rock solid in my experience
[23:20:47] mwlang: Radar: more so than thinking sphinx and sunspot?
[23:21:55] Radar: mwlang: Yeah. Compare also http://sphinxsearch.com/blog/2013/07/02/geo-distances-with-sphinx/ and http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/geoloc.html
[23:24:01] mwlang: Radar: now you???re talking. That???s a strong + there with geo-spatial + full-text searching.
[23:24:27] Radar: Also I'm slightly biased as we're currently moving off Sphinx to ES
[23:25:00] mwlang: Radar: well, a 3 year old bug is good reason if you???re in that space.
[23:28:29] mwlang: geospatial bugs drive me bonkers because not many people seem to be developing in that space (relatively speaking, of course)???so its a lot more figuring it out yourself and working through and around bugs that are hard to define for others to fix sometimes.
[23:30:15] nickjj: i really like ES too
[23:32:44] latco: Hey guys, I am getting error: https://gist.github.com/TomasAchmedovas/46d6e865eb3f3ccf7f96 using ActiveAdmin from master branch and rails 4.2.0
[23:33:10] latco: Can't find that SASS error
[23:33:27] renegadeandy: mwlang: do you think there is a difference in doing it the dbms way or the attribute way? I tend to favor searching all attributes manually myself, seems simpler and less dependancies...
[23:39:10] gabeodess: Okay, I???ve got a really wierd problem. On my website image names are appended with a hash and work as normal, but in my emails the hash is different and the images don???t load. Any ideas why my emails might have a different hash?
[23:39:26] gabeodess: Using the roadie-rails gem btw
[23:51:55] beauby: Hey guys, I'm moving away from ActiveModel::Serializer, which seems kinda dead. What's the most JSONAPI-friendly ruby alternative out there?
[23:53:06] Radar: beauby: jbuilder?
[23:53:57] klmlfl: I made a Slack team for Rails devs / beginners who want to share information, pair program: https://rails-fb.herokuapp.com/
[23:55:25] klmlfl: Btw, I'm using a gem called Slacker which makes joining the Slack team invitation-free.
[23:56:46] latco: Okey, i found that problem was in sass, in 3.4.10 that bug fixed, but sass-rails uses ~>3.1 how to force it to use 3.4?
[23:57:10] Radar: latco: Change the version in your Gemfile?
[23:57:25] Radar: gem 'sass', '3.4.10'
[23:57:41] Radar: ~> 3.1 means any version in the 3.x range
[23:57:57] Radar: by forcing the sass version like that you will use the newer version of sass
[23:57:58] renegadeandy: why in RoR is the include? method, called include? and not just include :/
[23:58:01] latco: Ohh, thanks
[23:58:05] Radar: renegadeandy: because it returns a bool
[23:58:12] bricker: Radar: (that's greater than or equal to 3.1)
[23:58:17] renegadeandy: so anything ending in ? returns a bool?
[23:58:55] latco: It should
[23:58:57] bricker: renegadeandy: that's a pretty safe assumption to make, but nothing enforces that
[23:59:19] renegadeandy: like a meta interface!
[23:59:20] philcrissman: renegadeandy: it's a convention. What bricker said.
[23:59:24] bricker: renegadeandy: not really
[23:59:38] latco: yea, also methods name can have = or space, just sayin' few days back i was confused by that
[23:59:58] bricker: latco: methods can't have a space in them