« Back to channel list

#RubyOnRails - 25 January 2014

« Back 1 day Forward 1 day »
[00:03:00] ljarvis: Post.joins(:comments).where('comments.created_at > ?', 1.month.ago)
[00:03:27] ljarvis: oh way I misread
[00:04:09] mmun: :) yeah needs to pick up only when all comments have the property
[00:04:47] ljarvis: I'd use some count() calls
[00:08:05] Radar: Does anyone know the version of Model.find_by that will not raise an exception?
[00:08:16] nahtnam: Do you guys think its sane to make a bitcoin ticket refresh every 15 seconds?
[00:08:28] henn1nk: https://gist.github.com/henn1nk/5a0ab3125d788443191b Does someone know how to fix this? Or does someone know this is an activeadmin or hstore_translate issue?
[00:08:32] Radar: Oh, my bad. I am using find_by! which is why it's raising the exception :P
[00:10:41] bricker`work: shinobi_one: :P
[00:10:53] bricker`work: bricker`work: :P
[00:17:40] nahtnam: Do you guys think its sane to make a bitcoin ticket refresh every 15 seconds?
[00:20:07] nahtnam: it will make a call to http://nahtnam.me/application/buy
[00:29:13] moneydouble: wheres a good place to start learning rails? I know django, but looking to get more into rails.
[00:30:48] skyjumper: moneydouble: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book
[00:31:32] moneydouble: skyjumper: do you have any links or anything as to why I should use rails over django?
[00:31:56] skyjumper: i wouldn't be a good person to ask
[00:33:44] shinobi_one: moneydouble: i'd suggest rubyonrailstutorial by Michael Hartl, and also the Rails documentation on its site
[00:34:58] bricker`work: moneydouble: There's no compelling reason to switch if you don't already prefer one over the other.
[00:35:11] shinobi_one: bricker`work: disagreed
[00:35:31] bricker`work: shinobi_one: noted
[00:35:41] shinobi_one: i prefer the workflow and TDD aspects Rails provides much much much better than Django
[00:35:49] shinobi_one: also, schema migrations vs south, rails wins
[00:35:54] bricker`work: shinobi_one: "I prefer" is the problem with that statement
[00:35:58] bricker`work: and any statement you could make right now
[00:36:07] shinobi_one: nah, schema migrations > south
[00:36:15] bricker`work: shinobi_one: for example, I *much* prefer South to how Rails does migrations
[00:36:25] shinobi_one: nobody would say that :P
[00:36:29] bricker`work: shinobi_one: k
[00:36:31] moneydouble: well the reason I've preferred django for a while is because large sites like instagram use it.
[00:36:45] cnk_: I am just learning Django - after years in rails
[00:36:53] moneydouble: like twitter used rails but they had to leave it.
[00:36:54] shinobi_one: Rails has tons of large sites using it
[00:37:03] moneydouble: I don't understand why/
[00:37:06] shinobi_one: moneydouble: Twitter left Rails because of ruby not Rails
[00:37:24] cnk_: there were a couple of blog posts about one vs the other. Old but I think still kind of accurate
[00:37:34] cnk_: first, which language do you prefer
[00:37:42] shinobi_one: Rails empowers people to write tests, Django does not
[00:37:46] cnk_: second, are you doing mostly content or mostly app
[00:37:52] moneydouble: shinobi_one: well I can't understand why they left ruby then.
[00:38:00] shinobi_one: Django is great for CMS
[00:38:02] bricker`work: moneydouble: it was too slow for Twitter. seriously.
[00:38:17] cnk_: the django admin is cool (but if you like it, then checkout rails + activeadmin)
[00:38:21] shinobi_one: moneydouble: Twitter left Ruby for its performance at the time
[00:38:29] shinobi_one: there's tons of Twitter blog posts about it
[00:38:40] moneydouble: shinobi_one: at the time? does that mean its better now?
[00:38:49] shinobi_one: moneydouble: yes Ruby is much faster now
[00:39:03] moneydouble: shinobi_one: what did twitter move to?
[00:39:21] shinobi_one: moneydouble: they moved to using certain languages/tools for certain jobs
[00:39:30] cnk_: django's tests are so much better than the stock Python test tools but still quite crude and hard to read compared to Ruby's tools (even test unit is more readable than python unit test)
[00:39:45] shinobi_one: ugh Python test unit makes me want to die
[00:39:51] cnk_: Java? or was it Scala?
[00:39:54] shinobi_one: but so does every Test Unit
[00:39:58] moneydouble: oh hmm I see.
[00:40:29] cnk_: moneydouble
[00:40:30] moneydouble: well the reason I've been kinda wanting to check out rails is because of the number of contributors.. its massive compared to django.
[00:40:34] cnk_: what is your background?
[00:40:42] shinobi_one: moneydouble: the community behind Rails is much stronger than Django
[00:40:48] moneydouble: cnk_: I started with PHP then moved onto python and django.
[00:41:34] shinobi_one: Django is slow to change compared to Rails
[00:41:39] shinobi_one: infrequent updates
[00:41:47] shinobi_one: not that that is a bad thing
[00:42:02] shinobi_one: rails has sprockets, yum
[00:42:03] Fire-Dragon-DoL: for "smaller" project I think community is the biggest value
[00:42:24] Fire-Dragon-DoL: if you have an insanely huge project, with a team, you may start thinking about different things
[00:42:27] cnk_: moneydouble: what do you think of pylons vs django? That gives you different assumptions w/o changing languages
[00:42:51] moneydouble: ok well listen, I'm going to build a software as a service web application.
[00:43:27] ddd: whenever anyone starts with that, you know its going to be a long long slog
[00:43:28] moneydouble: And I'm debating on which to use for it. I'm more familiar with django but I have the time to learn rails. I'd like to choose one that is going to be here to "stay".
[00:43:44] cnk_: https://leanpub.com/multi-tenancy-rails
[00:43:47] moneydouble: cnk_: I haven't really ever looked at pylons, it looks dead to me..
[00:43:53] shinobi_one: moneydouble: i don't think either of them are leaving soon
[00:44:01] cnk_: ummm is it call pyramid now?
[00:44:15] moneydouble: cnk_: Yeah it is but you called it pylons. :P
[00:44:27] shinobi_one: Pylons Project maintains Pyramid
[00:44:44] cnk_: hey I remember looking at it when the rails in python thing was TurboGears
[00:44:54] cnk_: but I haven't kept up
[00:45:10] cnk_: Python never sang to me like Ruby did
[00:45:27] shinobi_one: moneydouble: I'd say learn ruby first, if you find that you enjoy it more than python (i do and i'm a python/django developer where i work) then maybe choose to learn rails :)
[00:45:29] ddd: cnk_ Debugging Ruby, Multitenancy with Rails, and Everyday Rails Testing with RSpec
[00:45:43] moneydouble: how often is there a rails conference? Honestly, I love the community rails "seems" to have. Like when I go into #django, there sometimes are like literally no one to answer anything.
[00:46:07] cnk_: yearly - April in Chicago this year I think
[00:46:22] ddd: Actually I think there's like 3 or 4 that cycle the country
[00:46:41] moneydouble: ddd: yea thats what I thought. I thought there was a few different ones.
[00:46:59] cnk_: there are local ones all over the place every year
[00:47:13] cnk_: LARubyConf is in 2 weeks
[00:47:28] shinobi_one: there are rubyconfs and railsconfs all over all the time it seems
[00:47:42] shinobi_one: it feels that way anyhow
[00:49:03] moneydouble: shinobi_one: since you're a python/django dev, which would you recommend for a startup software as a service company? For their web application.
[00:49:05] shinobi_one: when i need something in Ruby that has already been done I know there's a great open source community, i can't always find something i want in Python
[00:49:57] shinobi_one: moneydouble: we have a hardware appliance and a software/virtual appliance that runs mostly off of Django (and several other programming languages)
[00:50:06] shinobi_one: but to answer your question, either would most likely work for you
[00:50:56] shinobi_one: i feel like Rails is just generally faster to develop/test in, and I much prefer how rails views work versus Django templates
[00:51:05] AntelopeSalad: moneydouble: it really doesn't matter, but it wouldn't hurt to learn both
[00:51:16] AntelopeSalad: at least enough to be productive in both
[00:51:52] shinobi_one: django has some pretty cool template filters/built-ins, but it's not enough to wow me
[00:52:02] cnk_: One thing I do like from django is how easy it is to compose your urls / routes
[00:52:30] shinobi_one: cnk_: really? I hate having a separate urls.py for each individual component lol
[00:52:54] shinobi_one: on a large scale app it is kind of cumbersome to find which view maps to which url
[00:52:55] cnk_: One can make methods to do that for plugins / engines but
[00:53:08] cnk_: ahhh our stuff is small so far
[00:53:16] e62: Hey, anybody have any tips for dealing with ActiveSupport::TimeZone objects in the latest version of Rails 3? It seems like whenever I try to subtract Time.zone.now from it, it's losing its time zone (which makes sense since it's turned into an integer)
[00:53:17] cnk_: so there isn't an equivalent of rake routes?
[00:53:24] shinobi_one: cnk_: not that i've seen
[00:53:50] shinobi_one: cnk_: there's an extension i guess
[00:53:52] cnk_: I did find a library that does part of what assert_select has been doing for 5 years
[00:54:00] cnk_: that made me much happier
[00:57:14] shinobi_one: I feel like a lot of what Rails gives you can be given by separate libraries for Django, but I'm usually disappointed at the quality or the time it took to make
[00:58:37] cnk_: shinobi_one: :( I am going to pretend I didn't hear that because Django is such an improvement over our home grown Python stuff that I am nearly giddy
[01:01:24] shinobi_one: If I had to choose between Rails and Django I would basically choose Rails for these reasons: Fast development/testing, so much community, I prefer Ruby hands down, migrations > south, did I mention I prefer Ruby?
[01:01:51] shinobi_one: oh and rvm & bundler <3
[01:01:56] ddd: e62 the integer is usually the hour difference. so do something like Time.now.4.hours_ago (iirc thats legal)
[01:02:25] ddd: i don't remem ber at all how you apply it as a selectable timezone difference
[01:02:49] shinobi_one: ddd: I don't believe that syntax would work
[01:03:04] shinobi_one: ddd: but 4.hours.ago should work
[01:03:08] frem: shinobi_one: rvm isn't a big deal for a lot of python projects. The newest version of python is 2.7, after all. ;)
[01:03:28] shinobi_one: frem: lol wut? you mean Python 3.somethingnobodyuses ;)
[01:03:41] frem: shinobi_one: thats_the_joke.jpg
[01:03:56] shinobi_one: frem: explicit is better than implicit xD
[01:04:17] e62: I can't really do that. I want to figure out how much time is left until X, X being a model attribute
[01:04:22] shinobi_one: frem: `import this`
[01:04:41] Ryan_420: Anyone wanna help walk me through the basics of rails over skype?
[01:04:43] e62: I've tried my_time - Time.zone.now, and I'm getting the wrong output
[01:05:10] lifestream: I'm still learning RoR and I'm following a tutorial. The tutorial uses attr_accessible. Would it be a bad practice to just install the necessary gem for rails 4? It seems using Strong Params would be better, but honestly I have no clue how to do it yet
[01:05:10] Ryan_420: It would be greatly appreciated
[01:05:20] e62: Both objects being ActiveSupport::TimeZone
[01:05:24] shinobi_one: Ryan_420: is that joke? just curious
[01:05:32] ddd: ryan_420 no but you can walk the basics via the web at http://ruby.railstutorial.com
[01:05:59] ddd: err .org
[01:06:04] shinobi_one: lifestream: what does attr_accessible have to do with strong params?
[01:06:43] lifestream: shinobi_one: RuntimeError: `attr_accessible` is extracted out of Rails into a gem. Please use new recommended protection model for params(strong_parameters) or add `protected_attributes` to your Gemfile to use old one.
[01:06:58] lifestream: I guess the tutorial Im following is for an older version of rails?
[01:06:58] shinobi_one: ^ your tutorial isn't for Rails 4 then?
[01:07:11] cnk_: lifestream: I would either jump ship to ruby.railstutorial.org which is Rails 4 or install Rails 3.2 and use your current tutorial
[01:07:22] e62: Err, nevermind, caught my mistake there...
[01:07:23] shinobi_one: lifestream: http://ruby.railstutorial.org/
[01:08:41] lifestream: I can't do that tutorial right now cnk_, it's too wordy and I'm having trouble following it. (I have dementia symptoms and right now my working memory is awful). I need something simple. I was doing that tutorial since early January, but my dementia symptoms got worse and I had to stop
[01:08:58] cnk_: No problem
[01:09:04] lifestream: Thanks though
[01:09:08] cnk_: but install a version of rails that matches your tutorial
[01:09:17] lifestream: Oh that's an option!
[01:09:35] cnk_: gem install rails --version 3.2.16
[01:09:45] cnk_: then start again
[01:10:02] cnk_: are you using a ruby manager like rvm or rbenv?
[01:10:26] lifestream: no, just plain ruby, but I could make a vagrant or virtualbox for 3.2
[01:10:26] cnk_: if not, your first rails command will need to be done a little differently so that you get the 3.2 rails
[01:10:35] cnk_: but afar it should be fine
[01:10:53] cnk_: let me see if I can find the rails command you need
[01:14:04] lifestream: I already had an app (basically, topics + votes) and I wanted to add users to make sure each person/user can only upvote/downvote once per topic
[01:14:38] cnk_: if you generated it with rails 4 it is going to get messy
[01:14:45] lifestream: Yeah. I don't mind redoing it
[01:14:50] lifestream: I'll get more practice! :)
[01:14:53] cnk_: rails _3.2.16_ new appname
[01:15:13] cnk_: once you have rails 3.2.6 installed, that command will generate a new project using rails 3.2
[01:15:43] shinobi_one: if you're only using gems related to that app you could easily uninstall all gems and then install rails 3.2.16 and configure your Gemfile and bundle install
[01:16:28] lifestream: Oh you're right, you can specify rails version in the gemfile
[01:16:56] dnajd: testing a controller... trying to post models accessale attributes only. Is there a method to get only the accesable attributes?
[01:17:02] dnajd: tried model.attributes
[01:17:08] dnajd: but then I get mass assignment error
[01:17:22] shinobi_one: dnajd: rails 3?
[01:19:17] dnajd: factory girl builds the model with private fields, which is good except when using the model against a put controller action in a functional test
[01:20:12] shinobi_one: dnajd: lots of people would suggest integration tests as opposed to testing controller actions directly
[01:20:27] rhizome: dnajd: create a factory that has only the attributes you want
[01:20:53] dnajd: I knew that was an option
[01:20:56] dnajd: but would have been cool to
[01:20:59] shinobi_one: dnajd: http://betterspecs.org/#integration
[01:21:04] dnajd: model.accessable_attributes
[01:21:36] rhizome: i think they accept pull requests
[01:22:13] moneydouble: does apple use rails?
[01:22:22] shinobi_one: moneydouble: what do you mean?
[01:22:23] rhizome: moneydouble: some
[01:22:35] shinobi_one: does the company Apple use Rails at all?
[01:23:42] rhizome: moneydouble: some
[01:23:47] greenride: In the debugger in the middle of an rspec test, I ran the command page.evaluate_script("$('.button')") and the output was "(cyclic structure)". What does that mean?
[01:24:22] shinobi_one: moneydouble: many large companies use Rails
[01:25:06] moneydouble: shinobi_one: hmm you see, I thought python/django was used more from large companies lol
[01:25:45] rhizome: apple isn't a large company, it's a huge company
[01:26:02] greenride: moneydouble: I would guess that more large companies use Rails than python/django. However, Java is probably used more frequently by large companies.
[01:27:43] shinobi_one: moneydouble: Google loves Python
[01:27:49] shinobi_one: moneydouble: Google loves Java
[01:28:13] moneydouble: shinobi_one: Yea they don't use ruby/rails idk why.
[01:28:34] greenride: moneydouble: Walmart uses Rails.
[01:28:36] shinobi_one: moneydouble: they're too big most likely, and I wouldn't be surprised if rails was being used internally for somethings that we'd never hear about
[01:28:41] moneydouble: Heres my issue. Hiring. Hiring people is hard and I'd like to pick the framework with more developers open to hire.
[01:28:49] moneydouble: greenride: walmart.com/
[01:29:09] greenride: http://jobs.walmart.com/san-bruno/ecommerce/software-engineer-ruby-on-rails-jobs
[01:29:11] rhizome: apple has what to do with that?
[01:29:32] shinobi_one: moneydouble: You shouldn't have an incredibly hard time finding Ruby or Python developers or Rails or Django developers
[01:29:43] shinobi_one: if that's your basis you can flip a coin
[01:30:04] mmun: is it possible return a count of the number of groups instead of the entire hash?
[01:30:15] shinobi_one: mmun: groups?
[01:30:47] mmun: shinobi_one: yeah, in an activerecord expressions
[01:30:50] mmun: eg. posts.joins(:comments).group('posts.id').having('<some complex query>')
[01:31:03] shinobi_one: longquery.stuff.group.whatever.count
[01:31:14] mmun: count doesn't work, it will count each individual group
[01:33:06] shinobi_one: mmun: i suppose you could count hte number of keys in the hash xD
[01:33:20] mmun: :D yeah, i'm using .length instead of .count
[01:33:26] mmun: feels a bit dirty though
[01:33:32] centrx: count distinct
[01:33:35] centrx: .uniq.count
[01:33:42] shinobi_one: yeah distinct seems like what you want
[01:33:54] shinobi_one: or uniq whatever AR wants it
[01:35:04] moneydouble: does rails migrations work with mysql?
[01:35:16] Radar: moneydouble: yes
[01:35:43] shinobi_one: moneydouble: it works with sqlite, mysql, and postgresql out of the box
[01:38:06] shinobi_one: moneydouble: it's going to do whatever you want, you seem to be having a tough time choosing between the two, but really it's going to come down to preference I think
[01:38:53] shinobi_one: moneydouble: is your SAAS going to be deployed on AWS or something?
[01:39:06] moneydouble: shinobi_one: Yeah, we're using SoftLayer cloud.
[01:40:31] greenride: moneydouble: http://www.railshosting.org/the-top-10-sites-built-with-ruby-on-rails
[01:41:14] moneydouble: greenride: that list is outdated for twitter and justin.tv
[01:41:26] shinobi_one: greenride: lol
[01:41:51] shinobi_one: moneydouble: once you scale to the size twitter did, you won't be complaining if you feel the need to change frameworks or languages ;)
[01:42:04] moneydouble: shinobi_one: haha thats true.
[01:42:11] shinobi_one: moneydouble: Hulu still uses it
[01:42:18] shinobi_one: moneydouble: YellowPages
[01:42:31] shinobi_one: moneydouble: Shopify
[01:42:51] shinobi_one: moneydouble: Walmart apparently hires RoR devs for something
[01:43:06] shinobi_one: moneydouble: Basecamp and Github
[01:43:27] dnajd: man, pita
[01:43:28] shinobi_one: moneydouble: Tons of other large business that do niche things that we haven't heard of
[01:43:33] dnajd: this accessable attribute thing
[01:43:44] shinobi_one: dnajd: maybe your'e going about how you're testing the wrong way
[01:45:22] shinobi_one: dnajd: why do you need the list of accessible attributes in your test?
[01:47:12] quazimodo: so I just spent like 6 hours working out why 100% of my shit was going wrong.... freaking rails 4.0.0 persists? evals true after rollbacks
[01:48:29] rushed: quazimodo: persisted?
[01:49:22] dnajd: yeah.. realized I could test just updating a single attribute
[01:49:29] dnajd: and confirming it updated correctly
[01:49:47] dnajd: I'm making sure the form comes up, accepts the model (legacy db) and updates it correctly
[01:49:53] dnajd: because this sometimes breaks on me
[01:50:01] dnajd: when the legacy db gets updated by a 3rd party
[01:50:17] bricker`LA: quazimodo: you sure about that? That seems like it would be a pretty serious bug that wouldn't have slipped through to a final release.
[01:50:20] dnajd: so I do need to test that my models work against the legacy db (stage of course)
[01:51:04] shinobi_one: dnajd: yes so just test that updating attributes work, and that passing in the wrong things fails
[01:51:08] quazimodo: bricker`LA: yeah it did, hold up
[01:52:02] dnajd: it updates nested objects too
[01:52:10] dnajd: so it's quite a bit of building hashes to test
[01:52:19] dnajd: but it's doable
[01:52:27] quazimodo: https://github.com/rails/rails/pull/13751
[01:52:33] quazimodo: pain in the butt
[01:53:21] bricker`LA: quazimodo: wow
[01:54:01] dnajd: another interesting issue I'm running into
[01:54:10] dnajd: btw my legacy db is mssql
[01:54:20] dnajd: the routes resources :customer
[01:54:24] dnajd: doesn't work with my models
[01:54:33] dnajd: I'm having to hand create my routes... otherwise things like
[01:54:39] dnajd: edit_customer_path(customer)
[01:54:42] dnajd: creates a route like
[01:54:59] dps: Hi. I have a dumb question. I am running a query in sqlite and using find_by_sql (the same query) and getting different results. Is that to be expected? Here is the query I am running: select * from commands LEFT OUTER JOIN tagmapsorters ON tagmapsorters.command_id = commands.id WHERE tagmapsorters.tag_id is NULL;
[01:55:04] dnajd: customer slash edit.id
[01:55:11] dps: sqlite returns the correct result but activerecord does not :(
[01:55:23] shinobi_one: dps: gist please
[01:55:40] centrx: dnajd, Don't use Enter for your punctuation :)
[01:56:33] shinobi_one: dnajd: you're saying `resources :customer` creates a route `/customer/edit.id` ?
[01:56:57] quazimodo: that shit as mad annoying
[01:57:03] quazimodo: 6 freaking hours
[01:57:32] rhizome: dps: Command.find(command_id).tagmapsorters.where(tag_id: nil) # if your associations are configured
[01:58:31] shinobi_one: ^ good guy rhizome for actually reading what he said and not being an ass like i did
[01:58:43] rhizome: i have my moments
[01:59:25] centrx: quazimodo, Do some stretches and drink some orange juice. You'll feel better in no time!
[01:59:40] quazimodo: centrx: i'm currently interneting from my kickboxing gym's wireless
[01:59:44] quazimodo: our house has no webs
[02:00:01] quazimodo: so yeah, i might go stretch actually :/
[02:00:17] shinobi_one: quazimodo: go get your ass kicked, it'll take your mind off your rails pain
[02:01:26] dps: shnobi_one- the gist as you requested : https://gist.github.com/dsulli99/8610635
[02:01:42] dps: rhizome: what you sent me does not work, although thank you for trying to help me
[02:02:16] rhizome: well, it was off the cuff
[02:02:32] dps: I get: NameError: undefined local variable or method `command_id' for main:Object
[02:02:32] dnajd: sorry about the enter thing
[02:02:39] rhizome: maybe describing what you're trying to do...
[02:02:53] dps: im basically trying to find all of the instances of a HABTM that don't have an association
[02:02:56] dnajd: it's a pluralization error according to stack overflow; here is my route... resource :orders, only: [:get, :show];
[02:03:16] dps: I believe the native SQL in my gist works, but when I try to execute it in rails it doesn't return the correct result
[02:03:19] dnajd: link_to "test", order_path(order).... does't work. orders_path(order) causes the error
[02:03:20] dps: it returns nil
[02:03:36] shinobi_one: dnajd: `resources :customers`
[02:03:43] rhizome: dps: you can't do that in rails because there is no join model in a HABTM
[02:03:58] dps: well, can't you execute via find_by_sql?
[02:04:14] rhizome: i suppose so, but i stay away from that as much as possible
[02:04:15] dps: that is what i tried to do
[02:04:15] shinobi_one: dps: don't use find_by_sql.. it's gross and defeats the purpose
[02:04:34] dps: shinobi_one, its the only solution that i have hope will work
[02:05:06] shinobi_one: dps: it looks to me like you don't understand how to use AR querying through your models, and that is your problem
[02:05:09] rhizome: a better solution is to convert it to has-many through
[02:05:41] centrx: dps, It looks like it is giving the same result in both...?
[02:06:11] shinobi_one: dps: yes there is no difference in the result
[02:06:42] shinobi_one: the object doesn't have timestamps or id
[02:06:44] dps: centrx i'm not getting the same result, the created_at, updated_at, and id are nil when queried via activerecord
[02:06:53] dps: shinbi: precisely
[02:07:13] dps: i would think they wold be correct because I am selecting all columns on the table
[02:07:22] shinobi_one: realistically you should do the query using AR not sql
[02:07:45] dps: shinobi it is my understanding that doing this type of query is not possible using AR without using a gem
[02:07:48] centrx: dps, The find_by_sql does not know which of the returned id, created_at, updated_at belongs to the commands table
[02:08:27] centrx: dps, This query can be translated directly like: Command.join("LEFT OUTER JOIN etc").where("tagmapsorters.tag_id is NULL")
[02:08:36] centrx: dps, That may give better results, and there is probably a better way to do it still
[02:09:21] e62: I seem to be having trouble dealing with the fact that there's a different number of days in each month
[02:09:23] dps: centrx i tried that i could get it to work. my original query is this (this actually works but throws a bunch of deprecation warnings): Command.find(:all, :include => :tags, :conditions => { "tagmapsorters.tag_id" => nil}).count
[02:09:49] centrx: dps, :include does not necessarily do an outer join
[02:09:57] e62: I'm subtracting two dates to get an integer and adding it to another date, and it's ending up a few days off every time
[02:10:12] e62: Still working with ActiveSupport::TimeZone objects
[02:10:20] shinobi_one: e62 are you using UTC and epoch?
[02:10:27] e62: Everything is UTC
[02:10:45] shinobi_one: simple thing, convert to epoch do your addition and subtractions, get out of epoch
[02:10:46] centrx: dps, Also, it is possibly you need to use "IS NULL" not => nil
[02:10:58] e62: Okay, I'll give that a try
[02:11:15] dps: centrx i will futz around with what you described and see if i can get it to work
[02:11:18] dps: thank yo ufor your help
[02:11:30] dps: shinobi also i am sorry this is my first week or so using rails
[02:11:36] dps: i really have no idea what i am doing
[02:11:47] centrx: dps, Sounds good
[02:12:04] centrx: dps, I would recommend switching to the new-style syntax (assuming you are using Rails >= 3.0...)
[02:12:19] centrx: for ActiveRecord queries that is
[02:12:33] dps: i am using rails 4.0
[02:12:46] dps: ACTION is abreast to the latest and greatest of information technology
[02:12:50] e62: shinobi_one: Still having issues
[02:13:09] shinobi_one: e62: gist and show your code and what you are trying to do
[02:14:26] centrx: dps, Okay, yes, the find with hash syntax is from Rails <= 2.3 and that is the source of the deprecation warnings. Have you looked at the Rails guide on Querying: http://guides.rubyonrails.org/active_record_querying.html
[02:14:49] dps: i have looked at it some yes, but i am a slow learner and it takes a while for me to understand things
[02:14:55] dps: i am an amateur at relational data modeling
[02:15:04] centrx: The more the merrier!
[02:15:25] dps: i wish i was smarter and could learn faster but i am trying to pick up on this regardless
[02:15:38] dps: luckily i am doing this for a hobby so i don't really have any pressure or timelines or anything like that
[02:16:18] dps: thank you for helping me centrx you are always very nice and helpful to me
[02:17:54] e62: shinobi_one: okay
[02:21:10] dps: btw centrx, what you supplied worked: Command.joins("LEFT OUTER JOIN tagmapsorters ON tagmapsorters.command_id = commands.id").where("tagmapsorters.tag_id is NULL")
[02:21:11] dps: thank you :-)
[02:22:58] centrx: Marvellous
[02:23:05] e62: shinobi_one: https://gist.github.com/EricR/0c7a9d346e97436d84dc
[02:24:06] e62: It *seems* like Rails is assuming 1 month always equals 30 days
[02:24:26] e62: Which is what's causing the problem when I try to add the difference later to a different date in a different month
[02:24:43] skyjumper: that doesn't sound like something Rails would do
[02:25:36] e62: irb(main):136:0> 1.month.to_i * 6
[02:25:36] e62: => 15552000
[02:25:36] e62: irb(main):137:0> 6.months.to_i
[02:25:38] e62: => 15552000
[02:26:32] e62: Running the latest version of Rails 3
[02:27:42] centrx: e62, Those are non-descript months though right...
[02:27:56] e62: I've been stuck on this all day, trying to ocme up with a way to re-add the time with respect to the number of days in the months... It's driving me crazy
[02:29:39] Radar: shinobi_one: you mentioned Shopify earlier but not Spree. :O
[02:30:01] Radar: moneydouble: p.s. http://logs.ryanbigg.com/p/moneydouble
[02:30:05] centrx: e62, Looking at the gist it looks right though...?
[02:30:08] Radar: moneydouble: What happened the first 5 times you asked those questions?
[02:30:15] quazimodo: i need sevenseacat
[02:30:30] shinobi_one: Radar: actually I was going to, but I figured he hadn't heard of either of them (no offense to you!) after I typed in Shopify so I gave up and only went with huge names he would know lol
[02:30:31] Radar: quazimodo: No you don't.
[02:30:36] Radar: shinobi_one: ok :)
[02:31:02] moneydouble: Radar: Yeah I still haven't decided.
[02:31:09] e62: shinobi_one: The issue is it's inconsistant if I, say, want to add the time back to the user... They end up with a totally different date
[02:31:11] centrx: e62, subscription_remainder is 62 days, because January and December both have 31 days
[02:31:23] Radar: moneydouble: If you have not decided after 2 months of asking then there is something massively wrong.
[02:31:29] centrx: e62, Then you add 62 days to Time.now, and you get 62 days from now...
[02:31:44] e62: I'm not usually working with Time.now though
[02:32:04] e62: Hmmm... Trying to think of a better way to explain it
[02:32:39] centrx: e62, Do you have a real use case that fails you could gist?
[02:32:58] e62: centrx: Yeah sure
[02:33:57] uberjar: I <3 DateTime
[02:34:14] shinobi_one: e62: funny thing is Time.zone.now + 2.months
[02:34:56] shinobi_one: it goes from the 25th to the 25th
[02:37:50] bricker`LA: 2.months shouldn't be a method
[02:38:14] bricker`LA: I guess it's there just for consistency
[02:38:30] bricker`LA: but it's lame
[02:56:17] e62: Eh, I'm going to call it a night for now
[02:56:19] e62: Thanks guys
[03:01:12] uberjar: polyglot persistence: couchdb
[03:01:31] uberjar: + rails = big win
[03:01:35] uberjar: just sayin
[03:36:27] redwire: I asked on #heroku but I'm not getting a response so I hope it's okay for me to ask here, but:
[03:36:27] redwire: I'm trying to use the foundation-rails gem on heroku in my rails app and I've obviously included the gem in Gemfile and even ran 'heroku run rails g foundation:install' successfully. When I push to 'heroku master', I don't see anything about the foundation-rails gem failing in any way, yet my page doesn't have foundation's styling when I visit its subdomain on herokuapp.com.
[03:40:38] rhizome: does "heroku run" affect your working copy?
[03:40:54] zkay11: did you include rails_12factor?
[03:44:59] redwire: rhizome: No
[03:45:04] redwire: zkay11: No
[03:45:36] zkay11: I know not including it messed around with my CSS generally. Give it a shot: https://github.com/heroku/rails_12factor
[03:47:13] zkay11: More info << https://github.com/heroku/rails_12factor/issues/3#issuecomment-22664657
[03:49:20] zkay11: what effect did it have?
[03:49:40] redwire: Just tested it and it seems to work
[03:49:43] redwire: Thanks a lot zkay11!
[03:49:54] zkay11: oh yeah! internet high five!
[03:55:45] zkay11: Time for bed, night all
[04:20:29] revyd: I've got a noob question about how to handle incoming JSON in my controller
[04:27:01] centrx: revyd, Shoot
[04:29:04] revyd: Basically I have an app that creates a builds a user database. They want to use some landing pages on unbounce and send the data into my app. It sends a JSON but I've never done anything with JSON and I have no idea how to handle it. I've been searching for a few hours trying to find a tutorial or something but nothing...
[04:29:44] revyd: Just looking for someone to point me in the right direction
[04:31:23] centrx: With Rails you typically use ActiveSupport::JSON.decode(string_of_json)
[04:32:02] centrx: or ActiveSupport::JSON.encode(ruby object), aka object.to_json or object.as_json (there is a subtle difference with these sometimes)
[04:32:04] moneydouble: what is the virtualenv for ruby/rails?
[04:33:26] centrx: revyd, That was for
[04:33:52] centrx: moneydouble, What is virtualenv?
[04:34:30] centrx: moneydouble, Maybe you are looking for RVM
[04:34:39] moneydouble: centrx: well its what you use with python. It is like a private environment so everything you install, libs etc is inside this env.
[04:34:55] moneydouble: centrx: I think thats it :)
[04:35:08] s2013: i have an image uploader using carrierwave.. when someone uploads an image, i want to assign it a position in the db based on its filename, how would i even go about doing it?
[04:35:24] revyd: centrx: I guess I'm stuck confused even earlier in the process. In my create action, am I receiving a params hash?
[04:36:14] s2013: can i try something like before_save ?
[04:36:15] centrx: revyd, Yes, the params hash is created from a POST form or a GET query string
[04:37:18] revyd: centrx: in that case, will Rails automatically parse the JSON or do I need to do something with it before I can use it?
[04:37:44] centrx: s2013, I do not know about carrierwave, but I would put the logic in the controller myself
[04:38:28] centrx: revyd, http://guides.rubyonrails.org/action_controller_overview.html#json-parameters
[04:38:42] revyd: centrx: awesome thanks
[04:41:28] revyd: centrx: do I need to set up my routes any particular way to receive the JSON hash?
[04:44:05] centrx: revyd, I am not sure
[05:27:36] toydestroyer: Hi everyone! Is "return" needed after "redirect_to" ?
[05:32:07] redwire: Not required.
[05:33:05] redwire: You just need to keep in mind that a redirect_to doesn't return, so if you had 'if X then redirect_to Y end redirect_to Z', you'd get an error for having more than one redirect_to and would have to write 'if X then redirect_to Y; return end redirect_to Z'
[06:05:24] toydestroyer: redwire: great, thanks for explaining. But redirect_to prevent loading any views right?
[06:06:00] quazimodo: In my spec tests I am doing i FactoryGirl.build(:qfd) in a let block, saving it in my it "bla bla" do blocks, and for some reason after the first test, further FactoryGirl.build(:qfd) is giving ceilings and left_walls that have ids and are persisted. Is there some sort of caching going on?
[06:06:20] quazimodo: related => https://gist.github.com/anonymous/258dad589fd8ff220826
[06:06:46] redwire: toydestroyer: That depends what you mean. If you navigate into SomeController#show and you have a redirect_to somecontroller_index_path then yeah, somecontroller's show page won't be rendered.
[06:08:15] toydestroyer: redwire: great, thank you again!
[06:08:25] redwire: No problem.
[06:08:32] moneydouble: are there any tools to like see what queries are being ran?
[06:08:35] moneydouble: and the speed?
[06:08:49] moneydouble: *speed of each query
[06:08:58] redwire: You could play with your model calls in the rails console
[06:09:49] redwire: i.e. if you have a model User you can run `rails console` and then enter `User.all` and it'll output something like
[06:09:49] redwire: User Load (1.4ms) SELECT "users".* FROM "users"
[06:09:52] moneydouble: redwire: I guess what I meant was like a site profiler?
[06:10:09] redwire: Oh if you want something really big you could look into something like New Relic. :P
[06:10:42] moneydouble: redwire: yeah new relic is fairly expensive :P
[06:10:46] moneydouble: for what I have
[06:11:04] redwire: I don't really know of any cheaper alternatives, but that would be a starting point.
[06:11:05] quazimodo: Maybe i need to use lazy attributes?
[06:12:11] moneydouble: gotcha, thanks redwire
[06:12:19] redwire: No problem.
[06:22:10] redwire: Does anyone here have any experience handing AJAX requests in Rails?
[06:22:13] quazimodo: do FactoryGirl factories actually get saved to the db?
[06:22:24] quazimodo: s/factories/objects generated by factories
[06:22:43] quazimodo: as in, are they regular ActiveRecord objects, just generated via factory girl?
[06:23:43] s2013: redwire, yes
[06:23:45] s2013: what about it?
[06:24:13] redwire: Well I've got someone who's going to be sending my rails server an AJAX request and I just can't figure out how'd I'd handle that and return my own JSON
[06:24:20] s2013: moneydouble, yes mini rack profiler
[06:24:31] redwire: The latter JSON would be built up from some data read from my DB.
[06:24:36] s2013: they will just hit your controller/action
[06:24:41] s2013: doesnt matter how they send it
[06:24:46] s2013: youll just respond with the json
[06:24:53] redwire: Yeah I got that
[06:25:07] s2013: then what are you confused about?
[06:25:14] redwire: But I don't know how I'll parse the request into its parts and how to actually build that JSON.
[06:25:29] s2013: well give me an example of how the request would look
[06:25:40] s2013: they would send parameters right? get those params and respond accordingly
[06:26:18] redwire: It's going to be different for an AJAX request though, won't it?
[06:26:46] redwire: Like if they want to send me data about a message- its contents and author, and I want to respond with any other messages the server's received.
[06:27:42] s2013: uh you can send parameters via ajax
[06:28:30] centrx: With Ruby on Rails
[06:28:37] redwire: Oh my gosh.
[06:28:41] s2013: the data that gets passed in data
[06:28:42] redwire: Are you even being serious?
[06:28:48] centrx: Sorry, I take it back
[06:28:59] jacky: no he means it
[06:29:01] jacky: all of it
[06:29:08] s2013: so like $.ajax ({ type: 'GET', url: 'your url', data: 'this is where the params go });
[06:29:15] centrx: It is a true statement
[06:29:25] s2013: unless i am mistaken which i may as well be
[06:29:46] s2013: but who is sending the ajax request?
[06:29:50] redwire: Is data an object of parameter names and values then?
[06:29:59] redwire: Just the client side of the application.
[06:29:59] s2013: is it a get? post?
[06:31:11] s2013: you can use remote: true
[06:31:19] s2013: but anyways http://api.jquery.com/Types/#PlainObject that might hlep
[06:31:51] s2013: http://api.jquery.com/jQuery.ajax/ and this too
[06:32:04] redwire: So the request should look like $.ajax({type: 'POST', url: '/someurl', data: { one: 'value1', two: 'value2' }});?
[06:33:21] s2013: again, i might be wrong because a) i have no idea what im talking about b) i am jet lagged as hell
[06:33:43] s2013: you also need the success: in there
[06:33:59] redwire: The callback function that accepts the response data right?
[06:34:54] s2013: its the callback function on a successful request
[06:36:24] s2013: does it make more sense now?
[06:39:24] redwire: So do I just `render json: JSON_OBJECT` to send JSON back?
[06:43:39] s2013: in the respond_to block use format.json
[06:44:06] s2013: respond_to do |format| .. format.json { render json: yourjson }
[06:44:32] s2013: if you are only going to respond with json you should make that the default
[06:45:00] s2013: in your routes add defaults: { format: 'json' }
[06:45:08] s2013: next to that action
[06:54:37] redwire: Cool. Thans
[06:59:33] Ryan_420: Hello everyone
[07:04:00] BoEyC: I have a hash of ids and descriptions called codes. If i do puts code['real id'][:description], it returns the correct description, but when there is a 'incorrect id' I would return a no method error. How do I make it return nill instead
[07:19:04] redwire: s2013: Will I just access the parameters through like params[:param1] and params[:param2] or am I going to have to give that collection a special name like you usually do when you use form_for?
[07:23:47] macpool: is someone here available to do ajax contact forms?
[07:26:38] BoEyC: hey redwire and macpool, maybe you can help me answer a simple question
[07:26:41] BoEyC: I have a hash of ids and descriptions called codes. If i do puts code['real id'][:description], it returns the correct description, but when there is a 'incorrect id' I would return a no method error. How do I make it return nill instead
[07:27:31] redwire: You want a try/catch block
[07:27:53] macpool: BoEyC: fire
[07:29:15] s2013: redwire, yes through params
[07:29:20] s2013: sorry i didnt see it
[07:32:00] redwire: It's cool, thanks.
[07:35:17] macpool: my error message file is https://gist.github.com/macpool/5ef281fd4602a576fd78
[07:35:44] macpool: how can I make the flash notice disappear after a while?
[07:36:03] xenon21: I'm new to rspec, may i ask where to put RSpec.configure() in which file?
[07:37:21] xenon21: @macpool maybe using javascript?
[07:37:53] macpool: xenon21:is javascript the only way?
[07:41:00] xenon21: @macpool: i don't know, i'm new to web development. but i think using javascript here is fine.
[07:45:44] xenon21: @macpool: maybe this can also be used >> http://w3schools.invisionzone.com/index.php?showtopic=43758, look at the reply #5.
[07:45:45] xenon21: also check https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Using_CSS_animations.
[07:46:55] macpool: xenon21: thanks. let me see
[09:52:51] pontiki: pry-remote rocks
[09:53:44] certainty: did you know that spaceshuttles used to run software written in lisp that had a remote repl to fix the system on the fly?
[09:53:52] certainty: old technology resurrected
[09:54:08] pontiki: space shuttles were 1970 technology
[09:54:11] certainty: no pun intended btw
[09:54:14] pontiki: what do you mean "resurrected" ?
[09:54:50] certainty: pry-remote is a remote repl :)
[09:55:08] certainty: it's cool, don't get me wrong.
[09:55:13] pontiki: gdb could also do remote debug
[09:55:57] pontiki: pry makes me wiggly though
[09:56:04] certainty: yeah but those were no programming languages, that's why i didn't think of them
[09:56:08] pontiki: cos gdb was never this pretty
[09:56:38] certainty: it certainly is not.
[09:57:02] pontiki: oh, and XDebug for PHP (feh, ptui_
[09:58:46] pontiki: i was trying to get custom error pages to work today, and pry-remote came in so handy
[09:59:56] Asitha: Does anyone know how I can store iframes into a db without rails stripping the src?
[09:59:57] certainty: yeah pry is a great thing to have
[10:00:23] pontiki: i don't even know what that means, Asitha
[10:01:24] certainty: IFrame sounds like a digital picture frame made by Apple :D
[10:01:44] pontiki: take the source of the iframe, pull it in with an http request, store it
[10:02:11] Asitha: yeah sorry
[10:02:31] certainty: no need to be sorry :)
[10:05:48] Asitha: I'm trying to add video embedding for this gem - https://github.com/Nerian/bootstrap-wysihtml5-rails - and I've gotten it to work, but when I click submit to save it to my db, the iframes src is stripped.
[10:09:19] pontiki: ah, well, i don't feel like diving into a bunch of js tonight
[10:09:52] certainty: permanent feeling here
[10:09:53] pontiki: maybe leave an issue for the devs on github
[10:10:36] Asitha: the dev doesn't want to add it until the original bootstrap repo adds it to their repo
[11:54:11] frank_o: Hi, I got this `first_time_visiting?` helper method in my application controller. But how come in my views, I can't nest one first_time_visiting inside another? Please see https://gist.github.com/vsername/8615139
[12:04:53] pontiki: because 0 isn't falsy?
[12:06:39] frank_o: pontiki: Sorry i dont quite understand
[12:06:44] pontiki: second time it gets called, cookies[:first_visit] is 0, so it will return false
[12:07:41] frank_o: pontiki: Any thoughts about a possible workaround? :P
[12:10:01] frank_o: * Any thoughts to
[12:10:35] pontiki: i would look at your logic in this. the flow smacs of code smell
[12:10:47] DouweM: Annoying, FlipKey blocks connections from Heroku :/
[12:10:51] pontiki: why would you need to know that twice?
[12:16:50] frank_o: pontiki: Well _some_partial.html.erb is used elsewhere too so I need that extra check in there to show this thingy
[12:17:05] frank_o: haha smacks of code smell huh :P
[12:17:33] pontiki: but application.html.erb is not?
[12:20:15] frank_o: pontiki: I guess I could create a 'shared/some_partial_first_time' instead
[12:20:39] frank_o: but 90% of its erb would be duplicated from 'shared/some_partial' =(
[12:21:12] pontiki: you can nest partials
[12:21:39] pontiki: and you can set content_for
[12:23:48] frank_o: pontiki: not entirely sure what you mean sorry
[12:24:24] pontiki: spend an hour reading through this again: http://guides.rubyonrails.org/layouts_and_rendering.html
[12:25:07] frank_o: thanks yeh maybe i should
[12:30:04] malusalexandru: Hi guys! I'm migrating a project from Rails 2 and I have a problem with an observe_field. Tried to search for alternatives, gist: https://gist.github.com/maimutza/cfb3bda8d4a246d16eed
[12:47:25] frank_o: pontiki: something like this maybe? https://gist.github.com/vsername/8615139
[12:50:08] frank_o: Err no I'm tripping
[13:15:01] macpool: I ma not able to make this url regex work https://gist.github.com/macpool/59cecfd952b54e0c97fa
[13:15:40] macpool: I tried adding / A and /Z to it
[13:23:37] DouweM: macpool: what are you doing with that large a regex anyway
[13:25:01] macpool: DouweM: got the reference for it
[13:25:10] macpool: whats the better/shorter one?
[13:25:28] Rhainur: what's the best way to keep my DB config info private when pushing a rails project to Github
[13:25:41] DouweM: Rhainur: use config vars
[13:25:52] DouweM: macpool: what is the regex supposed to do? what will you be using it for?
[13:26:18] DouweM: Rhainur: env vars. mixed a couple of things up
[13:26:29] Rhainur: I was a bit confused there
[13:26:35] DouweM: Rhainur: on Heroku, config vars are exposed as env vars to the app
[13:26:35] macpool: its for a field in contact form
[13:26:37] Rhainur: was googling config vars in rails to see if I missed something
[13:26:48] DouweM: Rhainur: you didn't, my bad
[13:27:01] certainty: Rhainur: there are several. The most common are environment variables or just keeping the production config on the target server only (possibly generating it during deployment)
[13:27:25] certainty: i prefer the latter
[13:27:25] DouweM: macpool: don't bother with validation at all, or only check whether it starts with https?:// or use URI.regexp
[13:27:31] Rhainur: I'm seeing mention of figaro here
[13:28:49] certainty: figaro unifies the interface to configuration options that may come from the enviromnet or a configuration file
[13:29:27] certainty: this limits your configuration values in that it can only be strings which i found disturbing
[13:42:49] macpool: DouweM: i'll use URl.regexp thanks
[14:17:09] frank_o: Hi, I have this `first_time_visiting?` helper method in my application controller, but I have a case here where I need to nest one first_time_visiting inside another. Can somebody help? I'm almost there: https://gist.github.com/vsername/8615139
[14:19:38] Rhainur: frank_o: why not put the helper in helpers/application_helper.rb?
[14:20:55] toretore: i don't see what the problem is
[14:23:06] maodun: I have 3 models: Order, PurchasedItem, and Product. An Order has_many :products, through: :purchased_items. Assume order.product_ids = [1]. If I update order.product_ids = [2], what happens to the PurchasedItem record that was originally linking Product 1 with my Order?
[14:23:39] maodun: is it deleted? Or is the order_id on the purchased_item just set to nil?
[14:24:11] toretore: do it yourself, then you'll always know
[14:24:36] frank_o: Rhainur: Not sure if that'll work, I'll investigate that further though
[14:24:42] toretore: frank_o: set the cookie in an after_filter
[14:25:17] frank_o: toretore: Basically I'm unable to check if first_time_visiting inside another if first_time_visiting
[14:25:28] frank_o: after_filter you say
[14:25:29] toretore: def first_time_visiting? !cookies[:touched]; end
[14:26:04] toretore: after_filter :touch_cookie; def touch_cookie; cookies[:touched] ||= true; end
[14:27:39] frank_o: toretore: thats beautiful, one sec
[14:29:34] frank_o: toretore: like this? https://gist.github.com/vsername/8615139
[14:30:44] toretore: no, like i said
[14:31:05] toretore: i say everything i write out loud, but i don't think you can hear that
[14:31:45] frank_o: i dont do that but maybe i should
[14:31:55] frank_o: what are the benefits?
[14:32:24] toretore: you don't get bothered by other people who tend to keep their distance
[14:32:55] frank_o: anyway, its this simple? https://gist.github.com/vsername/8615139
[14:33:55] frank_o: basically its for showing this intro div (welcome to my new site bla bla) if it's the user's first visit to my site (cookies should reset after browser close though)
[14:33:55] helpa: Why don't you try it and find out for yourself?
[14:39:28] frank_o: toretore: halleluja brother!
[14:39:52] frank_o: toretore: thank you so much :P
[15:03:57] frank_o: toretore: again man that was really nice of you.
[15:58:21] thei: Hi. I have just cloned Rails project but I'm unable to lauch it. I'm getting error """The program 'rails' is currently not installed You can install it by typing: sudo apt-get install rails""". However when I'm in catalog with otehr project, command 'rails' works like a charm. Do you have any ideas what's going on?
[15:59:35] epochwolf: thei: interesting, how did you install ruby?
[15:59:59] thei: As far as i remember I used guide at ruby website.
[16:00:28] epochwolf: hmm... can you give me the url for the project you cloned?
[16:00:40] thei: But when I used `cd` to enter cloned proect catalog I got information that older verrsion of ruby is installed.
[16:01:29] thei: When I entered catalog I got information: ruby-1.9.3-p327 is not installed. To install do: 'rvm install ruby-1.9.3-p327'
[16:01:38] epochwolf: ah good, you have rvm installed.
[16:01:38] thei: I used that command.
[16:01:53] epochwolf: okay, project url please :)
[16:03:04] thei: This is a private repository and I don't have a permission to invite other developers to it :(
[16:03:43] epochwolf: thei: okay, have you used ruby before?
[16:03:51] thei: I think i did someting similar to python's virtualenv. When I installed older version of ruby, that older version can't see libraries of newer ruby :|
[16:04:17] epochwolf: thei: rvm isolates rubies into silos. You can't see libraries installed for other versions.
[16:04:39] epochwolf: and stay on track here, I really want to help but I need some background info first.
[16:05:00] epochwolf: I basically need to know what your level of experience with ruby and rials is and why you are cloning this project.
[16:05:53] epochwolf: I don't know what you know and what your long term goals are. Once I know that, I can help get you there as quickly as possible.
[16:06:14] thei: I don't have much ruby experience. I have only browsed The Ruby programming Language and walked through introduction tutorial at rails site
[16:06:50] thei: I mean I browsed book called "The Ruby Programming Language"
[16:07:09] epochwolf: okay, I can handle that.
[16:08:07] byprdct: Hey guys I'm going through the methods in the ruby docs and it lists each method with an example of what it's explaining but it doesn't show you a use case scenario. Does anyone know of any documentation or something along those lines that show you common use case examples for each method?
[16:08:11] epochwolf: You're going to be in for a fun ride. It takes 3 to 6 months for an experienced programmer to learn to use rails properly. (As in not fighting the framework)
[16:08:24] epochwolf: byprdct: not really, you'll need to figure taht out for yourself.
[16:08:35] byprdct: mmm that sucks :)
[16:08:49] byprdct: that's a book waiting to be written
[16:08:50] epochwolf: byprdct: sufficent programming experence is sufficent for understanding why most of the stuff is there.
[16:09:01] epochwolf: eh... not so much.
[16:09:05] byprdct: yeah zero programming expeirence here
[16:09:31] epochwolf: byprdct: um... I would recommend going through python's tutorial instead of diving head first into ruby.
[16:09:45] epochwolf: At least to get some basic head knowledge in.
[16:10:00] epochwolf: http://docs.python.org/2/tutorial/
[16:10:15] thei: epochwolf: You said something about isolated silos. Can I just install Rails again for older ruby version?
[16:10:18] byprdct: ok thanks for the suggestion epochwolf I will check it out
[16:10:56] epochwolf: byprdct: I just don't want throw ruby at you without existing experience.
[16:11:06] epochwolf: Python is fairly similar.
[16:11:21] epochwolf: thei: don't do that. There's an easy way to install it.
[16:11:38] byprdct: I've wanted to learn Python too but wanted to learn Ruby first
[16:11:44] epochwolf: thei: cd into the project folder. Make sure rvm loads the ruby that the project requires it.
[16:11:52] byprdct: but I'll go through these docs
[16:11:54] epochwolf: byprdct: learn python first, it's a little bit easier.
[16:12:06] epochwolf: byprdct: python has better docs for beginners.
[16:12:15] byprdct: ok cool, thanks epochwolf
[16:12:46] epochwolf: byprdct: and anything you learn can probably be adapted to ruby alter.
[16:13:03] epochwolf: thei: once you're in, do `apt-get install bundler`
[16:13:28] epochwolf: bundler is a gem (ruby libraries are called gems) management system
[16:13:58] epochwolf: once bundler is installed run `bundle` and it will automatically install all dependencies.
[16:14:53] thei: epochwolf: ruby -v says it's 1.9.3 - the one that I installed with rvm before.
[16:15:01] epochwolf: thei: good.
[16:15:11] epochwolf: thei: then run the commands I gave you :)
[16:15:55] thei: epochwolf: E: Unable to locate package bundler :(
[16:16:14] epochwolf: whoops... I crossed my commands. That's `gem install bundler`
[16:16:22] epochwolf: ACTION is not perfect :)
[16:18:52] thei: epochwolf: It's fetching something. You said before that 'It takes 3 to 6 months for an experienced programmer to learn to use rails properly' does that mean that Rails is a difficult framework? Is it more harder than e.q. django?
[16:19:19] epochwolf: thei: it's a big framework and there's lots of stuff to learn. That's all.
[16:19:36] epochwolf: And some of the behaviors aren't really explained very well.
[16:20:09] epochwolf: thei: the 3-6 months thing was true for Rails 2. I don't know if Rails 3 or 4 makes that easier.
[16:20:30] epochwolf: thei: and I'm waiting for someone else to chime in and call me on my bullshit :)
[16:21:30] thei: epochwolf: Bundle is downloading large amounts of libraries/gems. Does that mean that they are all used by this project? Should I read docs for each of those libraries?
[16:21:59] epochwolf: thei: look at Gemfile to see the libraries that are used.
[16:22:09] epochwolf: Rails itself includes a ton of libraries.
[16:23:17] epochwolf: and no, don't go reading all of the docs.
[16:40:50] AntelopeSalad: epochwolf: 3-6 months seems reasonable
[16:41:20] thei: AntelopeSalad: Is it harder than django? :(
[16:41:29] epochwolf: AntelopeSalad: yeah, and 3-6 months is to reach "Not fighting with the framework" level. You can be productive before then.
[16:41:58] epochwolf: thei: maybe, maybe not. Since I have existing web framework experience, it means I can get on board much faster.
[16:41:59] AntelopeSalad: thei: hard to say, rails has one of the best communities imaginable so there's a billion tutorials and video tutorials
[16:42:00] ddd: bear in mind thats 3-6 months of sustained working with it
[16:42:12] ddd: trying things out etc. half assing the learning.. you'll pay for it. don't do it
[16:42:17] epochwolf: 3-6 months using rails as a day job.
[16:43:43] AntelopeSalad: epochwolf: yeah i think an experienced dev who is already familiar with a lot of things can produce results in seriously 2-3 days
[16:44:14] thei: epochwolf: Bundle has completed all instalations. What now?
[16:44:29] epochwolf: thei: rails should be isntalled :)
[16:44:32] AntelopeSalad: but it takes time to get to the point where you're not googling every 10 seconds to figure something out
[16:44:33] ddd: I've been in here ( epochwolf, what.. 3y now?) I started working with Rails about 2y of just lurking. (I mean actually using it for real, not just picking at it). I put about 6 months in, was getting paid for work, etc. I took 4.5 months off. No coding no nothing. (School) I paid for that heavily in both remembering Ruby itself, and wow if Rails framework itself isn't just kicking my ass
[16:45:11] ddd: Trust me when I say sustained levels of concentration on it. There's just this massive amount of tricks and tips in Rails, nevermind the framework itself, that can catch you out
[16:45:37] epochwolf: I've got to jump off for a bit. Driving home from Panera.
[16:45:40] ddd: The community is absolutely awesome for helping though. Its one of the things I *truly* appreciate about Ruby and Rails
[16:45:49] ddd: oof. careful. roads are really shitty
[16:46:02] epochwolf: ddd: shitty for ohio, average for wisconsin.
[16:46:17] ddd: we're getting dusted right now, but its cold.
[16:46:18] epochwolf: ddd: I've already been hiking in snow.
[16:46:21] ddd: all my pipes are frozen
[16:46:28] epochwolf: 26??F here. Toasty warm.
[16:46:31] ddd: i need to.
[16:46:34] ddd: 25F here
[16:46:42] epochwolf: ddd: you puss XD
[16:46:47] ddd: it was 5F last night though
[16:46:49] epochwolf: ddd: -10??F is cool.
[16:46:52] ddd: yeah, I think I'm getting old ;)
[16:47:08] epochwolf: anything above 10??F is shorts weather.
[16:47:13] ddd: screw that
[16:47:21] ddd: anything above 40 is shorts weather.
[16:47:26] ddd: anything less reqires a parka damn it!
[16:47:45] epochwolf: ddd: partially joking here.
[16:47:57] epochwolf: I've got a fleece vest on.
[16:48:08] epochwolf: but that's because I'm getting over a touch of flu.
[16:48:14] ddd: you've seen me. I'm skinny as a freakin rail! Cold gets *right* through me
[16:48:31] epochwolf: ACTION is Le Fat Basrad.
[16:48:42] ddd: but so long as I keep my feet warm I can survive. once those get cold though. I'm done
[16:48:43] AntelopeSalad: thei: i recommend spending a few days or a week with each and just picking the one that makes you happy
[16:48:48] jammanbo: As programmers do you guys not have an overwhelming urge to reject Farenheit?? At least here, in safe company?
[16:48:55] ddd: naa. You're like 2 of me, and I'm a freakin stick!
[16:49:17] epochwolf: jammanbo: no... Farenheit is the only Standard measurement that actually makes sense.
[16:49:25] ddd: jammanbo I'm American. Its how everything is referenced. Its what I was taught, I learned C in the Army, but I still think F
[16:49:25] Scient: no, not really
[16:49:26] jammanbo: ACTION explodes
[16:49:42] Scient: 0 for freezing makes much more sense
[16:49:43] epochwolf: jammanbo: Farenheit is awesome for describing weather for humans.
[16:49:47] ddd: scient yeah'
[16:50:00] epochwolf: Scient: when doing science Celicus
[16:50:10] Scient: but we are not talking about science, are we
[16:50:17] epochwolf: weather reports? Farenheit please.
[16:50:22] ddd: exactly
[16:50:33] ddd: exactly to the F for weather that it
[16:51:27] ddd: i deal a lot with science. its my passion bug, but unless I'm doing something like astrophysics or something 'deep' like that, I'll stick with F for daily life :)
[16:51:31] jammanbo: I'm being trolled right? Obviously no scale is inherently more sensible than any other, but given that outside the US, what 2 countries (Liberia and N. Korea maybe), use F, you've got to say conformance makes sense, no?
[16:51:45] ddd: jammanbo where it makes sense, its done
[16:51:46] Scient: US is the only country afaik
[16:51:49] epochwolf: jammanbo: I'm not trolling.
[16:52:03] Scient: jammanbo: they are just 'muricans, they dont get it think :)
[16:52:03] ddd: but the *population* is taught F, so, naturally, we think in F
[16:52:05] makerop: hey, how do i change the active admin filter for a model so it displays an arbitrary attribute, rather than User::23234jj etc
[16:52:12] ddd: it takes a bit to convert mentally
[16:52:16] Scient: thats the whole point ddd
[16:52:19] Scient: everything should change
[16:52:29] Scient: not just displaying temperature in weather reports
[16:52:35] epochwolf: makerop: where are you seeing User::21424?
[16:52:40] ddd: scient even if you started now it would take about 10-15 years before we'd have a population starting to think purely in C
[16:52:41] Scient: the rest of the world doesnt use F anywhere
[16:52:46] makerop: epochwolf, under Filters -< user
[16:52:48] pontiki: as a programmer, i'm interested in making my programs work for the people that use them
[16:52:49] Scient: besides maybe science stuff
[16:52:54] pontiki: as such, i will give them a choice
[16:53:01] Scient: ddd oh yeah for sure, its not easy
[16:53:03] ddd: yeah but thats where it has to be absolutely dead on (science)
[16:53:05] jammanbo: Scient: Off top of my head, I think Liberia and N. Korea use it. Or am I thinking of some other archaic practice/
[16:53:06] epochwolf: makerop: can I see a screenshot?
[16:53:06] pontiki: between scales/measurements systems, mkay?
[16:53:08] ddd: so it makes sense to do it there
[16:53:19] Scient: i would also change the stupid date format thing as well
[16:53:23] Scient: once we are at it
[16:53:30] ddd: i do my dates usually Day/Month/Year
[16:53:34] ddd: but thats an Army thing
[16:53:36] Scient: which makes sense, right
[16:53:42] pontiki: discoridan dates for all!
[16:53:44] Scient: haha thats what i was told, thats army format
[16:53:51] ddd: i didn't start doing that though til I joined the service
[16:53:59] Scient: and when i talk about 24h times instead of am and pm, i was told thats the army time :D
[16:54:09] Scient: im like wtf, thats how normal people do it :D
[16:54:14] ddd: militaries were the first to adopt those systems iirc
[16:54:23] ddd: thats why they're considered 'military' systems.
[16:54:23] epochwolf: makerop: oh, do you mean in the dropdown?
[16:54:27] epochwolf: for filters?
[16:54:32] makerop: epochwolf, yes
[16:54:34] ddd: *every* military in the world uses them. Or at least that *I* know of
[16:54:34] Scient: AM/PM is used in some other countries as well i think? but i dont know any other country that would have a m/d/y date format
[16:54:36] makerop: sorry, was googling
[16:54:49] makerop: i want it to disply User.email, rather than the model reference
[16:54:51] ddd: yeah some use the AM/PM and M/D/Y as well civilian wise
[16:54:54] epochwolf: makerop: yeah, there's a list of methods AA will try.
[16:55:16] makerop: epochwolf, do i need to override to_s?
[16:55:19] Scient: does the army use metric units as well ddd?
[16:55:21] makerop: i tried that, and it didnt work
[16:55:21] Scient: or imperial
[16:55:42] ddd: i prefer you talk to me in 24h and D/M/YYYY format. But I do have to admit I've lost the skill (or its *extremely* reusty) of thinking in C
[16:55:43] toretore: they use clicks
[16:55:46] ddd: scient yeah
[16:55:51] ddd: we use metrics
[16:55:54] Scient: haha toretore :D
[16:56:07] Scient: im having a hard time adjusting to F though
[16:56:10] ddd: we use klicks for shorthand for kilometers knuckjlehead ;)
[16:56:14] Scient: i see the numbers and they arent telling me anything
[16:56:24] Scient: im still using phone apps that tell me the temperature in C
[16:56:24] ddd: scient yeah thats my mindframe when I see C
[16:56:27] Scient: its easier like that :D
[16:56:45] Scient: im obviously opinionated, but to me it seems generally easier
[16:56:45] ddd: it takes me a second to recognize its C, and then I'm scrambling to convert in the head hehe
[16:56:46] makerop: epochwolf, i tried the various things I read on SO, but no luck
[16:56:50] Scient: the closer to 0 you get, the colder it is
[16:56:51] toretore: Scient: are you in the america?
[16:56:54] ddd: scient I wouldn;t disagree with you
[16:57:02] Scient: and around +30 is quite warm
[16:57:05] Scient: toretore: ye
[16:57:12] Scient: and -20 is very cold
[16:57:12] ddd: scient I would actually back a proposal to force our schools to teach both with C being the emphasis
[16:57:19] Scient: 3 numbers you need to know :P
[16:57:20] toretore: Scient: temporary or permanent?
[16:57:27] jammanbo: It's the kind of behaviour you'd expect if Microsoft built a country. Choosing awkward and completely non-standard methods for measuring, time, distance, weight, ???
[16:57:35] Scient: toretore: humm.. temporary-permanent, for at least 3-6 years
[16:57:37] ddd: jammanbo at one time it WAS standard
[16:57:44] toretore: Scient: awesome
[16:57:48] ddd: the problem is the time it takes the states to change from an old standard to the new
[16:57:51] ddd: thats the issue
[16:57:58] Scient: toretore: been here since the end of october or so :)
[16:58:01] toretore: Scient: new job then?
[16:58:01] ddd: i admit it, we fight change
[16:58:06] ddd: :shrug:
[16:58:26] Scient: toretore: yep, was hired and brought over by the same company i used to work with at my job in Estonia for... 3 years or so
[16:58:44] ddd: scient I didn't know you were Estonian. For some reason I thought you were a Brit
[16:58:47] toretore: i love how people using old timey measures think the rest of the world has always used metric
[16:59:02] toretore: Scient: ah. coolio
[16:59:22] toretore: like everybody didn't switch at one time or the other
[16:59:37] Scient: UK still uses weird imperial stuff i think
[16:59:43] Scient: but i can kind of understand it in their case :P
[16:59:46] ddd: Well meaning born in Britain, not in Estonia. (lol, tough to talk sometimes because you can be born in a country, be different both racially and ethnically
[16:59:48] pontiki: oh, no, representations change at different times in different places
[16:59:52] Scient: they live on an island and they still have a queen :D
[17:00:15] ddd: scient the queen doesn't *really* have the power. Parliment does
[17:00:17] toretore: they just always have to be different. they have a very fragile national ego
[17:00:17] Scient: ddd: nope, pure Estonian, lived all my life there until moving to the states now
[17:00:19] pontiki: adoption of de jure standards is slow
[17:00:20] khoury: Hello everyone
[17:00:26] ddd: scient welcome! :)
[17:00:34] Scient: i know, queen just waves on a balcony from time to time and everyone cheers
[17:00:37] jammanbo: They do, but leagally they have to do stuff in metric (EU). Just thinking that there's some things, well one, where I'll cling to tradition. I don't want 0.5l of beer. I want a pint.
[17:00:52] Scient: yeah thats true as well
[17:00:59] Scient: they just use some stuff because culture or something
[17:01:01] khoury: I have a little rails related question :)
[17:01:06] Scient: in "official" stuf its all metrics
[17:01:10] pontiki: jammanbo: the pint is a funny thing, for sure
[17:01:20] toretore: i think brussels should forbid the mention of pints, that would be fun
[17:01:23] Scient: the one thing i really dont get is "stones" :D
[17:01:28] jammanbo: pontiki: it's just the "right" amount to buy beer in...
[17:01:30] pontiki: because in UK and commonwealth, a pint is 20 ounces
[17:01:43] pontiki: whereas in most other places it's 16 ounces
[17:01:46] jammanbo: and 635ml (or whatever) doesnt roll off the tongue :(
[17:01:47] ddd: wqhere it *counts* (unless its advantageous monetarily) the US uses metric. The vast majority of our shipping and steel industry is metric.
[17:02:08] toretore: a pint is almost .5l
[17:02:14] pontiki: altho a ha'pint is right for this mouse
[17:02:15] toretore: nobody would know the difference
[17:02:19] ddd: its where we make more money that we use Imperial because it works to our advantage, but thats not a great many places
[17:02:20] jammanbo: its more than half,
[17:02:27] jammanbo: its closer to 2/3 I think
[17:02:30] Jasinai: khoury: ask, perhaps they read it ;)
[17:02:32] toretore: hence the ALMOST
[17:02:46] toretore: no, it's less than 550ml
[17:02:54] pontiki: you are both right!!
[17:03:04] jammanbo: woah, no ??? I'm wrong
[17:03:19] jammanbo: its just over half in UK, and under in murica apparently
[17:03:31] ddd: like our milk is done using the Imperial Gallon. We still do that because we can make more money using the Imperial standard. Our farming communities couldn't give two shits about the metric system.
[17:03:40] khoury: I have a rails application with some models without any fields. I have connected to a remote DB and I have a SQL dump from that DB. How can I import that SQL file to my rails app and get the right migrations for those tables? Or do I have to manually create the models? Maybe a stupid question :/
[17:03:45] toretore: haha gallon milk jugs
[17:03:46] pontiki: https://en.wikipedia.org/wiki/Pint_glass
[17:04:05] epochwolf: makerop: I'm digging, it looks like it's actually done by formtastic.
[17:04:12] jammanbo: khoury: mysql dumps will create the required schema for you
[17:04:28] makerop: epochwolf, i figured it out
[17:04:36] khoury: Ok, so then I modify my models so they have the same attributes?
[17:04:37] ddd: toretore I have Canadian citizenship too. I grew up on both sides. (flipflopping). It *still* shocks me when I go to visit Mom, and I hav eto buy milk in bags, labeled metrically
[17:04:49] makerop: turns out i had to do it in my actual model, not app/admin/model.rb
[17:04:55] toretore: at least it fits in your trunk
[17:04:57] makerop: i just did a def title self.email end
[17:04:59] ddd: hehe true :)
[17:05:15] jammanbo: khoury: you dont have to do anything to your models. they'll automatically have the fields. You might want to add validations or something.
[17:05:34] khoury: jammanbo: nice... I see
[17:06:01] khoury: jammanbo: I have found different commands for doing this, is there a "rails 4" way of importing the sql-file?
[17:06:13] jammanbo: Man. American pints are tiny. That is not cool.
[17:06:40] epochwolf: makerop: https://github.com/justinfrench/formtastic/blob/master/lib/generators/templates/formtastic.rb#L45-L50
[17:07:01] jammanbo: khoury: No, this is not a rails thing. Use your database. If its mysql and you have a mysql dump, just do $ mysql -u username -ppassword < dump.sql
[17:07:51] ddd: ok gotta go. gotta start taking all the dogs out.
[17:08:02] jammanbo: how many doggies?
[17:08:19] ddd: 6 we own, 3 we rescued
[17:08:30] jammanbo: wow. good for you.
[17:08:37] ddd: we got one more we're getting on the first, thats *my* dog
[17:08:38] jammanbo: I love dogs. I miss mine :(
[17:08:46] ddd: Mine died last sunday
[17:09:19] ddd: she got bit by a brown recluse spider, got an infection from the bite, her immune system retaliated and attacked her blood supply as well.
[17:09:22] ddd: triple storm. killed her
[17:09:42] khoury: jammanbo: I meant so that rails inserts the schema
[17:10:14] ddd: she made absolutely freakin sure that I have a companion again. She picked out one we're getting on the first. (Don't know if you believe in this stuff, but my wife and I do)
[17:10:16] Modicrumb: all I ever wanted all I ever needed is heeeere in my arms
[17:10:35] ddd: modicrumb exactly :)
[17:10:59] ddd: we did *everything* together. She was my heart and soul
[17:11:03] jammanbo: ddd: I believe we project, but I also believe that there is more there than a lot of ppl see.
[17:11:16] jammanbo: (in a non-spiritual sense)
[17:11:18] ddd: I'm writing an Animal Rescue Transporter Network web application in Rails dedicated to her
[17:11:40] jammanbo: transport network?
[17:12:00] ddd: jammanbo spirit, non-spirit, I absolutely 100% believe this dog (even the name) is either HER returned, or, one she absolutely thinks belongs with me.
[17:12:56] ddd: |jammanbo an 'Animal Rescue' Transporter Network built to aid in
[17:12:57] ddd: |accepting, registering, and utilizing people who sign up to transport animals
[17:13:02] ddd: from various shelters, to medical treatments, and on to adopters.
[17:13:04] ddd: damn it
[17:13:21] ddd: sorry. was from her dedication. explaining what the app was. didn't think the script would let the extra \n through
[17:13:36] jammanbo: khoury: The only way to get the relevant migrations is to write them manually. You shouldnt need to do anything special though to get the attributes loaded into your models after you have imported the dump.
[17:13:48] Modicrumb: nice ddd I hope your web app turns out well
[17:14:21] ddd: modicrumb if i get themn a prototype, the ASPCA (American Society for Prevention of Cruelty to Animals) will help me get grants to finish writing the rest of it
[17:14:31] ddd: there's *nothing* like this app in that particular 'market'
[17:14:51] ddd: right now its all done using cobbled together apps, or a pen and paper and a phone
[17:15:30] ddd: My Zoie would want this out there. Help get other Zoies to *their* other halves.
[17:15:30] Modicrumb: I'm writing a billing system myself in my spare time but I am still on the user page part, finally got a form with ajax working
[17:15:44] jammanbo: I don't really understand. How great are the distances that animals need to be transported? And is this like "I meet you at A and give you the dog, then you go to B and give him the dog, and then he brings it to C"?
[17:15:46] ddd: yeah i'm doing all of this in my own time as well
[17:16:02] ddd: jammanbo we did a rescue just last week, before Zoie died, that was over 3000 miles
[17:16:07] ddd: yeah thats exactly it
[17:16:27] ddd: with full tracking from each individual shelter, to all appointments, to the final adopter
[17:16:42] Modicrumb: it also is probably somewhat of a pain to transport since you have to have your car or whatever set up, then again it seems like something you could just communicate on craigslist
[17:16:58] Modicrumb: or something
[17:17:23] Modicrumb: but I'm sure your web app will be a much more sophisticated and specialized solution
[17:17:28] ddd: modicrumb more animals have been put down because the rescues couldn't track who was supposed to get whom and take to where. or they couldn't do it in the timeframe alloted by the various shelters (to get the animals out and in the pipeline)
[17:17:42] jammanbo: ddd: I don't mean to criticise because I love that you are trying to help, but it seems odd that you'd need to move animals so far. Surely there must be ppl (like you) locally (say within 100 mile (imperial!) radius) who'd be willing and capable of taking the animal?
[17:17:45] ddd: yeah its exactly that. specifically targets the issues
[17:17:47] Modicrumb: ddd, ahhh alright then that's good you are writing it
[17:18:12] Modicrumb: ddd, not that I was ever discouraging you
[17:18:19] Modicrumb: just was curious
[17:19:07] ddd: jammanbo many are. but when we can't find an adopter for Petey, and the shelter is going to put Petey down in 12 hours, and you can't find someopne local to adopt, do you just let that animal die if the animal has somoene in California that says they want Petey and are willing to pay for transportation, or other rescues are willing to help pay the travel costs to get Petey to his new owner?
[17:19:25] ddd: No, you don't
[17:19:32] ddd: you figure out the logistics and make it happen.
[17:19:40] ddd: Thats what this app specifically targets
[17:19:56] ddd: Red Cross does it for food, clothing etc.
[17:19:59] ddd: I'm doing it for animals
[17:20:51] jammanbo: Okay. Fair play.
[17:22:36] ddd: there's a program called Pilots and Paws that transports across the *world*! They use their own fuel to transport animals for *free*
[17:23:12] ddd: its a matter of people being human. for catering to the good side of ourselves. we have so much to give the world, other species, and ourselves. there are millions of us that are doing just that.
[17:23:18] ddd: by helping those that can't help themselves
[17:23:23] ddd: least thats how i see it
[17:24:15] ddd: i can't always help humans, but i damned sure can help the other species that completes my life. in this case, dogs (and cats)
[17:25:28] ddd: anyways, i better get to walking these dogs or they're gonna have some wet kennels, and I'll have some wet rugs lol :)
[17:26:41] Modicrumb: enjoy yourself
[17:47:59] antoine: anybody used easycaptcha before ?
[17:48:42] antoine: anybody there at least ?
[17:50:46] antoine: anybody can help in in base url thing with rails please ?
[17:54:36] rushed: antoine: you'll generally have better luck just asking your question (and providing related errors & code), then trying to find someone to pre-commit to answering it :) (there are tips in the channel header)
[17:55:49] antoine: rushed, unfortunately did, but no one answered ? however, here is my question, using easycaptcha it implements views helper captcha_url, but this function returns /captcha and I need it to return /something/captcha
[17:56:46] antoine: it seems it takes the base url from somewhere
[17:56:50] antoine: and I need to change that
[18:01:00] rushed: antoine: did you provide any code or links to the tool or gem you're using? if you're trying to get it working out of the box does the gem provide an example you can compare yours to?
[18:01:31] antoine: it is working on unicorn, however with passenger virtual host it is not
[18:22:40] jtoy: why would rails generate this sql: User.find(123)
[18:22:46] jtoy: User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."" = ? LIMIT 1 [[nil, 123]]
[18:22:51] jtoy: I just typed that find into the console, and it is happenning on the server also
[18:23:55] jtoy: did find change? i thought find_by_id works
[18:23:55] rushed: jtoy: why not?
[18:24:10] jtoy: rushed: its adding a nil
[18:24:12] jtoy: that makes no sense
[18:24:29] jtoy: i mean find_by_id works, but find isnt
[18:26:17] rushed: jtoy: User.find(123) isn't returning a user with an id of 123 for you? have you restarted since any schema changes? how did you confirm a user with an id of 123 exists?
[18:26:40] certainty: jtoy: it probably can't figure out the primary key field. What dbms is this sqlite?
[18:29:53] jtoy: yes, its bc of the primary key
[18:30:01] jtoy: i have an id column, but its not a primary key
[18:30:25] jtoy: i thought find was hardcoded to id as opposed to primary key
[18:31:05] certainty: jtoy: add the primary key constraints
[18:31:23] certainty: that is: make it a primary key column and it should work
[18:32:10] rushed: jtoy: if you're using migrations you don't need to add anything for :id into your create_table unless you're trying to change the defaults
[18:35:48] certainty: jtoy: no find is not hardcoded to id. This would break much code
[18:45:24] airdisa: afaik find_by_id(123) is renamed find(123)
[18:45:57] airdisa: when id is primary as table creates id automagically with AR
[18:47:17] ayonix: isn't it find_by(id: 123) in rails4?
[18:47:44] macpool: how do we create a hidden field in a form, which appears only if there is a certain selection from another field?
[18:48:08] airdisa: that sounds like where(id: 123)
[18:48:49] airdisa: troubleshoot in the console with User.last etc.
[18:48:50] tbuehlmann: find_by will either return a single record or nil
[18:49:58] airdisa: I think find_by is all where now, I could be wrong
[18:50:17] airdisa: depends what version Rails and AR
[18:50:18] certainty: macpool: it's a job for javascript
[18:51:27] macpool: certainty: can you help me on this?
[18:52:51] masscrx: i've started learning ror, im reading a lot of info about it, and what is the best practise for using ror with apache and mysql?
[18:52:58] masscrx: on some blog is written:
[18:52:59] certainty: macpool: can't tell. I'll look here sporadically. The basic idea should be clear though. Add a handler that fires when your field changes. This handler sets the value of the hidden field
[18:53:07] masscrx: The quote-unquote best practice for
[18:53:07] masscrx: a Rails deployment architecture using mongrel is one or more Apache
[18:53:07] masscrx: servers accepting requests from the web and proxying them to one or
[18:53:08] masscrx: more mongrel servers on the second tier
[18:53:11] rushed: macpool: can you describe the feature you're trying to implement?
[18:53:51] masscrx: so should i use mod_rails, or multiple mongrel instances and proxy ?
[18:53:52] centrx: masscrx, Too much flooding, hard to read
[18:54:11] masscrx: this is 3 lines ;]
[18:54:18] centrx: Looks like 7
[18:54:24] rushed: masscrx: that sounds potentially old, and if you're just getting started more complex then you might need, if you're really attached to apache you should check out passenger https://www.phusionpassenger.com
[18:54:59] masscrx: i have apache with passenger yet
[18:55:18] masscrx: so in 'apache' environment this is the best way yep ?
[18:55:47] certainty: it's certainly the easiest. The 'best' is subjective
[18:55:50] macpool: rushed: I have an option of "Tracking" in the subject my contact form. I want, if the user selects that option, another field appears below subject
[18:55:56] rushed: masscrx: there is no best it depends on your application
[18:57:53] masscrx: what about mongrel ? is noteworthy?
[18:58:07] certainty: masscrx: not state of the art
[18:58:12] jammanbo: I've been a happier (relative term) developer since I switched from Apache+passenger to nginx+[thin or unicorn].
[18:59:55] masscrx: jammanbo: yeah it is clear ;]
[19:06:09] rhizome: what was the complication?
[19:10:48] masscrx: jammanbo: can you explain in short, why you choosed nginx+unicorn, instead nginx+passenger ?
[19:13:14] guilund: how can we test if its a string or a date ?
[19:13:25] senayar: I use Heroku to host my app and my assets are hosted on Google Cloud Storage when i deploy, everything work fine instead of Fontawesome not reachable on the Google cloud host
[19:13:43] centrx: guilund, my_var.is_a?(String)
[19:13:54] senayar: live problem : http://artrencontre.herokuapp.com/artistes in console
[19:14:33] guilund: centrx: it works with is_a?(Date) too ?
[19:14:52] centrx: guilund, Yes
[19:15:05] guilund: nice... thankx centrx
[19:44:06] toretore: YOU HAVE FAILED THIS CITY
[19:46:45] centrx: toretore, Sorry
[19:56:54] Modicrumb: is there an easy way to see the default generated html.erb template generated for a view besides by creating it via scaffolding
[19:59:01] rhizome: well, the "default" as it were, only applies to scaffolding.
[19:59:11] rhizome: the real default is no file
[20:00:18] Modicrumb: well alright
[20:01:10] Modicrumb: just to really get into rails I'm doing my own project by hand and kind of learning but I am always curious what rails generates but sometimes I am too lazy to jump into my test rails app
[20:01:45] rhizome: so you actually have a default generated index.html.erb already
[20:01:48] jammanbo: Now my thoughts are divided equally between Batman, Starship, and Sim City.
[20:02:21] Modicrumb: yeah I have a default generated every template
[20:02:34] Modicrumb: yeah I can just open them up
[20:02:52] centrx: jammanbo, Go on...
[20:03:23] Modicrumb: I'm almost done writing a form ajax request without using the built in rails stuff
[20:03:26] Modicrumb: was alright
[20:03:31] Modicrumb: kind of tedious to some degree
[20:03:50] rhizome: because you still have to type?
[20:04:01] jammanbo: centrx: Dunno. I got cutoff for a while and the last thing I saw was toretore shouting "YOU HAVE FAILED THIS CITY". They are the only 3 contexts in which that sentence makes any sense to me.
[20:04:09] Modicrumb: yeah well you see I need to generate the link elements as well
[20:04:19] Modicrumb: which means some things have to be hardcoded
[20:04:25] Modicrumb: like the edit link
[20:04:28] Modicrumb: and the delete link
[20:04:41] Modicrumb: so I have to generate /users/:id/edit or whatever
[20:05:03] Modicrumb: and I'm sure if I used the rails built in stuff I wouldn't have to write all that and it would be more dynamic to a degree
[20:05:53] Modicrumb: it's pretty cool being able to submit the form and seeing the results without a refresh though
[20:06:46] Modicrumb: I've never even tried built in rails front end validation for forms
[20:06:49] Modicrumb: I wonder what that is like
[20:06:52] Modicrumb: is it any good?
[20:06:55] Modicrumb: I just wrote my own
[20:08:26] Modicrumb: for example now if I change my edit and delete links via routes I will also have to change them in the ajax I generated
[20:08:31] Modicrumb: which is a slight bummber
[20:10:32] jammanbo: Modicrumb: You can run your javascript files through ERB, meaning you don't have to hard code your URLs, you can use ERB/Rails helpers to put them into you script. Of course if they have ids or whatever that needs to be done on the fly, but you can just do your own thing, like var path = "<%= posts_path(':id') %>"; Then so a javascript replace of ':id' on the path variable as required.
[20:10:59] tubbo: be careful with that though
[20:11:18] tubbo: using erb in your js means you *have* to preload your app before asset precompilation and sometimes that causes hard-to-debug errors.
[20:11:39] Modicrumb: jammanbo: I kind of want to do that but I don't really understand how it all works together I guess
[20:11:44] tubbo: imho it's much better to put that erb in the document somewhere, and reference it in JS by querying the dom element
[20:11:49] apeiros: I ususally put urls into data attributes
[20:12:21] Modicrumb: apeiros: oh man that sounds nifty actually, you think I can generate them in the controller itself and pass them in via json?
[20:12:26] tubbo: <meta name="path" id="path" content="<%= posts_path(@post) %>" /> <script> var path = $('#path').attr('content'); </script> does the same thing and is safer.
[20:12:45] apeiros: Modicrumb: no, I mean similar to what tubbo is showing
[20:13:16] Modicrumb: so pretty much make a, what do they call elements in rails again?
[20:13:25] Modicrumb: and throw the ajax in there I guess?
[20:13:27] tubbo: a dom element?
[20:13:30] jammanbo: I like data attrs too, you can keep them nice and local that way.
[20:13:31] apeiros: <div id="something" class="hidden" data-something-path="<%= something_path(@something) %>"></div>
[20:13:44] tubbo: Modicrumb: i was gonna say...it's still the web :)
[20:14:12] jammanbo: You've got to keep an eye on caching there though
[20:14:14] tubbo: the really real cool way to do this of course is to provide an api :)
[20:14:31] tubbo: a json response that you can hit to get the information you need.
[20:14:50] tubbo: but sometimes that's a little overkill
[20:14:54] apeiros: and from where do you know the url to that api?!? inception!
[20:15:23] jammanbo: one assumes it is at /api.
[20:15:26] Modicrumb: lol well maybe when I am done with this part I can show you guys what I have so far and you could help me out a bit
[20:15:33] apeiros: jammanbo: that's hard-coding
[20:15:42] jammanbo: no its not ??? its easy
[20:15:49] Modicrumb: the reason I don't use the data-remote: true
[20:15:57] Modicrumb: is because I wrote my own front end validator
[20:16:25] Modicrumb: I'm not sure how data-remote true behaves
[20:16:31] rhizome: dude your enter key is broken
[20:16:59] Modicrumb: if I do form.submit() does data-remote change form.submit() behavior?
[20:17:33] Modicrumb: I'll figure it out
[20:17:34] jammanbo: When did we stop saying return key? Is there/was there a character difference between the two? I remember my Amiga used to have both enter and return.
[20:17:51] apeiros: jammanbo: yes, there's a difference
[20:18:01] apeiros: they even have a different symbol
[20:18:31] tubbo: because 'return' is not what it does.
[20:18:46] jammanbo: Oh return meant send everything but enter meant gimme a new line. Was that the idea?
[20:19:24] apeiros: WP: http://en.wikipedia.org/wiki/Enter_key#Differences_between_Enter_and_Return
[20:19:28] tubbo: makes sense. i always thought 'return' dates back to the teletype which meant "stop typing on this line and return me to the beginning of the next line"
[20:19:53] tubbo: "For example, while using the type tool in Adobe Photoshop, the return key produces a new line while the enter key ends editing mode."
[20:20:47] apeiros: in a couple of chat clients, return creates a newline here and enter sends the message
[20:20:56] tubbo: http://en.wikipedia.org/wiki/Carriage_return is what i'm thinking of
[20:20:59] jammanbo: There was a tremendous sense of value with old keyboards. You got so many named keys for your money.
[20:21:07] apeiros: I think cmd-return has substituted that largely, though
[20:21:30] Modicrumb: but is there a way to generate the link_tos in the controller and pass them through via json
[20:21:33] Modicrumb: because I dig that idea now
[20:22:03] apeiros: Modicrumb: url_for is what link_to uses
[20:22:15] apeiros: should be available in your controller
[20:23:07] jammanbo: Dude if you are planning on doing @a_link_to = url_for(:blah), please don't.
[20:23:34] Modicrumb: this is what I want to do
[20:23:50] apeiros: I think he plans on doing something a l??: render json: {link_to_foo: url_for(@foo)}
[20:23:50] jammanbo: Either put it in your templates as apeiros and tubbo said, or you JS (via erb) like I said.
[20:24:05] jammanbo: Oh, then look in to HAL.
[20:24:10] Modicrumb: apeiros, yeah
[20:24:13] apeiros: which - depending on where/how he uses it - is IMO sensible
[20:24:32] apeiros: jammanbo: nobody wants IBMs predecessor???
[20:24:55] nahtnam: Hey guys! When I put this `<span id="ticker-spot-rate" class="odometer">$<%= @spot %></span>` the value displays as 0, but when I remove the `$`, it works just fine. I dont know why
[20:25:03] jammanbo: Modicrumb: https://github.com/mikekelly/hal_specification/blob/master/hal_specification.md
[20:25:44] jammanbo: Modicrumb: Google HATEOAS for context
[20:26:03] jammanbo: (sounds like overkill for your first app though)
[20:26:17] apeiros: HATEOAS is like the worst name for a technology ever???
[20:26:27] Modicrumb: jammanbo: I'll look into it thanks, and it's alright the front end validation plug in I wrote myself was a bit overkill, the goal is to overkill
[20:26:32] jammanbo: its growing on me
[20:26:51] jammanbo: If you say it like a breakfast cereal
[20:27:21] apeiros: I read it like Hate Oas
[20:27:39] jammanbo: well youre an angry angry young man, arent you?
[20:28:09] Modicrumb: I need to exercise, I'm going to go for a run
[20:28:12] rhizome: nahtnam: not using content_tag?
[20:28:15] Modicrumb: ciao gentlemen
[20:28:51] nahtnam: rhizome: Should I be using it?
[20:29:10] jammanbo: nahtnam: Yeah, I cant see any reason why that would be the case. Sure the HTML isn't invalid?
[20:29:19] jammanbo: above that point I mean
[20:29:37] nahtnam: http://pastie.org/private/qoh7qxkkrnviq2ib77tgvw
[20:29:45] jammanbo: also, is that a currency you are trying to display in an odometer class??
[20:30:13] nahtnam: jammanbo: It is a bitcoin ticket. I need a $ sign
[20:30:27] jammanbo: <center>??!!
[20:30:39] nahtnam: Its going to be a widget
[20:30:46] nahtnam: I am adding center for my purposes
[20:30:51] jammanbo: dude, marque that shit up while you're at it1
[20:30:57] nahtnam: its not going to be there in the final code
[20:31:33] pipecloud: jammanbo: Marquee
[20:31:39] jammanbo: I see nothing wrong with that code.
[20:31:43] jammanbo: pipecloud: ty
[20:31:55] nahtnam: Exactly. If I add a $ sign, it doesnt work
[20:32:04] jammanbo: nahtnam: but FYI, maybe you should use the number_to_currency helper?
[20:32:09] nahtnam: I have to add it before the span, but then my css gets messed up.
[20:32:32] nahtnam: jammanbo: Right, ill do that :P Thanks
[20:34:01] jammanbo: are doggiecoins or whatever they're called not the hot thing at the moment anyway?
[20:39:02] nahtnam: jammanbo: They are the (second) hottest coin although I hate it.
[20:39:09] nahtnam: Would this work? `@buy = "$" + @buy`
[20:40:11] Asitha: Hey guys, this might seem like a really vague question but I'm going to try and explain it as much as I can.
[20:40:58] Asitha: I finally got video embedding to work on my editor, however when I do embed a video using iFrame and click submit to save, it stores the data in the db, but then for some reason it redirects to this in the URL "data:,"
[20:41:04] Asitha: just that, nothing else, not even http
[20:41:16] Asitha: but when I don't embed a video, it saves like it should
[20:41:20] Asitha: Any ideas why this would be?
[20:41:24] jammanbo: nahtnam: I'm really finding it hard to believe that the $ is your problem. This isn't being generated by JS or something? It's just straight ERB?
[20:42:36] nahtnam: jammanbo: This is what Is going on. I have a simple ticker. Now I use jquery to get the the value every 15 seconds from here: http://nahtnam.me/application/buy
[20:42:39] nahtnam: Then update it
[20:42:46] nahtnam: Odometer then just animates it
[20:44:11] jammanbo: So, I'm guessing the initial render works okay and you see $@spot? And it's only after the clock "ticks" and tries to update the value that stuff goes wrong?
[20:44:48] nahtnam: No. It dispays 0 in the first place. Then it stays 0
[20:45:12] jammanbo: disable your JS and confirm that
[20:46:15] nahtnam: Oh wait nvm. It start off at 0 and then updates to a number without the `$`
[20:46:35] jammanbo: I wish society would permit me to buy wine by the litre. 750ml is just a little too little.
[20:47:06] jammanbo: yeah, cos you are replacing the contents of the span in your JS right? so you need the $ outside the span
[20:47:36] nahtnam: Yes, exactly but why is it displaying 0
[20:47:40] jammanbo: when I say too little, I mean 750ml x 2 is a little too little
[20:48:22] nahtnam: http://screencloud.net/v/wFdX
[20:48:26] jammanbo: that'll be a JS problem. Youre prolly not fetching the correct value. I'd say its fetching nil and rendering it as 0. Insert some console.logs into your success callback.
[20:48:31] rhizome: Asitha: guessing it has something to do with your code
[20:49:18] Asitha: rhizome: yeah but where though, because when I go to view the post it actually does work
[20:49:28] Asitha: rhizome: it's just the initial part when I submit to save
[20:49:36] nahtnam: jammanbo: For the first request, its not using js, its using ruby
[20:49:42] rhizome: Asitha: it's probably in there, then
[20:50:33] jammanbo: nahtnam: even still, the subsequent requests should correct the value if they are working. Look in your browsers network console. Does the response look correct?
[20:51:12] jammanbo: By any chance are you replacing the entire span, thus breaking subsequent updates, rather than replacing its contents?
[20:52:03] nahtnam: jammanbo: After 15 seconds it fixes itself
[20:52:26] jammanbo: so ??? @spot is just being set incorrectly?
[20:52:50] v10energy: is it beneficial to have a multi core VPS when running nginx (with unicorn and ruby on rails) with multiple unicorn/ruby on rails apps.. 5-10
[20:52:59] nahtnam: jammanbo: I guess so. It is a ruby issue, not a js one
[20:53:58] jammanbo: so set @spot=2.71828 in your controller and check
[20:54:17] jammanbo: dont turn me on pipecloud
[20:54:32] Asitha: rhizome: I looked through the logs from rails s
[20:54:44] nahtnam: jammanbo: http://screencloud.net/v/sP4i
[20:54:59] nahtnam: But when I refresh the page, it starts out a 0
[20:55:00] Asitha: rhizome: It stores the the inputs fine, then it even calls for the page and starts loading everything, but somewhere it just stops
[20:55:04] jammanbo: v10energy: To be honest I can't see how it would be disadvantageous ...
[20:55:10] nahtnam: and then in 15 seconds, autoupdates
[20:55:41] jammanbo: v10energy: I'm not an expert, but I believe the number of nginx and unicorn processes you run should be a function of your cores
[20:55:53] pipecloud: Well, it could be more.
[20:56:08] jammanbo: v10energy: But I wouldnt pay for them until I knew I needed them
[20:56:16] v10energy: jammanbo: you mean it should take advantage of the multiple cores?
[20:56:25] v10energy: that's what i am trying to figure out if it's worth it
[20:56:33] nahtnam: v10energy: Are you using digital ocean?
[20:56:36] pipecloud: v10energy: When you can, you should.
[20:57:00] v10energy: nahtnam: no, i am using buyvm, they have 4 cores. I am wondering if i should switch to digital ocean, where it's a little cheaper but they only offer a single core
[20:57:15] pipecloud: v10energy: Well, they have more than one package.
[20:57:38] hadifarnoud: is there any good books for ruby on rails on iBook store? the books over there get updates. is it the case with RoR books too?
[20:57:57] v10energy: pipecloud: well, they only offer 2 cores for the 20 bucks per month package. while I am getting 2 cores from a 10 dollar package
[20:58:01] jammanbo: v10energy: Nobody will give you a solid answer. You'll need to monitor performance (e.g. nagios)
[20:58:06] nahtnam: v10energy: Digital ocean offers a rails application. So when creating a droplet, you can choose that and you will have a rails server running
[20:58:14] v10energy: but the real question is.. would the extra cores make a difference..
[20:58:29] nahtnam: v10energy: Whats funny is that rails app was updated by me! :)
[20:58:47] jammanbo: I've not used DO. Can you increase the cores on demans or is that like a whole new setup?
[20:58:56] nahtnam: v10energy: http://stackoverflow.com/questions/18575235/what-do-multi-processes-vs-multi-threaded-servers-most-benefit-from
[20:59:02] nahtnam: jammanbo: You can
[20:59:16] nahtnam: But you have to turn off you servers for a few minutes
[20:59:27] jammanbo: nahtnam: Happy days. Start small. Install nagios, Monitor. Adjust.
[20:59:49] jammanbo: oops v10energy ^
[21:00:03] nahtnam: jammanbo: Exactly I just have a 512 mb server for my rails app. I dont see why it would need more
[21:00:47] jammanbo: Or point out that you are a highly skilled developer and shouldn't be hassled by this kind of shite and that some lowly sysadmin should be doing it.
[21:00:54] v10energy: nahtnam: you would need more if you were planning to run multiple rails apps
[21:01:06] nahtnam: v10energy: Right.
[21:01:10] nahtnam: jammanbo: :P
[21:01:13] jammanbo: then smash something, kiss that girl in the office that you fancy, and storm out.
[21:01:33] v10energy: and don't forget to say "I FEEEEL GREAAAT:
[21:01:34] nahtnam: jammanbo: Smash the monitor
[21:01:48] nahtnam: smashing the monitor is a classic
[21:02:10] jammanbo: by "something" I had a talentless manager in mind.
[21:02:25] jammanbo: but just go with what feels right for you
[21:03:08] nahtnam: jammanbo: Can we please go back yo mu issue now?
[21:03:20] jammanbo: just leave me in it for a second now ...
[21:03:35] rhizome: does your issue involve a hammer?
[21:03:55] jammanbo: Oh office girl ...
[21:04:09] rhizome: http://4imgs.com/1089/sys/prod/460_2_0_0.JPG
[21:04:26] jammanbo: nahtnam: Dont know what to tell you. The value of @spot is wrong at the beginning. Should be a straight forward fix surely?
[21:06:02] nahtnam: jammanbo: I think I know a fix. How can I tell what a number is? Decimal, float, etc?
[21:06:17] jammanbo: Youd wonder what some of these parents were drinking when they named their kids wouldnt you? "crankharder", "SirFunk", "djbutterchicken" ...
[21:06:29] ddd: nahtnam @var.class
[21:06:34] jammanbo: nahtnam: huh?
[21:06:45] ddd: actually i think its @var.class_name
[21:06:55] jammanbo: How are you setting the initial value of @spot? show controller.
[21:07:45] jammanbo: Actually I quite like the name djbutterchicken. If I could ever trick office girl into having babies with me, that name would be high on my list.
[21:09:21] rhizome: it's not bad
[21:10:05] nahtnam: jammanbo: An api call
[21:10:12] nahtnam: @buy = coinbase.buy_price
[21:10:21] nahtnam: I just beat my record on impossible road :D
[21:11:18] jammanbo: nahtnam: Well perhaps that's not working? Also, best not to do that ??? potential to lock up your server. Leave it to the client, or if yo want to get fancy have that running constantly in background and let your controller just read the last retrieved value.
[21:12:09] jammanbo: Does anybody want to hire me?
[21:12:29] centrx: jammanbo, Yeah, can you get me a coffee
[21:12:42] skyjumper: jammanbo: will you work long hours for free? take lots of abuse?
[21:12:50] nahtnam: jammanbo: As I said, its working fine. I have two sets of tickers. I am in the process of making a widget that others can put on their site. You can see that the top right works but the widget does not. http://screencloud.net/v/dub6
[21:12:57] nahtnam: centrx: Lol
[21:13:08] jammanbo: centrx: Talk figures.
[21:13:22] centrx: I'll give you a nickel to get me a coffee right now
[21:13:32] nahtnam: Ill give you a dime in btc
[21:13:37] jammanbo: skyjumper: I'm a developer. Of course ffs
[21:13:53] nahtnam: for a carmel Frappuccino.
[21:14:09] jammanbo: got a bidding war going
[21:14:17] ddd: tell him you know a 'nickel' is shorthand for $500 USD
[21:14:17] jammanbo: I'm bid a dime
[21:14:28] jammanbo: who'll offer me a quarter?
[21:14:32] ddd: and a 'dime' is shorthand for $1000 USD, so go get that coffee!
[21:14:43] djbutterchicken: but thanks for the complement
[21:14:58] djbutterchicken: my brother is drbutterchicken i am the black sheep of the family
[21:14:59] ddd: 2500 USD for getting coffee? Man, you best be sprintin'!~
[21:15:29] jammanbo: coffee as a service
[21:15:35] jammanbo: I'm coding it already
[21:15:47] ddd: we already have that. CoffeeScript!
[21:15:48] jammanbo: actually ...
[21:15:59] jammanbo: everybody wipe that from you memeory
[21:16:23] ddd: Epic Failure. Fatality!
[21:16:31] jammanbo: I'm thinking Hailo, but for coffee
[21:16:45] ddd: pappajohns.com but for coffee :)
[21:17:31] ddd: sorry papajohns.com even
[21:17:41] ddd: wish we had one around here
[21:17:50] jammanbo: rhizome we are now partners. I'll need a $10k cheque early next week, for computers and such ??? k?
[21:17:53] ddd: you got it?? SHARE DAMN IT!
[21:18:04] rhizome: but i already has a computar
[21:18:07] ddd: I know I know. A 'dime' right?
[21:18:17] jammanbo: rhizome: for bizuness cards
[21:18:29] rhizome: holy chowder: No match for "PAPAJUANS.COM".
[21:18:41] jammanbo: getin partner
[21:19:30] jammanbo: [I'm going to be so sick if I read that one of you pricks has gotten 200k seed for this next month]
[21:20:01] nahtnam: 200k seed?
[21:20:04] rhizome: i'm pretty sure the idea doesn't scale
[21:20:29] jammanbo: dude I need positivity from my partner. your negative orgones arent helpig
[21:20:37] rhizome: "u guys deliver to timbuktu?"
[21:20:56] rhizome: it'll get cold
[21:21:01] jammanbo: *franchise*
[21:21:27] rhizome: man, papajohns.com does *not* degrade well
[21:21:32] nahtnam: Anyone buying papajuans.com? :D
[21:22:06] rhizome: i will. sec.
[21:22:31] nahtnam: rhizome: :D
[21:22:49] nahtnam: IM GOING TO BEAT YOU TO IT!!!
[21:22:50] rhizome: you guys think of a tag line to use after the inevitable cease & desist
[21:23:54] nahtnam: rhizome: Did you get it?
[21:23:58] jammanbo: I'd simply find a soliciter with the same name as the one filing the complain
[21:24:01] Epic_Programmer: I have a question for rails 4.0.2, It's not finding anything in the assets pipeline. getting rescues/routing error.erb within rescues/layout. Can anyone help?
[21:24:10] nahtnam: jammanbo: http://screencloud.net/v/o1ak Finally
[21:24:43] rhizome: i did get it :P
[21:25:03] rhizome: coffee for btc
[21:25:56] rhizome: deliverycoffee.com is parked, what a loser
[21:26:08] jammanbo: Seriously ??? I'm picturing a group of uber fit barista guys and gals (hot in the process) with quality coffee equipment strapped to their back, sprinting around the NY and Bay Areas to deliver high quality coffee to rich ppl on demand
[21:26:55] rhizome: i'm imagining a two-pronged model: mail-order and then delivery where possible
[21:27:00] nahtnam: :D jammanbo You deliver in the bay area?
[21:27:07] nahtnam: Did I win the auction?
[21:27:13] rhizome: within 5 blocks of 2nd/Mission
[21:27:26] jammanbo: rhizome is responsible for our us operations. I've got Dublin and London covered.
[21:27:41] rhizome: maybe a mobile espresso machine. while u wait
[21:27:52] rhizome: bicycle powered
[21:28:07] jacky: bike powah!
[21:28:12] rhizome: anyway, my email is in WHOIS. hit me up!@
[21:28:16] jammanbo: I hosetly see it working, admittedly for a short time, but that's beside the point
[21:28:59] macpool: can we use a field from existing contact form to create subscription form?
[21:29:15] macpool: with email only field
[21:29:16] s2013: i am getting an uninitialized constant docworker:sidekiq when i try running sidekiq in the terminal
[21:29:24] s2013: i am assuming it has to do with not loading /workers folder
[21:29:34] s2013: how do i get around iT? i looked at eager_loading or whatever
[21:30:08] jammanbo: We've got only 3 or 4 really good quality coffee shops in Dublin city, and the place is reasonably small. I reckon someone could say "Who's for coffee?" and call one of our mobile baristas. You'll pay ???3-4 for a coffee anyway ...
[21:31:45] jammanbo: s2013: Is it in config.autoload_paths?
[21:32:05] ldcicconi: could someone here give me a quote on a website dev project via pm?
[21:32:29] s2013: no jammanbo i added it now let me chekc
[21:32:40] jammanbo: ldcicconi: Spec it well and I'll give you a ball park of what we might want ??? but I won't do it!
[21:32:41] s2013: i dont remember doing that before
[21:32:47] s2013: i added it but still the sam eissue
[21:33:11] s2013: config.autoload_paths += %W(#{config.root}/app/workers)
[21:33:14] s2013: thats in application.rb
[21:33:25] rhizome: jammanbo: its like instagram for facebook
[21:33:35] jammanbo: macpool: explain more?
[21:33:43] jammanbo: rhizome: what is?
[21:33:56] jammanbo: coffee of ldcicconi's idea?
[21:34:00] s2013: jammanbo, both
[21:34:17] macpool: I hav a contact form in my app
[21:34:20] rhizome: not coffee :P
[21:34:34] jammanbo: every fucking thing that comes my way is instagram + facebook + pinterest BUT different.
[21:34:49] s2013: do they offer you 5% equity and no salary
[21:34:54] s2013: but youll become a billionaire?
[21:35:05] jammanbo: Has anyone else noticed how much like the late 90's the early '10's are?
[21:35:08] macpool: I need to add newsletter subscription with only email field
[21:35:08] rhizome: it's different in that it makes much less money
[21:35:13] s2013: jammanbo, yes. i rant about it all the time
[21:35:20] s2013: how the fuck is whisper valued at over $100m
[21:35:22] s2013: what the flying fuck
[21:35:31] s2013: I, a certified dumb ass, can make that in a weekend
[21:36:13] rhizome: it's because postsecret proved the model but didn't monetize
[21:36:22] macpool: jammanbo: can I get the email field from that contact form, to be used as subscription form?
[21:36:30] s2013: how the hell does whisper monetize?
[21:36:30] jammanbo: s2013: I keep saying it but I'm dismissed as negative. I'm all for innovation, but the problem is people are attempting the same shit that failed back then, not because the tech has now made it possible, but because they weren't around or paying attention back then!
[21:36:38] s2013: jammanbo, me and you both brother
[21:36:50] rhizome: s2013: through its network of investors ;)
[21:37:12] s2013: i dont want to jinx it but the startup i cofounded part of just raised a decent chunk of money and we dont even have a product out yet. its like the wild wild west
[21:37:12] rhizome: no one wants to hear that the thing they think is neat is pets.com
[21:37:31] s2013: but also i hate anything social or non money related. at the end of the day its a business but most people forget that
[21:38:39] s2013: anyways, wtf is going on with sidekiq
[21:41:35] rhizome: solar flares
[21:41:43] rhizome: is mercury in retrograde?
[21:43:18] s2013: does sidekiq work in dev?
[21:44:25] pipecloud: Why wouldn't it?
[21:44:57] pipecloud: jammanbo: Most of us are doing that.
[21:45:10] pipecloud: Not a single one of us is doing anything novel or remotely unique.
[21:45:20] s2013: i have no idea wtf is going on.
[21:45:30] s2013: i keep getting unintialized constant
[21:45:46] pipecloud: s2013: Protip: Fix it.
[21:45:51] s2013: thank you for your wisdom
[21:49:20] rhizome: initialize that constant!
[21:49:37] jammanbo: pipecloud: not where I'm from. any old shite goes over here? Want some funding? Here you go.
[21:50:24] pipecloud: jammanbo: No one is doing anything that hasn't already been done.
[21:50:33] pipecloud: Everything is derivative.
[21:50:53] jammanbo: I agree. whats the point
[21:51:20] jammanbo: alcohol as a service??? thats the way
[21:51:24] rhizome: lets do faceagram
[21:51:42] rhizome: too many regulations. after coffee, chocolate.
[21:51:48] s2013: rhizome, i have no idea wtf is wrong? i am loading the workers directory
[21:52:01] jammanbo: chocolate is heavily regulated in your country?
[21:52:11] rhizome: no, booze silly
[21:52:31] jammanbo: Im confussssed
[21:52:50] rhizome: alcohol has too many regs
[21:53:00] rhizome: thatsthejoke.jpg
[21:53:43] s2013: oh Jesus Christ I am retarded
[21:54:02] s2013: hopefully this fixes it.
[21:54:11] rhizome: did u initialize that constant
[21:55:02] s2013: i had a typo. i had include SideKiq::Worker instead of Sidekiq::Worker
[21:58:08] dachi_: hi. I can't get acts_as_xlsx work along mongoid and axlsx_rails gems.. please help me.. I need to export model data to xls file
[21:58:16] zcreative: How would I use sass variables in one sass file that were defined an another?
[21:58:54] rhizome: @include 'variables'
[21:59:04] rhizome: @import? i always have to look it up
[21:59:26] elliotec: Has anyone had the problem where wrapping application.html.erb's <% yield %> in a div (in my case for bootstrap) breaks their javascript functionality?
[22:00:08] rhizome: elliotec: i can't think of a reason other than badly written js
[22:01:40] elliotec: rhizome: same... I don't know what it could be exactly. my js basically allows for new form fields to be added on the same page with a button (like steps in a list) and it works fine til i wrap the yeild.
[22:02:53] rhizome: i imagine it's in how you're targeting the elements
[22:02:55] elliotec: interestingly, when i wrap it everything except the js form gets wrapped, for example in a container or jumbotron. the text goes in nicely but the form still stays to the left all badly styled
[22:03:13] pipecloud: What the fuck is a jumbotron?
[22:03:26] elliotec: its a bootstrap div class
[22:03:35] dachi_: it's huge huge huge box
[22:03:38] pipecloud: oh boobstrap. :(
[22:03:48] elliotec: pull yourself up by yourboobstraps
[22:04:12] rhizome: lol, "formerly known as a hero unit"
[22:04:20] elliotec: haha exactly
[22:04:23] rhizome: i hate when people try to institute new terminology for things that already exist
[22:04:39] elliotec: yeah its annoying for sure
[22:04:48] rhizome: it's their fault
[22:05:05] elliotec: @twatterboobstraps
[22:05:17] rhizome: problematic
[22:05:45] rhizome: that change certainly deserves a blog post and HN submission tho
[22:06:05] elliotec: thanks rhizome, i'll try messing around with how i'm targeting my elements and see what i can come up with
[22:07:04] macpool: If I rename any field other than name.email, subject or message in my ajax form, it stops getting submitted?
[22:07:13] macpool: is this unusual?
[22:07:35] rhizome: before we opine on whether it's unusual, what exactly are you talking about?
[22:07:36] helpa: macpool: 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.
[22:07:36] pipecloud: macpool: !code
[22:14:02] RubyPanther: macpool: yes it is unusual to just rename form fields randomly.
[22:15:30] jammanbo: That due ldcicconi actually has an idea IMO. He has no money, but if you've got the time to gamble it might be worth chatting with him.
[22:17:02] ldcicconi: I have little money
[22:17:09] ldcicconi: but also equity :)
[22:17:23] rhizome: will it be good for my portfolio?
[22:17:26] pipecloud: Everyone has equity
[22:17:40] jammanbo: We've all got a stake in you pipecloud
[22:18:17] jammanbo: You're diluted to the limit by this stage :)
[22:24:06] macpool: pipecloud: got it resolved
[22:28:40] rhizome: is there a way to switch tabs from the keyboard in sublime text?
[22:31:40] Jasinai: rhizome: Ctrl+Pagedown/Pageup?
[22:35:41] jammanbo: rhizome: It's alt+cmd+arrow right?
[22:36:23] pipecloud: command+shift+([ or ])
[22:36:26] pipecloud: Meaning [ or ]
[22:36:48] jammanbo: Of course that requires that the file is actually open rather than just present on your screen, which IIRC is my main reason for refusing to use sublime
[22:38:24] jammanbo: coffeerun.com
[22:47:05] replicer: Hi. Is there much difference between rails 4 and 3? I have book which covers fourth version but project I'll be involved into uses third. Should I gain older book edition?
[22:47:56] jammanbo: http://www.youtube.com/watch?v=hUOPwIeUhp0
[22:48:13] jammanbo: sorry! wrong wondow
[22:52:17] elliotec: youre fuckin up jammanbo
[22:59:15] jammanbo: more of a Blur man are you elliotec?
[23:01:14] funburn: I have a nested resource projects -> donations do I put my javascript for donations in projects.js or donations.js ?
[23:02:09] funburn: i tired donations.js but the function doesn't seem to be available in the browser console
[23:02:15] elliotec: donations probably if its nested in projects
[23:03:03] elliotec: if its properly nested it should work in donations
[23:04:03] elliotec: id try the other way just for trial and error purposes and maybe you can narrow it down better
[23:04:31] elliotec: does your js functionality work or can you just not see it in devtools?
[23:04:48] jammanbo: Where you put JS doesnt matter ??? the multiple files are just for conceptual organisation. Put it all in one or divide it randmonly, doesnt if its all included in a single manifest.\
[23:04:52] funburn: https://gist.github.com/mtuckerb/7fde4d3c5819a08ddadb
[23:05:13] funburn: I copy/pasted the js into the console, it does what I expect
[23:05:26] jammanbo: ACTION on slow descent to the end
[23:06:26] elliotec: are you requiring it in the manifest at all?
[23:06:43] funburn: /= require_tree .
[23:07:34] elliotec: jammanbo: i like gorillaz
[23:08:07] jammanbo: elliotec: pff ??? noob
[23:08:58] jammanbo: ACTION this is the end, beautiful friend
[23:10:29] funburn: ah! okay, the problem was that I had some javascript in my manifest
[23:10:44] funburn: it was failing, moved that out and things are working as expected!
[23:11:13] elliotec: thatd do it!
[23:11:28] jammanbo: Did you know Martin Sheen was out of his head in that opening scene, and did himslef and the extras some serious injuries. Also had major heart-attack during filming. His brother ended up doing a lot of the voice over work cos he was busy on some other film.
[23:15:35] rhizome: see "hearts of darkness?"
[23:18:08] linguini: Given a klass, how can I find the "new" route for it?
[23:18:50] jammanbo: nearly killed coppola too I believe
[23:19:17] linguini: link_to "New #{klass}", :action => :new, :controller => ??
[23:19:20] jammanbo: linguini: url_for is(@klass) maybe?
[23:20:45] jammanbo: what about <%= link_to 'it', [:new, @klass], title: 'do it!' %>
[23:20:58] jammanbo: cos that'll work
[23:21:27] jammanbo: and it'll win any beauty contest
[23:22:39] jammanbo: ACTION down down slowly down
[23:22:48] linguini: jammanbo: Undefined method `new_users_path'
[23:23:13] linguini: (when klass is User)
[23:23:13] jammanbo: well that doesnt sound right, does it?
[23:23:34] jammanbo: Okay, are you using devise?
[23:24:17] linguini: <%= link_to 'it', [:new, :user], title: 'do it!' %> # works...
[23:24:49] jammanbo: so, if you rake routes, in the left hand column you'll see the appropriate route helper, which is determined by how you set up devise in your routes file.
[23:25:18] jammanbo: why do you need to be dealing with an @klass anyway?
[23:25:36] linguini: DRY. I have multiple classes that I want to handle uniformly.
[23:25:38] jammanbo: should just be like new_user_path or new_whatever_path ...
[23:26:13] jammanbo: well, you'll need to tell your touter ,,,
[23:26:53] linguini: I suppose I could iterate over controllers rather than classes. Hmm.
[23:27:36] jammanbo: linguini: You should ask Emily about all things Devise. She's the devise expert. Will answer anything you ask her.
[23:27:56] jammanbo: wth are you trying to do (in English)?
[23:28:59] linguini: I am trying to implement 4 "buttons" to create new Active Record objects of different types.
[23:29:17] linguini: I don't want to do: new_class_1_path ... new_class_2_path ... if I don't have to.
[23:30:25] linguini: It seems to me that given the class I want to operate on, and the action I want to call, I should be able to find the path without hardcoding 'action_class_foo_path.'
[23:30:45] jammanbo: Why do you want different user classes though? Are you sure you don't just want to augment your Authentication system (Devise) with an Authorisation system (e.g. CanCan or DeclarativeAuthorization)?
[23:31:12] linguini: These aren't different user classes. One class is User, one class is Post, one class is Comment, etc.
[23:31:37] jammanbo: Oh I think I get you
[23:32:06] jammanbo: You are trying to reuse a single view for multiple objects
[23:32:34] linguini: [ User, Post, Comment ].each { |klass| link_to ... }
[23:33:36] jammanbo: I know there is a way to do that ??? you either have to define something in your user class which changes how it behaves when used in [@user] or change your routes ??? but I cant off the top of my head tell you which it is or how to do it
[23:33:42] jammanbo: It's possible though
[23:33:49] jammanbo: But I wouldnt do it
[23:38:34] jammanbo: does [:new, klass.name] work per chance?
[23:40:23] ddd: linguini
[23:40:34] ddd: question for you.
[23:41:27] ddd: couldn't you do something like use a role for what you're doing then set your current user according to that role name where that name is also the class. You should be able to then .captialize and use in calling the correct model
[23:41:49] ddd: use a case within the controller's action (or even initialize)
[23:41:56] ddd: to select i mean
[23:42:17] ddd: then you can use a single view for multiple disparate objects just like a dashboard does
[23:42:40] ddd: is that what you're trying to implement? or did i read too much into potential usages you were doing?
[23:42:46] linguini: jammanbo: [:new, klass.name.downcase] # works, but I need to also add a query parameter
[23:44:02] Scient: i would just suggest to stop fighting the framework :P
[23:44:26] pipecloud: Stop the fighting! D:
[23:45:08] ddd: is that really fighting the framework though rather than having to express out *every* model behind its own controller, view, etc?
[23:46:17] greggawatt: is anyone familar with stripe payments?
[23:46:39] dclo: using stripe. set it up a year ago.
[23:47:32] greggawatt: i was able to get subscription payments working but i can't seem to get a page that allows me to add a new credit card to someone's account
[23:47:48] ddd: oh i see what i missed. nm. i understand why i'd be viewed as illogical on my last. ignore me :)
[23:47:52] greggawatt: it keeps giving me an error of Missing required param: card
[23:49:04] jammanbo: linguini: If you really, really have to do that, and in case it is not clear I doubt that you should be doing that, the railsy, idiomatic way, might be to <%= render partial: :new_link, object: klass %>, then you can write a users/_new_link.html.erb, a posts/_new_link.html.erb, ??? etc.
[23:49:05] dclo: ah. i'm using only using one time payment. you are ahead of me.
[23:49:37] linguini: link_to "New User", new_user_path(:domain_id => @domain.id) # instead of this
[23:49:57] linguini: link_to "New #{klass.name}", polymorphic_path(:new, klass.name.downcase) + "?parent_id=#{@parent.id}" # I want something like this
[23:50:38] linguini: Of course, the second is ugly as hell, probably because I don't know routing url_for/link_to/polymorphic_path well enough.
[23:50:53] ddd: making a domain hosting (godaddy style?) app?
[23:51:00] jammanbo: I think what I said was wrong, but there's still some nigget of an idea im there
[23:53:39] jammanbo: I wish there was some way to make money out of my unique skill set
[23:54:09] pontiki: what's that?
[23:55:28] jammanbo: It is a physical medium for the exchange of wealth, but that doesn't matter here
[23:55:49] jammanbo: or indeed virtual
[23:56:00] pontiki: i was asking about the skill set
[23:56:55] jammanbo: how many skills does comprise a set one is forced to ask oneself
[23:57:12] pontiki: no, really, what makes you think you have a unique skill set?
[23:57:31] jammanbo: I can sit in a puddle of spilled wine for an exceptionally long time before crying.
[23:57:55] pontiki: ok, never mind, then
[23:58:07] jammanbo: ACTION cries
[23:58:17] pontiki: bullshit answers for 200, alex