« Back to channel list

#RubyOnRails - 20 June 2016

« Back 1 day Forward 1 day »
[00:00:05] helpa: Why don't you try it and find out for yourself?
[00:00:26] Osmosis311: done, still failing
[00:03:00] rroyal: has joined #RubyOnRails
[00:09:39] armyriad: has joined #RubyOnRails
[00:12:31] rickmasta: has joined #RubyOnRails
[00:14:06] xall: has joined #RubyOnRails
[00:17:20] macsteps: has joined #RubyOnRails
[00:20:58] Danny: has joined #RubyOnRails
[00:21:16] Danny: never mind, my mistake, i was missing a stub/mock in the spec
[00:21:35] Guest419: (im osmosis)
[00:22:00] djbkd: has joined #RubyOnRails
[00:23:16] alfiemax: has joined #RubyOnRails
[00:36:32] jhack: has joined #RubyOnRails
[00:38:52] nettoweb: has joined #RubyOnRails
[00:41:48] evansbee: has joined #RubyOnRails
[00:41:56] Oliphaunte: has joined #RubyOnRails
[00:46:37] hahuang62: has joined #RubyOnRails
[00:47:23] Ropeney: has joined #RubyOnRails
[00:47:58] DoctorMonocular: has joined #RubyOnRails
[00:51:13] Rodya_: has joined #RubyOnRails
[00:52:24] Oliphaunte: has joined #RubyOnRails
[00:54:31] jhack: has joined #RubyOnRails
[00:58:42] globalall0c_: has joined #RubyOnRails
[00:59:43] dblessing: has joined #RubyOnRails
[01:01:22] emachnic: has joined #RubyOnRails
[01:01:27] smathy: has joined #RubyOnRails
[01:01:55] ur5us: has joined #RubyOnRails
[01:02:05] ur5us: has joined #RubyOnRails
[01:04:01] yfeldblum: has joined #RubyOnRails
[01:14:45] xall: has joined #RubyOnRails
[01:16:23] djbkd: has joined #RubyOnRails
[01:17:10] djbkd: has joined #RubyOnRails
[01:17:57] djbkd: has joined #RubyOnRails
[01:18:42] djbkd: has joined #RubyOnRails
[01:19:35] djbkd: has joined #RubyOnRails
[01:21:59] Danny: has joined #RubyOnRails
[01:22:06] Danny: Anyone here use CodeClimate?
[01:27:34] rafaelfranca: has joined #RubyOnRails
[01:30:42] sevenseacat: has joined #RubyOnRails
[01:34:45] blackmesa: has joined #RubyOnRails
[01:37:31] djbkd: has joined #RubyOnRails
[01:42:17] chintanparikh: has joined #RubyOnRails
[01:46:03] flashpoint9: has joined #RubyOnRails
[01:48:21] djbkd: has joined #RubyOnRails
[01:48:33] Leepoff: has joined #RubyOnRails
[01:50:04] jhack: has joined #RubyOnRails
[01:55:24] srinidhi: has joined #RubyOnRails
[01:58:41] jhack: has joined #RubyOnRails
[01:59:56] gfvcastro: has joined #RubyOnRails
[02:01:09] pawnbox: has joined #RubyOnRails
[02:06:40] AntiSpamMeta: has joined #RubyOnRails
[02:07:29] mshowman: has joined #RubyOnRails
[02:07:40] Oliphaunte: has joined #RubyOnRails
[02:07:51] Axy: has joined #RubyOnRails
[02:09:41] triptec: has joined #RubyOnRails
[02:17:02] xall: has joined #RubyOnRails
[02:19:12] jhack: has joined #RubyOnRails
[02:23:16] nickenchuggets: has joined #RubyOnRails
[02:25:15] eljimmy: has joined #RubyOnRails
[02:25:17] triptec: has joined #RubyOnRails
[02:26:29] rickmasta: has joined #RubyOnRails
[02:28:46] pawnbox: has joined #RubyOnRails
[02:28:46] pLaToOn: has joined #RubyOnRails
[02:29:06] SteenJobs: has joined #RubyOnRails
[02:29:30] rickmasta: has joined #RubyOnRails
[02:31:03] jancel: has joined #RubyOnRails
[02:32:33] jhack: has joined #RubyOnRails
[02:35:32] robot: has joined #RubyOnRails
[02:38:10] braincrash: has joined #RubyOnRails
[02:38:10] blackmesa: has joined #RubyOnRails
[02:39:38] rickmasta: has joined #RubyOnRails
[02:41:15] yardenbar: has joined #RubyOnRails
[02:43:55] Oliphaunte: has joined #RubyOnRails
[02:47:30] jhack: has joined #RubyOnRails
[02:49:22] emachnic: has joined #RubyOnRails
[02:53:58] dblessing: has joined #RubyOnRails
[02:58:52] jhack: has joined #RubyOnRails
[03:00:07] Oliphaunte: has joined #RubyOnRails
[03:02:11] dblessing: has joined #RubyOnRails
[03:02:16] rickmasta: has joined #RubyOnRails
[03:02:32] medright: has joined #RubyOnRails
[03:06:58] someish: has joined #RubyOnRails
[03:07:24] djbkd: has joined #RubyOnRails
[03:09:54] evansbee: has joined #RubyOnRails
[03:11:04] pawnbox: has joined #RubyOnRails
[03:14:19] dblessing: has joined #RubyOnRails
[03:15:52] jtong: has joined #RubyOnRails
[03:17:50] xall: has joined #RubyOnRails
[03:21:17] k3rn31: has joined #RubyOnRails
[03:23:21] wethu: has joined #RubyOnRails
[03:24:45] braincras: has joined #RubyOnRails
[03:32:58] SteenJobs: has joined #RubyOnRails
[03:40:40] jancel: has joined #RubyOnRails
[03:40:42] blackmesa: has joined #RubyOnRails
[03:42:45] rroyal: has joined #RubyOnRails
[03:43:09] pwnd_nsfw: has joined #RubyOnRails
[03:44:07] emachnic: has joined #RubyOnRails
[03:49:47] Oliphaunte: has joined #RubyOnRails
[03:59:28] pawnbox: has joined #RubyOnRails
[04:00:52] emachnic: has joined #RubyOnRails
[04:06:59] k3rn31: has joined #RubyOnRails
[04:08:37] swap_a_b: has joined #RubyOnRails
[04:16:45] Radar: hgello again
[04:17:12] Wolfram74: so, I got around to testing my hypothesis that maybe it was the authentication in the routing file vs the controller that was messing up the tests
[04:17:30] Wolfram74: which is a bit vexing
[04:17:56] Wolfram74: because aesthetically I like the idea of having the routing file describing which routes are authenticated or not
[04:18:06] pawnbox: has joined #RubyOnRails
[04:18:07] Wolfram74: but I know from an engineering perspective, tests are important
[04:18:30] alfiemax: has joined #RubyOnRails
[04:19:05] xall: has joined #RubyOnRails
[04:19:33] rogue_koder: has joined #RubyOnRails
[04:20:15] Radar: Ah right :)
[04:20:21] Radar: So it's all fixed now?
[04:21:52] Wolfram74: I could move forward on my project with this partial understanding, but since the only deadline is self imposed, I should probably understand why one approach is testable, but the other isn't
[04:24:36] DoctorMonocular: has joined #RubyOnRails
[04:25:13] Wolfram74: I will sleep on the puzzle for the meantime
[04:25:19] Wolfram74: as it is late, and I am slightly drunk
[04:25:27] pawnbox: has joined #RubyOnRails
[04:27:08] chintanparikh: has joined #RubyOnRails
[04:29:55] FLeiXiuS: has joined #RubyOnRails
[04:31:37] banister: has joined #RubyOnRails
[04:34:41] FLeiXiuS: Is there a way to have a nested route within without having an object requirement in the URL? http://pastie.org/10883592 simple example
[04:36:22] hahuang62: has joined #RubyOnRails
[04:36:47] triptec: has joined #RubyOnRails
[04:37:33] sevenseacat: FLeiXiuS: sounds like you want a collection route
[04:37:40] sevenseacat: instead of a member route
[04:39:45] gfvcastro: has joined #RubyOnRails
[04:39:51] FLeiXiuS: sevenseacat, Hrm - my routing foo is awful. Let me review the docs.
[04:40:12] eserror: has joined #RubyOnRails
[04:41:14] sypheren: has joined #RubyOnRails
[04:41:40] blackmesa: has joined #RubyOnRails
[04:42:21] snoobydoo: has joined #RubyOnRails
[04:44:53] FLeiXiuS: sevenseacat, exactly what I was looking for. Thank you.
[04:49:10] FLeiXiuS: has joined #RubyOnRails
[04:49:55] pawnbox: has joined #RubyOnRails
[04:50:49] lightt: has joined #RubyOnRails
[04:51:10] d0nn1e: has joined #RubyOnRails
[04:51:25] conta: has joined #RubyOnRails
[04:52:03] pontiki: has joined #RubyOnRails
[04:52:24] triptec: has joined #RubyOnRails
[04:54:05] harfangk: has joined #RubyOnRails
[04:55:04] Oliphaunte: has joined #RubyOnRails
[05:00:08] siaw23: has joined #RubyOnRails
[05:04:06] ngw: has joined #RubyOnRails
[05:05:32] arup_r: has joined #RubyOnRails
[05:10:46] evansbee: has joined #RubyOnRails
[05:19:59] xall: has joined #RubyOnRails
[05:20:14] dionysus69: has joined #RubyOnRails
[05:21:43] enitiz: has joined #RubyOnRails
[05:29:27] jancel: has joined #RubyOnRails
[05:30:05] pawnbox: has joined #RubyOnRails
[05:30:06] Dimik: has joined #RubyOnRails
[05:30:31] jpterry: has joined #RubyOnRails
[05:31:34] lurch_: has joined #RubyOnRails
[05:32:03] northfurr: has joined #RubyOnRails
[05:32:14] rroyal: has joined #RubyOnRails
[05:33:49] ur5us: has joined #RubyOnRails
[05:38:25] hahuang62: has joined #RubyOnRails
[05:38:44] pawnbox: has joined #RubyOnRails
[05:39:40] arup_r: has joined #RubyOnRails
[05:40:29] sl821: has joined #RubyOnRails
[05:41:28] sl821: can you use rails and node together?
[05:41:34] stokhoskat: has joined #RubyOnRails
[05:41:36] alfiemax: yes, why not?
[05:41:51] sl821: is there a guide
[05:42:19] sevenseacat: thats quite a broad topic
[05:42:24] sevenseacat: what exactly do you need to do?
[05:42:30] blackmesa: has joined #RubyOnRails
[05:42:46] baweaver: I use Node and Rails together fairly frequently.
[05:43:13] baweaver: Mainly because Rails has a pretty big blind spot for async streaming / websockets
[05:47:07] mercerist: has joined #RubyOnRails
[05:48:12] netzfisch: has joined #RubyOnRails
[05:49:49] Oliphaunte: has joined #RubyOnRails
[05:53:45] triptec: has joined #RubyOnRails
[05:55:08] apofis: has joined #RubyOnRails
[05:55:13] yardenbar: has joined #RubyOnRails
[05:57:57] frojnd: has joined #RubyOnRails
[05:58:03] DoctorMonocular: has joined #RubyOnRails
[05:58:27] guidocalvano: has joined #RubyOnRails
[06:00:51] frojnd: has left #RubyOnRails: ()
[06:00:58] frojnd: has joined #RubyOnRails
[06:01:30] Leepoff: has joined #RubyOnRails
[06:02:05] frojnd: Hi there.
[06:02:59] duncannz: has joined #RubyOnRails
[06:03:06] jas02: has joined #RubyOnRails
[06:06:56] DTZUBDUB: has joined #RubyOnRails
[06:09:00] harfangk: baweaver: just being curious… where do you use them? are there uses other than chatting/audio-video streaming?
[06:12:57] lightt: has joined #RubyOnRails
[06:16:08] rvanlieshout: has joined #RubyOnRails
[06:17:46] arup_r: has joined #RubyOnRails
[06:21:05] xall: has joined #RubyOnRails
[06:23:43] frojnd: Anyone here uses httparty (restclient)? I'm having hard trouble understanding where do I parse json response... I've created lib/url_api.rb with require 'httparty' url='http://api.openweathermap.org...' response = HTTParty.get(url) response.parsed_response how can I see response of json in my view?
[06:24:46] odinsbane: has joined #RubyOnRails
[06:25:25] odinsbane: I would like to setup an app, that only servers an index.html.
[06:26:08] odinsbane: I used rails hello, and now I get a "Welcome Aboard" page, but I would like to use a static html file instead.
[06:26:27] sevenseacat: you really don't need a Rails app for that.
[06:26:35] sevenseacat: and I wouldn't recommend using one.
[06:26:42] comrad: has joined #RubyOnRails
[06:27:49] odinsbane: sevenseacat: I just want to put it up while the actual app is getting some maintenance.
[06:27:59] norc: has joined #RubyOnRails
[06:29:27] sevenseacat: that seems like a problem for your deployment system then - if you're using something like capistrano, there are plugins out there to turn on/off maintenance pages
[06:29:31] odinsbane: It looks like it was just a browser catching issue.
[06:29:41] sevenseacat: instead of creating a whole separate Rails app, which I would really not recommend
[06:30:32] aganov: has joined #RubyOnRails
[06:33:12] odinsbane: by plugins, do you mean gems?
[06:33:47] sevenseacat: the plugins are typically stored in gems, yes.
[06:34:50] DTZUBDUB: has joined #RubyOnRails
[06:35:41] arBmind: has joined #RubyOnRails
[06:35:42] alfiemax: has joined #RubyOnRails
[06:35:56] tildes: has joined #RubyOnRails
[06:36:17] quazimodo: has joined #RubyOnRails
[06:37:30] njero: has joined #RubyOnRails
[06:38:33] conta: has joined #RubyOnRails
[06:38:36] chipotle: o i'm a bit of an idiot, but i'm confused, when i build my RoR website, where do i learn how to build an RoR "theme". or is it not like drupal where you need a theme built on drupal (in this case RoR) and you can just use html5/css3/js however you want, just hook into RoR where you need? or does RoR use templates? because it is hard for me to find premade RoR templates that i could use or edit....
[06:39:23] sevenseacat: chipotle: no, Rails is not a CMS that can be themed like Drupal
[06:39:23] Radar: Drupal is a CMS, and Rails is a web development framework.
[06:39:26] xall: has joined #RubyOnRails
[06:39:45] Radar: chipotle: typically, each Rails application would be designed however the developers/designers wish it to be designed.
[06:40:01] Radar: There's things like rails_admin which provide their own theme, but there's nothing that will theme your Rails app for you.
[06:40:11] Radar: A lot of people use Bootstrap as a starting point.
[06:40:14] helpa: Please do not use active_admin, rails_admin or any other gems to build your admin interfaces. Instead, build it yourself. This will lead you to a safe path of understanding of the code, rather than to the Hell that is those gems.
[06:40:17] chipotle: so, say i am using foundation's framework and i built something in html5/css/js
[06:40:18] Radar: ^ on the topic of rails_admin
[06:40:34] chipotle: now how do i get it using my rails app, which i am building to be a one page website plus a blog
[06:40:45] chipotle: i don't want to use jekyll or nano, ir eally need to build this in RoR
[06:40:46] tildes: hi all! I'm reading R4IA, and started from the end, like I sometimes do. the chapter on Rack applications is quite interesting. however I can't find explicit reasoning / guidelines when or what parts might one like to carve out as separate Rack apps and why
[06:41:06] tildes: I suppose if you can mount something on rails as rack app, you can unmount it and deploy it somewhere else more easily?
[06:41:59] Radar: tildes: yes, if you wish to do that you can do that.
[06:42:29] Radar: chipotle: http://railscasts.com/episodes/417-foundation
[06:42:53] mercerist: has joined #RubyOnRails
[06:43:03] rvanlieshout: has joined #RubyOnRails
[06:43:10] tildes: Radar: ok. what might be some typical cases, when you might want to set up a rack app inside the same rails instance?
[06:43:29] blackmesa: has joined #RubyOnRails
[06:43:32] Oliphaunte: has joined #RubyOnRails
[06:43:48] Radar: tildes: You might setup a little Sinatra app (where Sinatra is a smaller web framework which uses Rack underneath) and then want to move it out onto its own server later on.
[06:44:01] rvanlieshout: has joined #RubyOnRails
[06:44:12] AimlessRAven: has joined #RubyOnRails
[06:44:16] dionysus69: has joined #RubyOnRails
[06:44:22] AimlessRAven: hi all, i have rails state machin and send mailer after event transition
[06:44:27] chipotle: okay thank you Radar
[06:44:39] AimlessRAven: on all transition my mailer send mail except first transition
[06:44:42] AimlessRAven: after_transition on: [:submitted] do |order, transition| OrdersMailer.submitted(order).deliver_now end
[06:44:59] Radar: !botsnack
[06:44:59] helpa: Nom nom. Thanks, Radar!
[06:45:20] Radar: AimlessRaven: Please remember to Gist your code. It's been long enough now that we shouldn't need to keep reminding you of this.
[06:45:42] tildes: Radar: ok thanks, need to think about it :) would be good to lookt at some concrete examples
[06:46:11] Radar: tildes: I don't have any to hand at the moment, sorry.
[06:46:36] pontiki: tildes: Sidekiq's monitor is a Sinatra app the mounts inside your Rails app
[06:46:51] tildes: Radar: no worries. even hearing about concrete examples would be cool. in any case thanks for the great customer support ;-)
[06:47:05] tildes: pontiki: thanks, interesting!
[06:49:08] guidocalvano: has joined #RubyOnRails
[06:49:34] Niham: has joined #RubyOnRails
[06:50:02] dionysus69: has joined #RubyOnRails
[06:50:44] chipotle: regarding programing in general, what exactly makes someone a coder? i know that all these books on learning to program really means, learning syntax of a specific language. when are you able to take the syntax knowledge and build something from scratch? do you need data structures and algorithms in your code to do that?
[06:51:55] GoranPavlovic: has joined #RubyOnRails
[06:52:36] Radar: chipotle: Open irb.
[06:52:42] Radar: chipotle: Type this into it: puts "hello world"
[06:52:45] Radar: chipotle: hit enter
[06:52:48] Radar: Congratulations, you're a coder.
[06:53:15] Radar: I think setting a higher bar than that is exclusionar.y
[06:53:42] tildes: chipotle: to build something you generally do need *some kind of* data structures and *some kind of* algorithms
[06:54:41] sevenseacat: programming is problem solving. there's being able to write code and knowing syntax, and knowing how to reason through problems and come up with solutions. two very different skill sets.
[06:55:41] sevenseacat: all the people that come in here month after month, year after year and say 'heres an error how do I fix it' - they don't have much of the second skill set.
[06:56:32] swap_a_b: has joined #RubyOnRails
[06:56:39] Radar: cough marcamilly
[06:56:42] swap_a_b: has left #RubyOnRails: ()
[06:56:47] sevenseacat: example numero uno
[06:58:13] pontiki: one of the reasons i like spraul's book
[06:58:34] Radar: http://www.vantonspraul.com/content/think-programmer ?
[06:58:39] kies: has joined #RubyOnRails
[06:59:42] chipotle: sevenseacat: okay, and what books are recommended to learn how to architect a solution?
[07:00:09] Radar: chipotle: http://www.vantonspraul.com/content/think-programmer
[07:00:21] k3rn31: has joined #RubyOnRails
[07:01:18] jgt1: has joined #RubyOnRails
[07:02:29] arBmind1: has joined #RubyOnRails
[07:03:52] alfiemax: has joined #RubyOnRails
[07:04:48] chipotle: Radar: wow thank you so much!
[07:05:04] Radar: chipotle: pontiki was the first to mention it. She should get the thanks.
[07:05:23] sevenseacat: I have the Kindle sample of the book in my infinitely long reading list :)
[07:06:04] tildes: think like a programmer is from 2012, but apparently still good?
[07:06:13] pontiki: good grief
[07:06:18] tildes: looks interesting, and good reviews it has
[07:06:25] tildes: pontiki: that bad a question? :)
[07:06:25] pontiki: it's not tied to any specific technology or era
[07:06:41] Radar: tildes: thinking like a programmer hasn't changed all that much since 2012 :P
[07:06:42] pontiki: it would have been wonderful in 1975
[07:06:45] frojnd: Anyone here uses httparty gem for making rest calls? I'm having hard trouble understanding where do I parse json response... I've created lib/url_api.rb with require 'httparty' url='http://api.openweathermap.org...' response = HTTParty.get(url) response.parsed_response how can I see response of json in my view?
[07:06:48] pontiki: it will be useful in 2075
[07:06:52] tildes: Radar, pontiki: fair enough :D
[07:07:11] Radar: frojnd: Please gist your code.
[07:07:40] pontiki: sorry, tildes, i'm not meaning to shame you or anything :) it's just that good
[07:07:49] sevenseacat: coding books, about syntax and languages, get very out of date quickly. theory books do not
[07:08:07] tildes: pontiki: no worries at all. thanks for the recommendation.
[07:08:07] pontiki: and of course without having read it, you couldn't know; compared to other books, you question is quite legit
[07:08:20] sevenseacat: The Pragmatic Programmer was published in 1999, and is still *awesome*.
[07:08:33] pontiki: there are some books i had starting out learning CS that still have a timeless quality
[07:08:43] Pazician: has joined #RubyOnRails
[07:08:52] pontiki: one's even written using Algol68
[07:08:54] Pazician: has joined #RubyOnRails
[07:08:59] Radar: Rails 3 in Action was out of date when it was published (pretty much)
[07:09:03] Radar: Rails 4 in Action not so much.
[07:09:08] frojnd: Radar: lib/url_api.rb https://gist.github.com/anonymous/f245070af0639a3a733f856872d31501
[07:09:11] sevenseacat: Rails 4 in Action is still good.
[07:09:15] Radar: In fact, I think it's still relevant almost a year later.
[07:09:22] sevenseacat: wow it really has been nearly a year
[07:09:28] Radar: frojnd: You'd need to wrap that in a class and call that class in your controller.
[07:09:34] sevenseacat: and I was worried Rails 5 would come out before the book did
[07:09:38] Radar: sevenseacat: lolz
[07:10:01] Radar: frojnd: https://gist.github.com/radar/137ac1e80f9d84877a3a6d9928d77e5b
[07:10:03] pontiki: a lot of R4IA will still be relevant when Rails5 is released
[07:10:12] Radar: frojnd: Called in your controller like Weather.fetch
[07:10:40] chipotle: is railcasts free now?
[07:10:43] frojnd: Radar, ah so I was missing wrap code inside a class :) Thank you
[07:10:52] DTZUBDUB: has joined #RubyOnRails
[07:10:54] pontiki: still $9 one-time payment
[07:11:02] chipotle: pontiki: THANK YOU!
[07:11:10] sevenseacat: but a lot of the content there isn't worth much anymore
[07:11:17] tildes: sevenseacat: I loved pragmatic programmer, but I feel some of the advice is geared towards languages you actually need to build. I think in many cases where they recommend using a config file, in ruby world one would just put constants in a class/module
[07:11:23] evansbee: has joined #RubyOnRails
[07:11:40] tildes: so reading even the greatest book without being aware of contextual issues might lead to funny code :)
[07:11:49] sevenseacat: we have config files in ruby apps
[07:11:55] tildes: ^as in overly complex in a specific setting
[07:12:03] tildes: sevenseacat: for sure
[07:12:10] pontiki: tildes: hard-coding everything in constants is a bad idea
[07:12:14] sevenseacat: reading anything without putting it in context is a recipe for bad code
[07:12:19] tildes: I just got the idea from PP that they recommend config files pretty much for everything
[07:12:26] pontiki: better than leaving magic numbers and magic strings in your code, but still limited
[07:12:29] sevenseacat: thats the second skill, being able to reason about things :P
[07:13:20] darutoko: has joined #RubyOnRails
[07:13:36] chipotle: sevenseacat: where does the pragmatic programmer fit in between learning syntax and algorithms and the think like a programer??
[07:14:13] pontiki: especially in rails-land, the difference between having to do a code-push to change a value and just restarting with a different configuration value is huge
[07:16:01] sevenseacat: chipotle: a good programmer isn't something you become by following a checklist someone else lays out for you in dot point order
[07:16:14] tildes: chipotle: you could take a look at this guide: http://norvig.com/21-days.html
[07:16:26] pontiki: also, the pragmattic programmer is providing lessons, heuristics, advice, rules of thumb. nothing they describe is a hard-and-fast-overarching rule except "learn"
[07:16:26] tildes: pontiki: yes, I can see that
[07:16:47] sevenseacat: chipotle: if you want to know where the book fits in, read the descriptions, read the excerpts
[07:16:58] sevenseacat: see which one is more applicable for what you want, or read both!
[07:17:18] bumao: has joined #RubyOnRails
[07:17:18] chipotle: tildes: i've read that
[07:17:48] tildes: chipotle: https://blog.codinghorror.com/a-pragmatic-quick-reference/
[07:18:09] chipotle: okay, with the act of sounding thick, what about the art of computer programming? is that something to pick up in the next year?
[07:18:22] chipotle: most of the programming i have done, as a physicist, is matlab
[07:18:48] pontiki: it used to be standard in uni CS courses
[07:19:40] pontiki: if your desire in the next year is to learn general web app development, you don't need it in the next year
[07:19:52] pontiki: in the next 10 years? might be good. necessary? no.
[07:20:14] pontiki: but definitely something on algorithms and data structures
[07:20:15] neanderslob: has joined #RubyOnRails
[07:20:16] xall: has joined #RubyOnRails
[07:20:18] neanderslob_: has joined #RubyOnRails
[07:20:52] sevenseacat: with all due respect, there's no point planning out a big long list of everything you're going to do/read to get from now to 'awesome'
[07:21:12] sevenseacat: what books you're going to buy a year from now
[07:21:20] solars: has joined #RubyOnRails
[07:21:22] pontiki: i think, personal opinion only here, what makes one awesome is practice and review
[07:21:34] sevenseacat: practice, experience, exposure
[07:21:46] chipotle: so norvig's advice is not to expect to learn to program in a day or 21. completely with you. but trying to get some timeline or non-ridgid syllabus not acceptable. sigh
[07:21:49] neanderslob: has joined #RubyOnRails
[07:22:03] sevenseacat: timeline for what?
[07:22:08] pontiki: if you want a syllabus, go to uni
[07:22:25] tildes: chipotle: I think syllabus is a valid concept, just that be flexible about it, not trying to plan 50 years ahead at one go
[07:22:30] pontiki: if you're an autodidact, write your own
[07:22:57] tildes: chipotle: or choose the road in between, and curate your own set of practice projects, books and moocs
[07:22:58] sevenseacat: we don't know what you're trying to achieve other than 'be a programmer'
[07:23:33] tildes: also at least some of us don't know where you are right now
[07:25:21] pontiki: here's my list: http://swaac.tamouse.org/pages/learning/ and it's far from complete.
[07:26:11] sevenseacat: a lot of good books there
[07:26:27] pontiki: sevenseacat: i just wrote down what we've all said, you know?
[07:27:02] sevenseacat: okay I think I've put off work long enough
[07:27:23] guidocalvano: has joined #RubyOnRails
[07:27:27] artto: has joined #RubyOnRails
[07:27:28] chipotle: tildes: not trynig to plan 50 years. jsut trying to see if knuth's book is reasonable to start or use as reference for specific sections in the next year
[07:27:56] edwinvdgraaf: has joined #RubyOnRails
[07:28:44] sevenseacat: ACTION resumes redesigning cash flow forecasting
[07:28:56] pontiki: chipotle: you might be better served if you're looking for a random dip-in and -out reference by SICP
[07:29:23] pontiki: https://mitpress.mit.edu/sicp/
[07:30:09] xall_: has joined #RubyOnRails
[07:30:29] chipotle: pontiki: my goals is to do more complexity work which means learning c++ and python for distrubited/parallel processing simulations as well as being able to make a website and build tools based off public APIs
[07:30:44] pontiki: SICP doesn't care
[07:31:43] pontiki: it uses Scheme to teach; it's the principles that are important; they apply to *all* languages and applications
[07:32:00] pontiki: same as AoCP
[07:34:32] frojnd: Hm.. I wraped my json call to a class by Radar suggestion https://gist.github.com/radar/137ac1e80f9d84877a3a6d9928d77e5b however when I add @weather = Weather.fetch into my controller and call it in view like this: <%= @weather %> I get NameError uninitialized constant StaticPagesController::Weather
[07:35:29] pontiki: frojnd: did you require it in your controller?
[07:35:54] frojnd: pontiki, no I havent. You mean require httparty?
[07:36:11] ur5us: has joined #RubyOnRails
[07:36:16] pontiki: no, the file you defined the Weather class in
[07:36:55] frojnd: so, 'require url_api' ?
[07:37:10] pontiki: i can't possibly know what your file names are
[07:37:27] frojnd: if the file name is lib/url_api.rb
[07:37:48] frojnd: I'm asking because I don't know if there are any name convenctions
[07:37:49] sevenseacat: that would buck Rails conventions for file naming
[07:38:02] sevenseacat: name the file after the class it holds
[07:38:10] frojnd: sevenseacat, ah ok
[07:38:23] DoctorMonocular: has joined #RubyOnRails
[07:42:02] frojnd: Ok I now get 'something wen wrong' This is my controller: https://gist.github.com/anonymous/c87345595d6bc2bf246cc423a681101e and this is what I put in my event.html.erb view at the end of the file <%= @weather %>
[07:42:15] frojnd: The log says: ActionController::RoutingError (undefined local variable or method `weather' for StaticPagesController:Class):
[07:42:38] sevenseacat: I think you should look at how to use the 'require' method
[07:42:49] sevenseacat: and what kind of arguments it takes
[07:42:56] kknight: has joined #RubyOnRails
[07:43:03] pontiki: you might even look at line 1 of your previous gist
[07:43:25] kknight: can anyone solve my problem https://gist.github.com/aj07/6660b7bad1df95d220ebdbdd900887e7
[07:43:37] frojnd: I really should double check what I'm typing
[07:44:39] blackmesa: has joined #RubyOnRails
[07:44:46] tbuehlmann: kknight: I think you want `simple_form_for [@store, @delivery_preference]` (and remove that url: thingy)
[07:45:41] mercerist: has joined #RubyOnRails
[07:45:57] harfangk: has joined #RubyOnRails
[07:46:21] kanzure: has joined #RubyOnRails
[07:48:01] frojnd: I know get "LoadError (cannot load such file -- httparty):" lib/weather.rb:1:in `<top (required)>' https://gist.github.com/radar/137ac1e80f9d84877a3a6d9928d77e5b
[07:48:08] ngw: has joined #RubyOnRails
[07:48:50] kknight: https://gist.github.com/aj07/6660b7bad1df95d220ebdbdd900887e7 tbuehlmann: please see again it shows some other error ..
[07:48:59] frojnd: but reading docs agin https://github.com/jnunemaker/httparty it says: # Or wrap things up in your own class include HTTParty inside a class
[07:49:54] yfeldblum: has joined #RubyOnRails
[07:50:44] frojnd: and if I do it by including HTTParty inside a class I get another error: ActionController::RoutingError (uninitialized constant Weather::HTTParty): lib/weather.rb:4:in `<class:Weather>'
[07:51:06] tbuehlmann: kknight: can you add the delivery_preference_params method to the gist?
[07:51:08] apeiros: frojnd: re your LoadError - have you added httparty to your Gemfile?
[07:51:29] frojnd: apeiros, I've installed it with gem but I didn't add it inside Gemfile
[07:51:40] apeiros: then it's not available to your project. add it there.
[07:52:10] kknight: tbuehlmann: added as comment
[07:52:31] apeiros: and re your "uninitialized constant" error, (somewhat obviously) a constant can't be defined if you don't require the file which contains the definition
[07:52:49] startupality: has joined #RubyOnRails
[07:53:06] tbuehlmann: kknight: I don't see what's wrong. can you add the _complete_ stacktrace to the gist?
[07:53:15] apeiros: make sure you require httparty in all files where you want to make use of it. while requiring once is sufficient, this ensures that you won't have issues due to load order.
[07:53:21] frojnd: apeiros, thank you
[07:53:23] kknight: full controller code?
[07:53:27] kknight: tbuehlmann ?
[07:54:13] startupality: has joined #RubyOnRails
[07:54:41] tbuehlmann: the full controller code and the stacktrace in which the error occurs
[07:57:08] lurch_: has left #RubyOnRails: ()
[07:58:33] frojnd: I now have a whole json response in my view. What if I'd like only one field like description?
[07:58:33] alfiemax: has joined #RubyOnRails
[07:58:54] alfiemax: i have a role field in my user model which is implemented using enum
[07:59:04] frojnd: would I have to parse it in my view or in my custom class?
[07:59:40] alfiemax: i have a validate inclusion validation to make sure the value is valid
[08:00:03] alfiemax: and it works fine when creating a new user
[08:00:18] Coldblackice: has joined #RubyOnRails
[08:00:26] alfiemax: but when i just create a user object using new it gives me an error
[08:00:35] alfiemax: `ArgumentError: 'asd' is not a valid role`
[08:00:52] sevenseacat: alfiemax: code?
[08:02:45] alfiemax: nvm, got my answer here : http://stackoverflow.com/questions/24999145/rails-4-1-enum-raises-error-instead-set-object-as-invalid
[08:03:13] tvw: has joined #RubyOnRails
[08:03:41] kanzure: has joined #RubyOnRails
[08:04:45] AimlessRAven: has joined #RubyOnRails
[08:05:41] kknight: https://gist.github.com/aj07/a31324b572263fb03b3f644041d42dc5
[08:05:51] AimlessRAven: https://gist.github.com/anonymous/6041f60fa234dae0d4dfa74e9895cc07
[08:05:57] kknight: tbuehlmann: i have put this on gist
[08:06:01] AimlessRAven: why i dont receive mailer for submitted order, its a first status
[08:06:12] AimlessRAven: for approved and declined i receive mail
[08:06:16] AimlessRAven: but for submitted not..
[08:06:18] AimlessRAven: someone know shy
[08:09:31] rubyonrails582: has joined #RubyOnRails
[08:10:13] fermonkus: has joined #RubyOnRails
[08:10:35] tbuehlmann: kknight: that's not the full stacktrace
[08:11:05] Kedare: has joined #RubyOnRails
[08:13:49] tbuehlmann: it seems you're using unallowed params somewhere, but I don't see where
[08:14:13] kitsuneyo: has joined #RubyOnRails
[08:15:19] jsrn: has joined #RubyOnRails
[08:16:48] Ergo: has joined #RubyOnRails
[08:17:02] kknight: tbuehlmann: I have put there as comment
[08:17:29] kknight: full stackrace means log here. CCorrect me if i am wrong
[08:18:04] sevenseacat: kknight: can you please gist the log?
[08:18:51] arup_r: has joined #RubyOnRails
[08:19:34] arup_r: I am getting error *Uncaught TypeError: $(...).on is not a function* .. https://gist.github.com/aruprakshit/507fc5edf5722dd17e4614cf4ed1ceb7#file-pages-js-L6
[08:19:43] kknight: i am posting full log..
[08:19:45] arup_r: any idea what could be the issue? I am lost it seems
[08:20:08] arup_r: issue is from turbolink..
[08:20:24] sevenseacat: kknight: where?
[08:20:30] kknight: sevenseacat: tbuehlmann i have posted full log there
[08:20:37] kknight: as comment
[08:21:27] sevenseacat: kknight: Processing by StoresController#filter as HTML
[08:21:30] sevenseacat: there's the problem.
[08:21:40] norc: arup_r: The immediate cause is that jquery is obviously not loaded yet.
[08:21:52] ppnlo: has joined #RubyOnRails
[08:21:56] arup_r: That is loaded, I tested
[08:21:58] sevenseacat: kknight: why does POST "/stores/greenbasketstore/delivery_preferences" go to StoresController#filter ?
[08:22:00] kknight: sevenseacat: will you please explain little more
[08:22:39] arup_r: norc: I ran $.each([ 52, 97 ], function( index, value ) { alert( index + ": " + value ); }); and it is working
[08:22:50] arup_r: but what is wrong with .on() i don't know
[08:23:07] norc: arup_r: Try using jQuery - perhaps you have some dependency that overrides $
[08:23:16] arup_r: ok let me try
[08:23:43] arup_r: same error TypeError: jQuery(...).on is not a function
[08:23:50] norc: arup_r: Oh silly me, no its your user fault.
[08:24:01] DoubleMalt: has joined #RubyOnRails
[08:24:03] norc: arup_r: You cannot use $(document).on
[08:24:06] arup_r: ok.. where it is ? could u ell me?
[08:24:16] norc: arup_r: I recommend you look at the documentation: http://api.jquery.com/on/
[08:24:27] arup_r: I am using https://github.com/turbolinks/turbolinks-classic/tree/2-5-stable
[08:24:30] guidocalvano: has joined #RubyOnRails
[08:24:55] sevenseacat: what at not being able to call $(document).on
[08:25:00] arup_r: that doco has example
[08:25:01] sevenseacat: that makes no kind of sense
[08:25:48] kitsuneyo: has joined #RubyOnRails
[08:26:13] norc: sevenseacat: On second thought you are right. I take it all back. :(
[08:26:20] arup_r: I don't get what u said.. something strange happening .. :(
[08:27:16] sevenseacat: arup_r: why are you using turbolinks-classic
[08:27:53] sevenseacat: arup_r: have you gisted the error yete?
[08:28:09] blackhuey: has joined #RubyOnRails
[08:28:33] norc: arup_r: Which jquery version are you using?
[08:28:40] arup_r: sevenseacat: https://rubygems.org/gems/turbolinks/versions/2.5.3 points to the doc link I gave
[08:28:46] DTZUBDUB: has joined #RubyOnRails
[08:28:50] sevenseacat: arup_r: thats not your error
[08:28:59] arup_r: sevenseacat: errors is in browser console .. so I pasted here in the chat
[08:29:04] sevenseacat: and why are you using such an old version of the gem
[08:29:09] arup_r: norc: let me check
[08:29:20] norc: sevenseacat: Im thinking arup_r uses a pre 1.7 jquery version.
[08:29:27] sevenseacat: I'm thinking he has no idea
[08:29:35] arup_r: norc: * jQuery JavaScript Library v1.12.1
[08:29:49] arup_r: yes sevenseacat I have idea..
[08:29:59] arup_r: norc: u are right
[08:30:05] sevenseacat: arup_r: okay, so why are you using such an old deprecated version of the gem?
[08:30:08] arup_r: how come it is so old..
[08:30:29] arup_r: I have the gem in my Gemfile.. let me go and work on it to figure out why it is so old
[08:31:48] Oliphaunte: has joined #RubyOnRails
[08:32:39] jsrn: has joined #RubyOnRails
[08:33:12] apeiros: jquery 1.12 isn't old. it's the newest if you have to support old IEs
[08:33:18] arup_r: Hmm it is not old
[08:33:29] arup_r: I just checked https://github.com/rails/jquery-rails/blob/master/VERSIONS.md
[08:33:32] startupality: has joined #RubyOnRails
[08:33:44] siaw23: has joined #RubyOnRails
[08:33:55] arup_r: and I have jquery-rails (4.1.1) in Gemfile.lock
[08:34:04] arup_r: so something else causing the issue
[08:34:13] sevenseacat: arup_r: okay, so why are you using such an old deprecated version of the turbolinks gem?
[08:34:20] sevenseacat: i'll keep asking until i get an answer
[08:34:27] adre: has joined #RubyOnRails
[08:34:40] apeiros: (1.12.4 would be the newest, though, not 1.12.1)
[08:35:02] arup_r: sevenseacat: I have turbolinks (2.5.3) in gemfile.lock and gem 'turbolinks' in gemfile .. is it outdated?
[08:35:17] sevenseacat: "Classic version of Turbolinks. Now deprecated in favor of Turbolinks 5."
[08:35:24] stokhoskat: has joined #RubyOnRails
[08:35:28] sevenseacat: "Latest commit ad127fc on 8 Dec 2014 "
[08:35:34] arup_r: so which gem I should use?
[08:36:02] arup_r: I mean the version. these comes default with Rails, when I did `rails new`
[08:36:06] sevenseacat: update the gem.
[08:36:38] sevenseacat: then gist the error you're seeing.
[08:36:50] weckl: has joined #RubyOnRails
[08:37:33] stokhoskat: has left #RubyOnRails: ()
[08:38:20] arup_r: I did bundle update turbolinks .. and then adding a screenshot
[08:38:32] arup_r: nothing updated though in the gemfile.lock
[08:38:51] sevenseacat: great. let's look at the error message then.
[08:39:49] mikecmpbll: has joined #RubyOnRails
[08:40:15] ngw: has joined #RubyOnRails
[08:40:18] lxsameer: has joined #RubyOnRails
[08:40:22] arup_r: ok, look the first error https://gist.github.com/aruprakshit/507fc5edf5722dd17e4614cf4ed1ceb7#file-pages-js-L6
[08:41:08] arup_r: Jquery(...).on( or $(..).on( same errors fyi.
[08:41:29] sevenseacat: so look at the load order of the files - the error from jquery appears to be last
[08:41:40] mooru: has joined #RubyOnRails
[08:41:51] sevenseacat: do you have multiple versions of jquery on thepage?
[08:42:25] marr: has joined #RubyOnRails
[08:42:38] arup_r: no only 1
[08:42:43] mooru: has joined #RubyOnRails
[08:43:41] frojnd_: has joined #RubyOnRails
[08:45:02] sevenseacat: ain't outsourcing grand
[08:45:42] blackmesa: has joined #RubyOnRails
[08:45:45] arup_r: in browser view page source
[08:46:16] sevenseacat: arup_r: I cannot see your browser view page source
[08:47:30] arup_r: uploaded https://gist.github.com/aruprakshit/507fc5edf5722dd17e4614cf4ed1ceb7
[08:48:13] sevenseacat: well that doesnt tell me anything
[08:49:01] arup_r: where else, u think I should look ?
[08:49:18] sevenseacat: I think you should answer my question
[08:49:38] arup_r: what is the question again?
[08:49:51] sevenseacat: actually it does tell me something - there's multiple jquerys there
[08:50:12] sevenseacat: your colorpicker also includes one
[08:50:15] sevenseacat: what version is that?
[08:50:21] salexa: has joined #RubyOnRails
[08:50:27] frojnd: I'm having hard time extracting only values of "description" from json response: https://gist.github.com/anonymous/7db33b2574cf7837dfd8ad39408395bb it gives me: TypeError in StaticPagesController#event no implicit conversion of String into Integer This is my custom Class where rest call is defined: https://gist.github.com/anonymous/51c3f263d756efc94c8aaa1d30986cca This is my controller: https://gist.github.com/anonymous/9c873231172ec7e71f31f9c60
[08:50:27] frojnd: 7f11362 I would like to get only the "description" values
[08:50:31] arup_r: there is 1
[08:50:34] frojnd: Any ideas how can I get it?
[08:50:46] futilegames: has joined #RubyOnRails
[08:50:47] arup_r: and that is 1.3
[08:50:59] arup_r: thanks, I know now what to do
[08:51:09] sevenseacat: frojnd: what is @forecast and what is daily ?
[08:51:25] sevenseacat: arup_r: amazing what happens when you answer questions.
[08:51:45] sevenseacat: would have picked it much earlier if you'd just gisted the code like I asked you to, but hey
[08:51:54] jgt1: has joined #RubyOnRails
[08:51:57] sevenseacat: because i cant ctrl-f a screenshot
[08:52:30] arup_r: thank you.. I didn't think someone can put there also 1 .. anyway thanks for so many eyes here.
[08:53:10] gingray: has joined #RubyOnRails
[08:53:17] frojnd: sevenseacat, forecast is the whole json response daily should be one of daily forecasts
[08:53:26] sevenseacat: frojnd: that doesnt answer my question
[08:53:29] sevenseacat: frojnd: show me what it is
[08:53:32] sevenseacat: what value it has
[08:53:40] sevenseacat: and gisting the error would also be great
[08:53:56] frojnd: sevenseacat, let me give you that too
[08:53:58] moeabdol: has joined #RubyOnRails
[08:55:10] tbuehlmann: I'd like to have some kind of issue template for this IRC channel, including the corresponding code and the full error message
[08:55:17] tbuehlmann: like github issue templates :\
[08:55:28] sevenseacat: would be nice
[08:55:50] sevenseacat: we point people to the !debug factoid, which usually gets ignored, even by people who should know better
[08:55:51] helpa: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[08:55:52] fermonkus: has joined #RubyOnRails
[08:56:29] frojnd: sevenseacat, inside list there is "description" for each day starting today: https://gist.github.com/anonymous/338c97b32cc18b088b46535781f695bf this is error message: https://gist.github.com/anonymous/ff893c40c160a466ac95d920049f0881
[08:56:55] kitsuneyo: has joined #RubyOnRails
[08:57:40] sevenseacat: frojnd: right, so @forecast is a hash - calling each on a hash will give you an array of keys and values
[08:57:40] artto: has joined #RubyOnRails
[08:57:57] sevenseacat: *arrays of key-value pairs
[08:58:05] sevenseacat: you can't call ["description"] on an array
[08:58:15] futilegames: has joined #RubyOnRails
[08:58:17] frojnd: I have some sort of arrays inside arrays
[08:58:36] sevenseacat: not in that gist you posted
[08:59:01] frojnd: well.. I'm insterested in "list" -> "weather" -> "description"
[08:59:15] sevenseacat: then thats how you access it
[08:59:20] sevenseacat: you skipped a few steps in your code
[08:59:39] sevenseacat: tried to go straight to description
[09:00:09] frojnd: What should I do define in order to go first to the list and then to weather and after it to description?
[09:00:25] sevenseacat: you first access the list, then the weather, then the description
[09:00:32] swap_a_b: has joined #RubyOnRails
[09:00:58] sevenseacat: you may want to iterate over the list with each, not the overall forecast
[09:00:59] apeiros: frojnd: tip - use pry/irb/rails c to test those things out.
[09:01:12] apeiros: it's easier to play around there and figure how to access the datastructure properly
[09:01:24] frojnd: sevenseacat, yeah but how do I access the list first?
[09:03:25] frojnd: sevenseacat, you said I get an array of keys and values,.. so I need to loop through list as a key first and then weather
[09:04:35] kailido: has joined #RubyOnRails
[09:04:49] kailido: how can I ignore a folder in gitignore ?
[09:05:01] rvanlieshout: kailido: don't look at it
[09:05:01] kailido: my git is not ignoring idk why
[09:05:07] rvanlieshout: or who should ignore it?
[09:05:31] jancel: has joined #RubyOnRails
[09:05:32] rvanlieshout: git doesn't ignore anything unless you've added it to .gitignore
[09:05:32] universa1: kailido: .gitignore -> path/to/folder
[09:05:45] kailido: i did it and its not ignoring
[09:06:02] universa1: kailido: !code -- and also #git might be tad more appropriate ;)
[09:06:02] helpa: kailido: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[09:06:41] kailido: https://gist.github.com/luisamaro0/982c806c97769c990f0bd52935bba11f
[09:07:29] rickmasta: has joined #RubyOnRails
[09:07:31] universa1: did you previously add it? then you might have to git rm it first.
[09:08:21] kailido: yes its there on github, but I dont want to update it anymore
[09:08:54] universa1: then git rm it.
[09:09:00] wethu: has joined #RubyOnRails
[09:10:02] kailido: what it does ?
[09:10:10] quazimodo: has joined #RubyOnRails
[09:10:12] quazimod1: has joined #RubyOnRails
[09:10:14] universa1: kailido: git help rm
[09:10:27] universa1: kailido: https://git-scm.com/book/en/v2/Getting-Started-Git-Basics
[09:12:03] ur5us: has joined #RubyOnRails
[09:12:16] evansbee: has joined #RubyOnRails
[09:12:52] kailido: but i need the folder there
[09:13:24] czerasz: has joined #RubyOnRails
[09:13:29] frojnd: apeiros, how do I simulate response from httparty inside rails console as you suggested?
[09:13:42] tennis: has joined #RubyOnRails
[09:14:02] universa1: kailido: then keep a .keep file, like you see for the log folder.
[09:14:33] apeiros: frojnd: you don't care about the response, do you? all you care about is that datastructure. so no simulation necessary. just load the datastructure. JSON.parse is your friend.
[09:14:55] workmad3: has joined #RubyOnRails
[09:14:55] apeiros: or copy & paste a pp/inspect into a file and load that.
[09:16:46] swap_a_b: has left #RubyOnRails: ()
[09:18:01] jtong: has joined #RubyOnRails
[09:19:54] arBmind: has joined #RubyOnRails
[09:20:40] frojnd: apeiros, I've created jsonresponse.json file and then started rails console and after it tried to load it with: "load jsonresponse.json" But it won't load file.
[09:21:09] frojnd: I assume after I load file I run JSON.parse
[09:21:11] apeiros: um, yes, because Kernel#load is for ruby code, not json.
[09:21:31] apeiros: you read the file (as text), and then you feed it as input to JSON.parse.
[09:21:47] bookies: has joined #RubyOnRails
[09:23:05] frojnd: let say I save it inside app
[09:23:30] frojnd: I start rails console and then JSON.parse app/jsonresponse.txt ?
[09:23:40] universa1: frojnd: no.
[09:23:43] bookies: On my Rails app, in production, I use devise and when I register a user that has a gmail account the email is sent fine. When I try to do the same with outlook or hotmail service the email does not go through. These have been taking place long. Did anyone experience something like this? In both cases logs show "Sent mail to email@example.com (38.3ms)"
[09:24:16] universa1: frojnd: raw_json = SomeClass.with_method_to_load_file_as_string "app/jsonresponse.txt"; JSON.parse raw_json
[09:25:07] universa1: bookies: how are you sending it? smtp? personal smtp server?
[09:25:23] qejk: has joined #RubyOnRails
[09:25:52] bookies: universa1: sendgrid. I used the same setup for several projects
[09:25:55] apeiros: frojnd: what universa1 said.
[09:26:13] frojnd: so I need to create a class that reads txt file
[09:26:15] Oliphaunte: has joined #RubyOnRails
[09:26:17] universa1: frojnd: no.
[09:26:34] universa1: frojnd: ruby already has you covered.
[09:27:00] frojnd: universa1, but there is "SomeClass" and ."with_method_to_load_file_as_string"
[09:27:05] universa1: frojnd: but this is something you can figure out on your own, i think that way you learn a lot more.
[09:27:05] apeiros: frojnd: it might be a good idea to do some ruby tutorial or other entry level reading
[09:27:05] ferr1: has joined #RubyOnRails
[09:27:24] universa1: not spoonfeeding, sorry.
[09:27:29] bookies: universa1: I tested on mandril as well and I get the same behaviour
[09:27:47] sevenseacat: this is a rails help channel, not ruby basics
[09:28:04] universa1: bookies: so "ask" sendgrid if they have some error logs ;)
[09:28:25] blackmesa: has joined #RubyOnRails
[09:28:33] bookies: universa1: thanks, didn't think about that. I thought it would be recorded on my logs if there was an error
[09:29:07] universa1: bookies: well the email sending is outside of your app, you just notify the sendgrid service, don't you?
[09:29:20] bookies: correct. thanks a lot
[09:29:57] universa1: bookies: the sendgrid response object (if there is one) might have some status/error on it (never used sendgrid) :-) yw
[09:33:03] frojnd: it's so simple with ruby that I have problems with simplicity :S
[09:33:56] frojnd: All I had to do was: raw_json = FIle.read("app/myfile.json") and then JSON.parse raw_json to have my hash stored inside raw_json
[09:35:40] Niham: has joined #RubyOnRails
[09:39:07] alfiemax: is it possible to limit the number of associated objects for has_many association ?
[09:39:28] guardianJ: has joined #RubyOnRails
[09:39:35] universa1: alfiemax: possible, yes.
[09:41:11] alfiemax: universa1, using something that's inbuilt in rails??
[09:42:30] universa1: alfiemax: yes, custom validation. -- you probably want a "database trigger/check", too
[09:42:45] haaj: has joined #RubyOnRails
[09:42:49] alfiemax: lol.. thats custom :D
[09:43:14] alfiemax: that's fine
[09:45:20] snowy: has joined #RubyOnRails
[09:47:34] artto_: has joined #RubyOnRails
[09:50:17] artto: has joined #RubyOnRails
[09:51:20] guardianJ: has left #RubyOnRails: ()
[09:51:24] rikkipitt: has joined #RubyOnRails
[09:53:40] sameerynho: has joined #RubyOnRails
[09:57:14] artto: has joined #RubyOnRails
[09:59:08] FooMunki: has joined #RubyOnRails
[10:01:27] artto: has joined #RubyOnRails
[10:02:37] workmad3: has joined #RubyOnRails
[10:04:27] Sashimi: has joined #RubyOnRails
[10:06:18] haaj_: has joined #RubyOnRails
[10:07:30] arup_r: has joined #RubyOnRails
[10:08:12] Sashimi: has joined #RubyOnRails
[10:08:54] frojnd: I'm struggling with accessing list's weather information... I can access list by doing <%= @forecast["list"] %> but don't know how to access weather array
[10:09:31] arup_r: frojnd: using .each or by index like array[index]
[10:10:14] harfangk: has joined #RubyOnRails
[10:13:43] frojnd: arup_r, I now have like this: <%= @forecast["list"].each do |weather| %> weather <% end %> but instead of getting weather info It just prints weather, weather, weather... This is my current json response: https://gist.github.com/anonymous/414e128d21277bb0dbe0b5389a100962
[10:14:06] frojnd: Well what I would like is weather's description
[10:14:28] universa1: frojnd: do you know what <%= %> does ?
[10:14:31] arup_r: <% @forecast["list"].each do |weather| %> <%= weather %> <% end %> this is a common mistak, many does
[10:14:40] arup_r: ^ this will wor
[10:14:41] frojnd: universa1, yeah... it's for putting rails code inside html
[10:14:48] frojnd: universa1, ruby code
[10:14:59] universa1: frojnd: not quite.
[10:15:00] frojnd: so it won't get shown as code
[10:15:08] frojnd: but rather render it
[10:15:19] universa1: frojnd: http://www.stuartellis.eu/articles/erb/
[10:15:33] arup_r: frojnd: <%= executes and print and <% only executes
[10:17:14] dionysus69: has joined #RubyOnRails
[10:18:21] c355E3B: has joined #RubyOnRails
[10:18:44] frojnd: I see.. I forgot to add <%=
[10:19:01] Macaveli: has joined #RubyOnRails
[10:20:05] Rinzlit: has left #RubyOnRails: ("Got Cancer and died")
[10:20:46] mdw: has joined #RubyOnRails
[10:22:55] haaj: has joined #RubyOnRails
[10:23:30] Sashimi: has joined #RubyOnRails
[10:23:40] frojnd: Hm.. I'm still not seeing only "weather" but I'm also seeing dt, temp..
[10:25:33] frojnd: https://gist.github.com/anonymous/03a9e5a296cfc2306827b56472efe80e What I would like to do is to show only "description" for each day's weather
[10:25:42] kitsuneyo: has joined #RubyOnRails
[10:26:10] fermonkus: has joined #RubyOnRails
[10:26:19] sevenseacat: remember how you said you wanted to go list -> weather -> description?
[10:26:23] sevenseacat: you're still not doing that
[10:26:27] sevenseacat: you've got list
[10:26:32] sevenseacat: now drill down again
[10:26:39] frojnd: sevenseacat, yeas.. and now I should have weather? :)
[10:26:47] sevenseacat: and now you can access description
[10:27:15] frojnd: I see what I did wront
[10:29:30] frojnd: This is working code: https://gist.github.com/anonymous/5312609fc0128384ad8279373fe0aea7
[10:29:31] DTZUBDUB: has joined #RubyOnRails
[10:30:02] frojnd: Now I have to put this inside my calendar :) but how do I know which day is today :) I must reread simple_calendar gem
[10:30:46] diegoaguilar: has joined #RubyOnRails
[10:38:34] wethu: has joined #RubyOnRails
[10:41:10] kitsuneyo: has joined #RubyOnRails
[10:53:34] GodFather: has joined #RubyOnRails
[11:01:44] diegoaguilar: has joined #RubyOnRails
[11:03:18] artto: has joined #RubyOnRails
[11:09:24] rodfersou: has joined #RubyOnRails
[11:13:00] frojnd: I have a question regarding dates... in api json response I see: dt: 1466420400 how can I convert this into yyyy-mm-dd?
[11:13:09] evansbee: has joined #RubyOnRails
[11:14:03] Oliphaunte: has joined #RubyOnRails
[11:15:44] workmad3: frojnd: depends on what exactly that number means in the API's time representation
[11:16:32] GodFather: has joined #RubyOnRails
[11:16:36] frojnd: workmad3, unix UTC
[11:17:09] universa1: well, then you got your first question: how to convert a unix timestamp into a ruby date/time object
[11:17:27] universa1: the second is then: how to convert a ruby date/time object into a formatted string.
[11:18:20] AmiMoench: has joined #RubyOnRails
[11:20:57] King_Rex: has joined #RubyOnRails
[11:25:41] Axilla: has joined #RubyOnRails
[11:26:46] artto: has joined #RubyOnRails
[11:27:33] diegoaguilar: has joined #RubyOnRails
[11:29:22] DTZUBDUB: has joined #RubyOnRails
[11:30:02] srinidhi: has joined #RubyOnRails
[11:30:04] wethu: has joined #RubyOnRails
[11:30:57] frojnd: OK got it.
[11:33:11] diegoaguilar: has joined #RubyOnRails
[11:34:51] adac: has joined #RubyOnRails
[11:35:16] adac: Like this I can redirect all my log output to STDOUT: config.logger = Logger.new(STDOUT)
[11:35:40] adac: I was wondering if I could somehow send it to STDOUT and the file still. So both locations. If yes, how to do that?
[11:37:39] universa1: tail -f some/file.log?
[11:38:00] adac: I think this is a nice way, just googled it: http://stackoverflow.com/questions/6407141/how-can-i-have-ruby-logger-log-output-to-stdout-as-well-as-file
[11:38:15] adac: this would also work: https://coderwall.com/p/y_b3ra/log-to-stdout-and-a-file-at-the-same-time
[11:38:20] adac: universa1,^^
[11:38:21] wethu: has joined #RubyOnRails
[11:40:28] adac: doing this universa1 http://manas.com.ar/blog/2015/12/15/logging-for-rails-apps-in-docker.html nut addditionally want to still log into the file as explained above
[11:40:30] rikkipitt: has joined #RubyOnRails
[11:41:25] fermonkus: has joined #RubyOnRails
[11:41:54] AzaToth: has joined #RubyOnRails
[11:42:01] artto: has joined #RubyOnRails
[11:43:32] workmad3: adac: I'd normally suggest that if you want to spit logs out to STDOUT, you'd be doing so because you're inside a container or process manager that will handle capturing that into a file for you
[11:44:48] adac: workmad3, exactly yes. docker can indeed handle this via log drivers. It is just my backup server is not so stable yet and in case it is down, I'd still like to have a backup log file for now where I can lookup stuff
[11:46:33] blackmesa: has joined #RubyOnRails
[11:50:40] dionysus69: has joined #RubyOnRails
[11:51:46] ldnunes: has joined #RubyOnRails
[11:51:47] norc: adac: Instead of trying to redirect output to STDOUT, why not simply run tail on your log?
[11:53:11] adac: norc, that is another option yes
[11:54:59] SirOliver: has joined #RubyOnRails
[11:55:24] adac: Sir welcome Sir :)
[11:57:12] ddv: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[11:59:31] pawnbox: has joined #RubyOnRails
[12:01:29] jenrzzz: has joined #RubyOnRails
[12:01:29] jenrzzz: has joined #RubyOnRails
[12:03:24] axxyhtrx: has joined #RubyOnRails
[12:08:20] Oliphaunte: has joined #RubyOnRails
[12:13:50] _underscore_: has joined #RubyOnRails
[12:14:44] boshhead: has joined #RubyOnRails
[12:15:37] Pazician_: has joined #RubyOnRails
[12:16:02] jtd: has joined #RubyOnRails
[12:16:14] GoranPavlovic: has joined #RubyOnRails
[12:16:15] fmcgeough: has joined #RubyOnRails
[12:16:15] jamo: has joined #RubyOnRails
[12:16:59] arthurnn: has joined #RubyOnRails
[12:17:05] Confiks: has joined #RubyOnRails
[12:17:12] AntiSpamMeta: has joined #RubyOnRails
[12:17:21] Weavel: has joined #RubyOnRails
[12:17:24] philtr: has joined #RubyOnRails
[12:17:44] xpl0iter: has joined #RubyOnRails
[12:18:32] k13nox: has joined #RubyOnRails
[12:19:13] xpl0iter: I have a slider which determines the cost of the product. Now I have to send a post request to the payment gateway with the cost param. Can anyone tell me how can I do this?
[12:19:40] jdcauley: has joined #RubyOnRails
[12:19:43] jenrzzz: has joined #RubyOnRails
[12:19:43] jenrzzz: has joined #RubyOnRails
[12:19:46] chrisarcand: has joined #RubyOnRails
[12:19:50] xpl0iter: Essentially I have to get the value from the slider and then add it to the psot request and send it
[12:20:01] darrik: has joined #RubyOnRails
[12:20:17] pawnbox: has joined #RubyOnRails
[12:20:24] gregf_: has joined #RubyOnRails
[12:20:26] bitemyapp: has joined #RubyOnRails
[12:20:40] AntiSpamMeta: has joined #RubyOnRails
[12:22:29] null__: has joined #RubyOnRails
[12:22:31] shaman42: has joined #RubyOnRails
[12:22:41] artto: has joined #RubyOnRails
[12:22:47] chintanparikh: has joined #RubyOnRails
[12:23:08] hfp: has joined #RubyOnRails
[12:23:17] darrik: has joined #RubyOnRails
[12:23:25] norc: xpl0iter: JavaScript is your friend.
[12:24:36] xpl0iter: norc, I tthink its going to be really complicated because I use sending many of the forms data as params for partials :[ Anyway thanks
[12:24:46] Akuma: has joined #RubyOnRails
[12:25:12] norc: xpl0iter: If you consider basic javascript to be really complicated, you might want to change your hobby to something less daunting. BASIC programming perhaps.
[12:25:30] norc: Because web development will be out of your reach without it.
[12:25:52] njero: has joined #RubyOnRails
[12:26:03] Pazician: has joined #RubyOnRails
[12:26:03] Pazician: has joined #RubyOnRails
[12:27:26] xpl0iter: norc, I know, I just never got around learning javascript properly. also just reazlize, I could just rewrite the whole post request by replacing what I don't need with what I need.
[12:27:57] norc: xpl0iter: JavaScript is fairly easy to pick up.
[12:28:22] SirOliver: has joined #RubyOnRails
[12:28:35] xpl0iter: norc, hmm. I will have to do that. No way of avoiding it. Its becoming more and more clear nowadays
[12:29:19] yardenbar: has joined #RubyOnRails
[12:31:38] greg: has joined #RubyOnRails
[12:31:52] AimlessRAven: has joined #RubyOnRails
[12:31:55] Tempesta: has joined #RubyOnRails
[12:32:06] Pazician_: has joined #RubyOnRails
[12:32:06] Pazician_: has joined #RubyOnRails
[12:32:14] greg: any tutorial to change ruby code into ajax for rails app
[12:32:15] iamayam: has joined #RubyOnRails
[12:32:20] greg: need suggestion...
[12:32:25] AimlessRAven: can feedjira read a link to current news
[12:32:36] AimlessRAven: not all news in rs channel
[12:33:37] DTZUBDUB: has joined #RubyOnRails
[12:34:16] roamingdog: has joined #RubyOnRails
[12:34:23] DoubleMalt: has joined #RubyOnRails
[12:34:49] bbrowning: has joined #RubyOnRails
[12:37:30] ppnlo: has joined #RubyOnRails
[12:40:11] mshowman: has joined #RubyOnRails
[12:41:20] armyriad: has joined #RubyOnRails
[12:41:51] jancel: has joined #RubyOnRails
[12:43:01] cleopatra: has joined #RubyOnRails
[12:43:07] shinnya: has joined #RubyOnRails
[12:44:41] CrownBerry: has joined #RubyOnRails
[12:45:28] roelof: has joined #RubyOnRails
[12:45:44] mattp_: has joined #RubyOnRails
[12:45:56] wldcordeiro: has joined #RubyOnRails
[12:46:36] jgt1: has joined #RubyOnRails
[12:46:43] CrownBerry: Hello. Can anyone help? In turbolinks 5 page:events was changed to turbolinks:events (for example "page:load" now is "turbolinks:load"). How can I catch "before-change" event now? In previous version i use $(document).on('page:before-change', myFunction());
[12:47:15] AimlessRAven: can feedjira read different type of xml format
[12:47:17] universa1: wild guess: on('turbolinks:before-change', ...)
[12:47:19] AimlessRAven: i mean direct news link
[12:47:26] universa1: AimlessRaven: rails relevance?
[12:48:29] CrownBerry: universa1: this not work :< there is no it event on github readme, in list of Turbolink event
[12:48:45] rvanlieshout: AimlessRaven: you did reed the documentation?
[12:48:45] xcesariox: has joined #RubyOnRails
[12:49:08] AimlessRAven: rvanlieshout: yeah but there is not info for my problem
[12:49:12] universa1: CrownBerry: well, then they probably dropped it? did you check their code?
[12:50:14] universa1: CrownBerry: https://github.com/turbolinks/turbolinks#canceling-visits-before-they-start
[12:52:25] CrownBerry: universa1: oh, thank you. That's what I need. It is strange that I did not immediately see this paragraph.
[12:52:38] Oliphaunte: has joined #RubyOnRails
[12:52:51] universa1: CrownBerry: check the full lust of events, it might not exactly do what you want.
[12:52:59] universa1: https://github.com/turbolinks/turbolinks#full-list-of-events
[12:54:06] Fernando-Basso: has joined #RubyOnRails
[12:57:00] roelof: Hello, I try to make a postgresql database with this : createdb app_production --encoding='utf-8' --locale=en_US.utf8 --template=template1;
[12:57:15] roelof: but when I do \l the database is not listed
[12:57:22] roelof: what went wrong here ?
[12:58:00] emilkarl: has joined #RubyOnRails
[12:59:16] universa1: output of the postgres console?
[12:59:26] universa1: it probably told you what went wrong there.
[13:00:05] roelof: universa1: here you have the output : https://gist.github.com/rwobben/60b11eb0b833e029510ba1430e32b25f
[13:01:15] xcesariox: universa1 : i need help
[13:01:31] Pazician: has joined #RubyOnRails
[13:02:04] universa1: roelof: https://www.postgresql.org/docs/9.0/static/sql-createdatabase.html
[13:02:22] universa1: roelof: The program createdb is a wrapper program around this command, provided for convenience.
[13:02:46] universa1: roelof: so my psql console also tells me: syntax error at or near "createdb"
[13:02:52] universa1: xcesariox: here have some help.
[13:03:05] roelof: universa1: the mine not
[13:03:10] xcesariox: universa1 https://gist.github.com/shaunstanislaus/eede7e79e78cf11eda5fa91320ea4682 https://gist.github.com/shaunstanislaus/eede7e79e78cf11eda5fa91320ea4682
[13:03:16] universa1: xcesariox: !gist-usage
[13:03:16] helpa: xcesariox: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[13:03:19] Sashimi: has joined #RubyOnRails
[13:03:45] roelof: so I can do CREATE DATABASE app_development ENCODING 'UTF8' TEMPLATE template1; ?
[13:03:56] universa1: and also: explain your problem first, then a gist link at the end.
[13:04:06] xcesariox: universa1 the error message is here https://infinit.io/_/Z7xWdfu
[13:04:07] universa1: roelof: !try
[13:04:07] helpa: roelof: Why don't you try it and find out for yourself?
[13:04:13] jokke: i'm trying to use rspec for rails
[13:04:34] jokke: but the generator still creates minitest tests
[13:04:35] xcesariox: universa1 : the issue is problem is in htere. i accidentally pasted the gist link twice, wanted to paste the other link as the problem
[13:04:35] universa1: xcesariox: explain your problem in plain, english words! in the channel.
[13:04:46] xcesariox: universa1 : so i am getting a undefined resource
[13:04:52] jokke: i already ran rails g rspec:install
[13:05:00] xcesariox: undefined local variable or method `resource' universa1
[13:05:01] roelof: and that one works , finally
[13:05:07] jokke: any ideas
[13:05:15] jgt1: has joined #RubyOnRails
[13:05:33] universa1: jokke: do you have some config/initializer in your application.rb / config folder which sets minitest?
[13:05:47] blackmesa: has joined #RubyOnRails
[13:05:50] universa1: jokke: well then...
[13:06:27] xcesariox: universa1 : the issue i am facing here is i am an error that says " undefined local variable or method `resource'" for "return '' if resource.errors.empty?"
[13:06:35] universa1: xcesariox: o0
[13:06:52] universa1: xcesariox: why do you think your helper should have "resource" defined?
[13:06:54] xcesariox: universa1 : please kindly see my code at https://gist.github.com/shaunstanislaus/eede7e79e78cf11eda5fa91320ea4682
[13:07:12] xcesariox: universa1 : this was according to devise code he gave
[13:07:21] universa1: who? where? ...
[13:07:26] xcesariox: https://github.com/plataformatec/devise/wiki/How-To:-Integrate-I18n-Flash-Messages-with-Devise-and-Bootstrap
[13:07:27] sevenseacat: so... where is resource defined?
[13:07:59] sevenseacat: so where are you calling this helper method?
[13:08:00] xcesariox: sevenseacat : hi cat! i have no idea where it is defined.
[13:08:55] xcesariox: sevenseacat : in sign up, login page
[13:09:21] gfvcastro: has joined #RubyOnRails
[13:09:45] xcesariox: sevenseacat universa1 : i am calling it in layouts/application.html.erb
[13:09:48] universa1: xcesariox: well right now you're trying to call it in your layout, and not from a devise view.
[13:09:59] universa1: xcesariox: have you tried only calling it from a devise view?
[13:10:15] xcesariox: universa1 : i didn't generate the devise views
[13:10:22] xcesariox: universa1 : so i must generate the devise views first?
[13:10:27] universa1: xcesariox: because what you linked to: Next in your devise views you will have to define where you want the error messages to appear.
[13:10:35] jokke: universa1: ah great, it was actually in application.rb where i had to remove require ..test_unit and add https://p.jreinert.com/ybDq/ruby
[13:10:47] sevenseacat: Next in your devise views you will have to define where you want the error messages to appear. You will need to enter <%= devise_error_messages! %> within the devise pages
[13:10:54] sevenseacat: key words *in your devise views*
[13:11:00] universa1: tbh, this sounds like it might (!, if it all) work only there.
[13:11:05] workmad3: xcesariox: `resource` is the generic name that devise uses to refer to the devise class currently being used
[13:11:39] xcesariox: workmad3 , universa1 , sevenseacat : so i need to run rails g devise:views ?
[13:11:43] workmad3: (most likely, just an instance of user)
[13:12:03] universa1: xcesariox: looks like it, yes.
[13:12:19] xcesariox: universa1 : right okay.
[13:12:23] workmad3: xcesariox: well, you can't just dump it into your application layout and expect it to work :P
[13:12:46] universa1: xcesariox: commit before, try, works? good, next commit. does not work -> no problem, go back to old commit.
[13:13:18] xcesariox: universa1 : yup i do, do commit them. and reset --hard them if it doesn't work.
[13:13:27] xcesariox: universa1 : thanks for the heads up though.
[13:15:42] AdamOnRails: has joined #RubyOnRails
[13:15:54] someish: has joined #RubyOnRails
[13:16:08] eljimbo: has joined #RubyOnRails
[13:17:06] ErhardtMundt: has joined #RubyOnRails
[13:18:15] M-shine: has joined #RubyOnRails
[13:19:48] jtong: has joined #RubyOnRails
[13:21:15] xcesariox: universa1 : erm what do i do after generating rails views?
[13:22:18] norc: xcesariox: rails will tell you what it generates
[13:22:29] norc: xcesariox: You can then go edit the files as required.
[13:22:41] Oliphaunte: has joined #RubyOnRails
[13:25:38] gremly: has joined #RubyOnRails
[13:26:27] yottanami1: has joined #RubyOnRails
[13:26:45] yottanami1: Is any shorter way to write this condition? http://dpaste.com/1KC5343
[13:27:40] roelof: yottanami_: this looks like validation to me. Am I right ?
[13:28:54] norc: yottanami_: The immediate solution is probably just: h.keys & %i{first_name last_name phone}
[13:29:07] norc: yottanami_: though as roelof indicated make another private method and use strong params.
[13:29:18] universa1: yottanami_: attributes.all? {|k|order_parameters[k].present? }
[13:29:47] universa1: but then, looks more like a validation for the model, and not something for the controller.
[13:30:11] qejk: has joined #RubyOnRails
[13:30:37] sniff: has joined #RubyOnRails
[13:31:11] roelof: universa1: that is what I also mean. And then I think you can better use validates xxx , presence: true
[13:33:14] frem_: has joined #RubyOnRails
[13:33:15] dionysus69: has joined #RubyOnRails
[13:33:35] Oliphaunte: has joined #RubyOnRails
[13:35:10] yottanami1: roelof, API validation
[13:36:11] yottanami1: norc, Another private method for strong parameters? I have strong parameters now named `order_parameters`
[13:36:50] Oliphaunte: has joined #RubyOnRails
[13:38:03] arBmind: has joined #RubyOnRails
[13:39:11] nettoweb: has joined #RubyOnRails
[13:39:29] chintanparikh: has joined #RubyOnRails
[13:39:53] workmad3: yottanami_: you could do `params.require(order: [:first_name, :last_name, ...])`
[13:41:19] roamingdog: has joined #RubyOnRails
[13:41:43] jenrzzz: has joined #RubyOnRails
[13:41:43] jenrzzz: has joined #RubyOnRails
[13:42:28] blackmes1: has joined #RubyOnRails
[13:44:38] skroon: has joined #RubyOnRails
[13:45:35] yellow5: has joined #RubyOnRails
[13:46:02] jscheel: has joined #RubyOnRails
[13:46:21] roelof: workmad3: but does validation take place in a controller. I learned that it schould be in the model ?
[13:46:57] aegis3121: has joined #RubyOnRails
[13:47:39] workmad3: roelof: really depends on what sort of error you want to throw... i.e. is calling without those params a bad request (400) or a processing error (422)?
[13:48:04] marahin: http://hastebin.com/eyajunohuj.sm - my issue described right there, basicly an ActiveRecord question w/ polymorphic association and "how-to" OR in Rails 4
[13:48:08] workmad3: roelof: the answer to that changes whether it's more of an HTTP concern or more of a domain concern...
[13:48:23] roelof: oke, thanks for the explanation
[13:49:38] workmad3: roelof: btw, just using strong params means that some parameter validation is happening in your model too (params.require(:order) for example, along with defining permitted subkeys, is all various levels of validation) :)
[13:50:20] workmad3: it's just more on presence/absence of the parameter rather than more fine-grained detail
[13:51:51] roelof: oke, so I learn more and more about rails :) workmad3
[13:57:34] yellow5: has joined #RubyOnRails
[13:58:32] rikkipitt: has joined #RubyOnRails
[14:01:40] gingray: has joined #RubyOnRails
[14:05:17] snowy: has joined #RubyOnRails
[14:05:54] Cork: wow... impressive... 0.2.terabyte => 219902325555.2
[14:12:47] jtong: has joined #RubyOnRails
[14:12:47] rubyonrails655: has joined #RubyOnRails
[14:12:49] axl_: has joined #RubyOnRails
[14:13:02] PotatoChipz: has joined #RubyOnRails
[14:14:21] rubyonrails655: Is there a trick to using a variable in a active record query? I'm just trying to grab something using a variable and doesn't seem to want to work (@avatar = Player.select('players.avatar').where("battlenet = @gamesplayed") ).
[14:14:31] globalall0c: has joined #RubyOnRails
[14:14:41] universa1: rubyonrails655: !querying
[14:14:41] helpa: rubyonrails655: http://guides.rubyonrails.org/active_record_querying.html - ActiveRecord Querying Guide by Ryan Bigg
[14:15:13] Oliphaunte: has joined #RubyOnRails
[14:15:50] ebbflowgo: has joined #RubyOnRails
[14:16:11] roxycater: has joined #RubyOnRails
[14:16:51] odinsbane: has left #RubyOnRails: ()
[14:17:07] roxycater: Hello, I am attempting to send AJAX data to a controller and then show some data on the view they are currently on, but when I make the AJAX request, data never comes from the controller to the view
[14:17:16] dangerou_: has joined #RubyOnRails
[14:20:15] Dimik: has joined #RubyOnRails
[14:20:44] sypheren: has joined #RubyOnRails
[14:20:45] frojnd: so that's it for today
[14:21:07] frojnd: has left #RubyOnRails: ("need more testing")
[14:22:29] Cork: sevenseacat: rails byte unit calculations goes bonkers if you give it decimals
[14:22:53] yellow5: has joined #RubyOnRails
[14:22:57] Cork: 1.9.terabyte for example becomes 2089072092774.4 0.4 bytes??
[14:23:06] gfvcastro: has joined #RubyOnRails
[14:23:42] agent_white: has joined #RubyOnRails
[14:24:17] diegoviola: has joined #RubyOnRails
[14:25:33] rikkipitt: has joined #RubyOnRails
[14:26:45] universa1: Cork: well, 1.kilobyte, are 1024 bytes, so 0.1 kilobytes are what? 102 ? 103? 102.4 bytes? ;)
[14:27:20] Cork: ya, but you expect (.2).terrabyte to be ~ 204.gigabyte
[14:27:29] Cork: meaning a somewhat event byte number
[14:28:22] universa1: Cork: (0.2).terabyte / 205.gigabyte
[14:28:22] universa1: => 0.9990243902439025
[14:28:25] yellow5: has joined #RubyOnRails
[14:28:47] universa1: (0.2).terabyte / 204.8.gigabyte => 1 ;)
[14:28:54] chintanparikh: has joined #RubyOnRails
[14:29:53] jancel: has joined #RubyOnRails
[14:30:37] frojnd: has joined #RubyOnRails
[14:32:30] mdw: has joined #RubyOnRails
[14:33:14] prithaj: has joined #RubyOnRails
[14:33:14] mdw: has joined #RubyOnRails
[14:34:17] SolarSailor: has joined #RubyOnRails
[14:36:01] tjohnson: has joined #RubyOnRails
[14:37:25] mikecmpb_: has joined #RubyOnRails
[14:39:31] sk0r: has joined #RubyOnRails
[14:42:44] jenrzzz: has joined #RubyOnRails
[14:43:49] emilkarl: has joined #RubyOnRails
[14:46:12] polishdub: has joined #RubyOnRails
[14:47:22] kitsuneyo: has joined #RubyOnRails
[14:47:35] mooru: has joined #RubyOnRails
[14:47:48] kitsuneyo: how do i uninstall a single gem in terminal? i can't seem to do it with bundle so i guess it's something else?
[14:48:00] kitsuneyo: i tried googling already
[14:48:39] sevenseacat: kitsuneyo: `gem uninstall` :P
[14:49:20] sevenseacat: not sure how that wouldnt have turned up in a google search
[14:49:24] arBmind1: has joined #RubyOnRails
[14:49:28] emachnic: has joined #RubyOnRails
[14:49:36] kitsuneyo: all the results were about removing all gems
[14:49:49] kitsuneyo: thanks anyway :D
[14:50:24] emachnic: has joined #RubyOnRails
[14:51:22] mercerist: has joined #RubyOnRails
[14:52:55] jmignault: has joined #RubyOnRails
[14:53:29] pawnbox: has joined #RubyOnRails
[14:54:05] dionysus69: has joined #RubyOnRails
[14:57:55] adavia: has joined #RubyOnRails
[15:00:24] SolarSailor: has joined #RubyOnRails
[15:00:59] lalalaaa: has joined #RubyOnRails
[15:02:35] rueben: has joined #RubyOnRails
[15:04:14] fujinuma: has joined #RubyOnRails
[15:05:36] beneggett: has joined #RubyOnRails
[15:05:53] fujinuma: suggestion about motto. it'd be good if you drop "are nice" at the end of the phrase.
[15:06:07] jtong: has joined #RubyOnRails
[15:06:09] fujinuma: "Matz is good and so we are"
[15:06:22] fujinuma: that sounds better.
[15:06:37] fujinuma: s/good/nice/g
[15:07:47] fujinuma: how to test a before generating controller code?
[15:08:06] workmad3: fujinuma: that's not as memorable an acronym as MINASWAN though
[15:08:36] workmad3: fujinuma: also, you're about a decade too late to the discussion about community mottos :P
[15:09:06] fujinuma: fujinuma: yeah, it was just a suggestion. no worries :D
[15:09:17] fujinuma: workmad3: yeah, it was just a suggestion. no worries :D
[15:09:29] beneggett: has joined #RubyOnRails
[15:10:18] fujinuma: I want to test controllers before they actually exist.
[15:11:28] fujinuma: I mean, test if foo responses to bar.
[15:13:26] blackmes1: has joined #RubyOnRails
[15:13:40] roamingdog: has joined #RubyOnRails
[15:14:24] groatyoats: has joined #RubyOnRails
[15:15:00] kitsuneyo: has joined #RubyOnRails
[15:15:54] groatyoats: has joined #RubyOnRails
[15:16:13] disgrntld: has joined #RubyOnRails
[15:16:34] mikecmpbll: has joined #RubyOnRails
[15:19:04] rikkipitt: has joined #RubyOnRails
[15:21:40] skroon: I would like to have a glocal "application configuration" object, as an abstraction above ENV variables, because in production we want to get configuration settings from memcached for example... how would I best make this abstarction, inside the initializers?
[15:21:47] macsteps: has joined #RubyOnRails
[15:21:47] skroon: or perhaps there is already a
[15:22:31] roamingdog: has joined #RubyOnRails
[15:24:20] rikkipitt: has joined #RubyOnRails
[15:24:48] pawnbox: has joined #RubyOnRails
[15:27:30] SolarSailor: has joined #RubyOnRails
[15:27:33] prithaj: has joined #RubyOnRails
[15:28:24] crystal77: has joined #RubyOnRails
[15:30:59] jhack: has joined #RubyOnRails
[15:32:15] chintanparikh: has joined #RubyOnRails
[15:32:59] k3rn31: has joined #RubyOnRails
[15:33:18] cleopatras: has joined #RubyOnRails
[15:33:39] pawnbox: has joined #RubyOnRails
[15:35:14] PotatoChipz: what's the difference between a wrapper and an interface?
[15:37:22] PotatoChipz: Say, I have the twitter API, I laid out all the API calls…that I need and I’m calling it via a TwitterInterfaceHandler .. Am i calling in right? Or is this a wrapper? Are they the same?
[15:37:38] sloggerkhan: A wrapper is something you put around an object or interface to change how you interact with it. An interface is a specification for how an object behaves.
[15:37:42] alfiemax: has joined #RubyOnRails
[15:37:43] maximski: has joined #RubyOnRails
[15:38:25] banister: has joined #RubyOnRails
[15:39:37] deur-: potatochipz: in your example, your TwitterIntefaceHandler is a wrapper for the twitter API methods
[15:39:50] macsteps: has joined #RubyOnRails
[15:40:16] sloggerkhan: In ruby interfaces aren't Java style/IE don't exist formally, so it's more based around whether any given object can do what you expect.
[15:41:17] sloggerkhan: (Which you'd verify with tests, most likely.)
[15:41:22] PotatoChipz: hmm.. thank you. so if in my example, the handler is an interface. can you give me an example of a wrapper with respect to my example?
[15:41:40] PotatoChipz: wait, it's the other way around.
[15:41:57] PotatoChipz: so if in my example, the handler is a wrapper. can you give me an example of an interface with respect to my example?
[15:42:14] PotatoChipz: i just can't wrap my head around it. no pun intended.
[15:42:24] CrownBerry: has joined #RubyOnRails
[15:43:06] emilkarl: has joined #RubyOnRails
[15:44:11] ltd: has joined #RubyOnRails
[15:44:18] SeanLazer: has joined #RubyOnRails
[15:44:40] jenrzzz: has joined #RubyOnRails
[15:44:40] jenrzzz: has joined #RubyOnRails
[15:44:52] rafaelfranca: has joined #RubyOnRails
[15:44:52] rafaelfranca: has joined #RubyOnRails
[15:45:02] deur-: potatochipz: sticking to ruby and your example, an interface could be a module that defines a certain set of methods and their params. but as SloggerKhan said, interfaces do not formally exist in ruby
[15:45:17] deur-: i believe in languages like java an interface can't even have function bodies
[15:45:24] deur-: just declarations of functions
[15:47:05] gfvcastro: has joined #RubyOnRails
[15:47:06] sloggerkhan: Well, a simple example would be a test case that gets passed arbitrary objects and checks if they `can_bark?`by trying to call the `bark` method on said object and verifying a reasonable return value. Potentially any object could bark. But all could be said to implement some kind of "interface" that defines the method `bark`. Only it's the test defining the interface in this circumstance.
[15:47:56] sloggerkhan: As deur- said in languages with formal interfaces they're a collection of method signatures that are left to be implemented by the implementing classes.
[15:48:03] solars: has joined #RubyOnRails
[15:48:17] PotatoChipz: hmm sounds just like a simple service object then?
[15:48:25] PotatoChipz: in Ruby are these just service objects?
[15:49:29] artto: has joined #RubyOnRails
[15:49:46] sloggerkhan: Not really. Interfaces are mostly a way of making sure method signatures that need to be compatible with each other are. It doesn't really have anything to do with the role or kind of objects involved.
[15:51:56] AdamOnRails: Is it a good practice to save a user object in a session (that includes email/bcrypt password combo among the attributes), or is it better to just store the user ID in the session?
[15:52:05] sloggerkhan: It's a form a polymorphism that doesn't bind as tightly as inheritance is maybe another way to put it.
[15:52:28] AdamOnRails: Seems to me that it would be a poor practice to have password details stored in a session, but I was just reading a tutorial ad thats what they've done.
[15:52:57] chintanparikh: has joined #RubyOnRails
[15:53:26] PotatoChipz: I see then. looks like it has something to do with ruby being dynamically typed or something. perhaps the reason why interfaces are more likely involved in Java..idk. maybe im saying nonsense here.
[15:53:31] PotatoChipz: anyway thank you for answering
[15:55:08] deur-: adamonrails: I think you answered your own question there :-) it's probably mostly harmless, but I'd never do it for the reason you mentioned.
[15:55:41] AdamOnRails: Yeah thought so. Cheers for the reassurance :)
[15:56:04] sloggerkhan: potatochipz: They mostly aren't involved in ruby because ruby prefers duck typing.
[15:56:37] jgt1: has joined #RubyOnRails
[15:58:08] deur-: SloggerKhan: btw, that's probably the best explanation of an interface i've seen so far (re: spec for how an object behaves)
[15:59:24] davidw: has joined #RubyOnRails
[15:59:36] kies: has joined #RubyOnRails
[15:59:49] snowy: has joined #RubyOnRails
[16:00:05] zave: has joined #RubyOnRails
[16:01:38] mooru_: has joined #RubyOnRails
[16:02:22] yardenbar: has joined #RubyOnRails
[16:04:34] maucar: has joined #RubyOnRails
[16:07:03] eGGshke: has joined #RubyOnRails
[16:09:33] GodFather: has joined #RubyOnRails
[16:10:07] conta: has joined #RubyOnRails
[16:10:09] arBmind: has joined #RubyOnRails
[16:12:26] Ergo: has joined #RubyOnRails
[16:12:39] kk30kv0of0: has joined #RubyOnRails
[16:13:00] kk30kv0of0: what is the best way to make a where query when some of the params might not be present always?
[16:13:28] cpruitt: has joined #RubyOnRails
[16:13:48] tbuehlmann: kk30kv0of0: what about having a scope for each, checking for presence?
[16:14:17] crystal77: has joined #RubyOnRails
[16:14:20] kk30kv0of0: yeah thanks I was going down that way already but it seemed verbose ;)
[16:15:11] chintanparikh: has joined #RubyOnRails
[16:16:06] GodFather: has joined #RubyOnRails
[16:16:12] [Butch]: has joined #RubyOnRails
[16:16:59] xall_: has joined #RubyOnRails
[16:17:18] chintanparikh: has joined #RubyOnRails
[16:18:03] jancel: has joined #RubyOnRails
[16:18:41] adam12: kk30kv0of0: Dont' forget you can chain them. @products = Product.all; @products = @products.with_size(params[:size]) if params[:size]
[16:19:15] kk30kv0of0: thanks i like that
[16:20:38] tbuehlmann: or just chain the scopes without the if
[16:20:48] arBmind1: has joined #RubyOnRails
[16:21:17] gzn: has joined #RubyOnRails
[16:25:00] diegoaguilar: has joined #RubyOnRails
[16:25:51] borodin: has joined #RubyOnRails
[16:26:08] jgt: has joined #RubyOnRails
[16:26:30] fermonkus: has joined #RubyOnRails
[16:27:03] roamingdog: has joined #RubyOnRails
[16:28:54] eserror: has joined #RubyOnRails
[16:29:25] Cache_Money: has joined #RubyOnRails
[16:29:32] moeabdol: has joined #RubyOnRails
[16:32:01] arBmind: has joined #RubyOnRails
[16:33:15] oystersauce8: has joined #RubyOnRails
[16:34:54] kitsuneyo: how to switch off turbolinks for a specific layout in haml, since you can't quite do <body data-no-turbolinks> ??
[16:35:40] kitsuneyo: found this but doesn't seem great: http://stackoverflow.com/questions/25361775/disable-turbolink-in-a-specific-rails-page-with-haml
[16:36:19] oystersauce8: has joined #RubyOnRails
[16:36:23] GodFather: has joined #RubyOnRails
[16:39:07] gfvcastro: has joined #RubyOnRails
[16:39:20] oystersauce8: has joined #RubyOnRails
[16:40:20] macsteps: has joined #RubyOnRails
[16:44:18] manfrin: has joined #RubyOnRails
[16:44:45] oystersauce8: has joined #RubyOnRails
[16:45:23] jenrzzz: has joined #RubyOnRails
[16:46:51] oystersauce8: has joined #RubyOnRails
[16:47:24] dmz: has joined #RubyOnRails
[16:48:34] mooru: has joined #RubyOnRails
[16:49:25] braincrash: has joined #RubyOnRails
[16:52:01] adac: has joined #RubyOnRails
[16:52:47] CrownBerry: has joined #RubyOnRails
[16:54:06] oystersauce8: has joined #RubyOnRails
[16:55:09] banister: has joined #RubyOnRails
[16:58:08] aegis3121: has joined #RubyOnRails
[17:00:19] rueben: has joined #RubyOnRails
[17:01:12] haaj: has joined #RubyOnRails
[17:01:33] darkxploit: has joined #RubyOnRails
[17:03:26] oystersauce8: has joined #RubyOnRails
[17:05:58] oystersauce8: has joined #RubyOnRails
[17:06:17] oystersauce8: has joined #RubyOnRails
[17:06:56] braincrash: has joined #RubyOnRails
[17:07:49] shinnya: has joined #RubyOnRails
[17:08:43] artto: has joined #RubyOnRails
[17:09:06] chintanparikh: has joined #RubyOnRails
[17:09:59] am55: has joined #RubyOnRails
[17:13:08] smathy: has joined #RubyOnRails
[17:14:55] scott_o: has joined #RubyOnRails
[17:15:01] mikecmpbll: has joined #RubyOnRails
[17:17:11] scott_o: I'm getting this error 'URI::InvalidURIError - bad URI(is not URI?): file-digest:///Users/scott/Google Drive/projects/expense-tracker/app/assets/images/letter_opener_web:', I think I'm getting it because my path has a space in it, but I can't seem to find a good solution
[17:17:33] scott_o: letter_opener_web doesn't seem to be doing any uri encoding, and I'm not either, so not sure what to fix
[17:19:56] scott_o: here's the full stack trace https://gist.github.com/scottopell/5da5b197f52a5cc437077f389bcad7d0
[17:20:21] Macaveli: has joined #RubyOnRails
[17:25:01] rikkipitt: has joined #RubyOnRails
[17:25:15] workmad3: scott_o: yeah, that space will need to be URI encoded
[17:26:32] scott_o: workmad3: agreed, but I'm not doing any explicit URI encoding. From the stack trace it looks like its coming from inside sprockets. So is this a bug in sprockets? (unlikely)
[17:28:02] macsteps: has joined #RubyOnRails
[17:28:17] scott_o: Huh. I just cleared my local development cache and that did it. I guess the last time I ran this app it was from a diff location, so that must have screwed sprockets up
[17:30:01] DTZUBDUB: has joined #RubyOnRails
[17:35:08] eGGshke: has joined #RubyOnRails
[17:35:30] mdw: Hey people
[17:35:35] mdw: I'm building a hybrid app
[17:35:45] mdw: I've been looking at Turbolinks 5
[17:35:57] mdw: I was wondering if this might be possible
[17:36:11] mdw: login the app with normal session based auth on iOS
[17:36:35] mdw: on a particular page, I want to start coding 'native' iOS elements
[17:36:53] mdw: on that page, I want to consome JSON api requests
[17:37:11] mdw: consume*
[17:37:24] mdw: though, part of it will be also using the web view to render the content
[17:37:54] mdw: I was thinking, in this case, would my app need to support a dual set of authentication methods?
[17:38:02] mdw: both session based and maybe jwt token based?
[17:38:32] zave: has joined #RubyOnRails
[17:38:45] mdw: I also need the app to persist its login state for a long time
[17:39:00] mdw: so, is it acceptable to turn off session expiry?
[17:40:04] mdw: would be interesting to know how basecamp app handles that
[17:41:11] Markhor1991: has joined #RubyOnRails
[17:41:33] Coldblackice: has joined #RubyOnRails
[17:42:11] adac: has joined #RubyOnRails
[17:42:19] barbaroskurt: has joined #RubyOnRails
[17:42:48] jetpackjoe: has joined #RubyOnRails
[17:42:55] eserror_: has joined #RubyOnRails
[17:42:59] AdamOnRails: I am trying to do.... redirect_to controller: "primary_dashboard", action: "index"
[17:43:01] barbaroskurt: has left #RubyOnRails: ()
[17:43:07] AdamOnRails: But I am getting a "no route matches" exception
[17:43:28] AdamOnRails: get 'primary_dashboard/index'
[17:43:32] AdamOnRails: is in my routes...
[17:43:35] AdamOnRails: what am I missing?
[17:43:39] replay: has joined #RubyOnRails
[17:43:54] artto: has joined #RubyOnRails
[17:46:06] dionysus69: has joined #RubyOnRails
[17:46:08] Cache_Money: has joined #RubyOnRails
[17:46:10] jenrzzz: has joined #RubyOnRails
[17:46:10] jenrzzz: has joined #RubyOnRails
[17:46:12] DoctorMonocular: has joined #RubyOnRails
[17:49:43] AdamOnRails: nvm all sorted
[17:52:09] xall: has joined #RubyOnRails
[17:53:18] djbkd: has joined #RubyOnRails
[17:54:38] arBmind: has joined #RubyOnRails
[17:55:28] adre: has joined #RubyOnRails
[17:55:47] paulca: has joined #RubyOnRails
[17:59:15] blackmes1: has joined #RubyOnRails
[18:00:54] superuserdo: has joined #RubyOnRails
[18:01:08] oystersauce8: has joined #RubyOnRails
[18:01:41] frojnd: has joined #RubyOnRails
[18:02:24] Jon30: Has anyone used Thinking Sphinx Gem? What's a good practice to keep it up and running and automatically restart in case it crashes for w/e reason?
[18:02:47] superuserdo: Hello guys, I'm attempting to send an AJAX request from my javascript to my backend rails app, which will then send a HTTParty request which returns JSON, and then that JSON is then displayed on the page. Right now I'm getting a 500 error when attempting to POST to a certain endpoint. If you need to see some code I'll create a gist if needed
[18:07:29] guidocalvano: has joined #RubyOnRails
[18:07:47] CrownBerry: has joined #RubyOnRails
[18:09:11] CrownBerry: has left #RubyOnRails: ()
[18:09:35] adam12: superuserdo: 500 is likely an exception. Need that + code that exception refers to.
[18:10:19] codelahoma: has joined #RubyOnRails
[18:10:42] Oliphaunte: has joined #RubyOnRails
[18:11:27] roamingdog: has joined #RubyOnRails
[18:12:07] eserror: has joined #RubyOnRails
[18:12:17] AmiMoench: has joined #RubyOnRails
[18:12:36] artto_: has joined #RubyOnRails
[18:13:13] macsteps: has joined #RubyOnRails
[18:13:37] davidw: has joined #RubyOnRails
[18:13:46] superuserdo: I fixed the 500 error, by doing render :nothing => true, :status => :ok but it is still not setting the @response variable in the HTTParty post. I know this because when I console.log the variable it shows an empty string when it should be json https://gist.github.com/terrabl/ffe7396b90480dfdb9b9fce07fc6f83b Here is a gist of what I think should matter, if you have any questions just ask
[18:14:31] Pumukel: has joined #RubyOnRails
[18:14:47] adam12: Which action is it hitting? gametitle?
[18:14:53] adam12: rather, gametitle_post?
[18:15:07] superuserdo: yeah gametitle_post
[18:15:14] adam12: Are you expecting JSON back?
[18:15:56] superuserdo: so what I want to happen is when they stop_typing in a certain text box it makes a ajax request to that endpoint which makes an HTTParty request to get a JSON object and then that JSON object gets output on the screen
[18:16:04] superuserdo: Yes it should be returning JSON
[18:16:39] adam12: superuserdo: Instead of rendering nothing, how about `render json: @response` or even `render json: @response.body`
[18:17:23] adam12: or `render text: @response.body`. I am not sure what the response body includes, so you'll likely have to figure that out.
[18:18:17] superuserdo: What does that render do? I thought I could access the instance variable in the .html.erb file
[18:19:00] adam12: superuserdo: Sorry - I didn't see the html.erb file for that action. Was there one?
[18:19:48] superuserdo: Not specifically for that action. I want to just update the _form.html.erb with the data inside of the response
[18:20:21] adam12: superuserdo: Well the form is rendered by one of your other actions, not by the gametitle post.
[18:20:32] adam12: You likely want to render json or text like I demonstrated.
[18:20:34] evansbee: has joined #RubyOnRails
[18:20:41] adam12: OR re-render and replace the entire form, but that's clunky.
[18:20:58] superuserdo: yeah because if they inputted things already wouldnt they disappear?
[18:21:06] adam12: superuserdo: You can't access the instance variable because the form was already rendered in a different request.
[18:21:24] adam12: superuserdo: You'd have to pass the entire form as it's been inputted, and then re-render it in it's partial state.
[18:21:45] superuserdo: that's if I want to use the instance variable?
[18:22:02] superuserdo: and my other option is using render json/text: @response.body?
[18:22:08] eserror: has joined #RubyOnRails
[18:22:08] ych: has joined #RubyOnRails
[18:22:11] superuserdo: How do I get that to output on the page?
[18:22:29] adam12: superuserdo: Get which?
[18:22:58] adam12: superuserdo: What did you want outputted to page?
[18:23:13] superuserdo: I want the @response.body to be output to the page
[18:23:16] ankhers: has joined #RubyOnRails
[18:23:27] adam12: superuserdo: You want to append it to #myInput, ya?
[18:23:33] ltd: has joined #RubyOnRails
[18:23:47] adam12: What's the result from the HTTPParty request? Plain text or JSON?
[18:24:11] adam12: Any idea what it looks like? does it have a 'message' key?
[18:24:21] superuserdo: yeah one second let me get it
[18:25:50] superuserdo: I updated the gist with it
[18:26:02] superuserdo: What I care about is the hostnames
[18:27:01] adam12: superuserdo: I've updated a forked gist with my suggested changes. https://gist.github.com/adam12/51322532939b06ed02490e36a3876bf6
[18:27:20] adam12: lines 34+37 in the JS, 18 in the controller.
[18:27:27] adam12: Assuming your jQuery is correct.
[18:28:00] adam12: Your message is an array of objects, so you'll have to manipulate it a bit more in your JS, or return it differently from your controller. Your choice.
[18:28:14] rickmasta: has joined #RubyOnRails
[18:28:46] superuserdo: adam12: will you marry me?
[18:28:54] adam12: superuserdo: get in line
[18:29:13] superuserdo: adam12: thank you so much man.
[18:29:18] adam12: superuserdo: yw.
[18:29:55] blackmes1: has joined #RubyOnRails
[18:30:28] emiltin: has joined #RubyOnRails
[18:30:32] jpterry: has joined #RubyOnRails
[18:30:42] aegis3121: has joined #RubyOnRails
[18:33:50] emiltin: has joined #RubyOnRails
[18:36:26] chrissonar: has joined #RubyOnRails
[18:36:39] gfvcastro: has joined #RubyOnRails
[18:36:48] pumpkindice: has joined #RubyOnRails
[18:39:30] blackmes1: has joined #RubyOnRails
[18:39:38] pumpkindice: I have this bit of backend code: http://pastebin.com/nvGHRp5Y can I raise an error and set the HTTP code on it?
[18:39:52] pumpkindice: Oops sorry for using pastebin
[18:40:13] pumpkindice: http://pastie.org/10884412
[18:40:39] lalalaaa: Based on http://www.rubydoc.info/gems/tweetstream/TweetStream/Client -- how would'd I go about ignoring retweets? https://gist.github.com/anonymous/8d1b34e04a1d011d5bc250cbe4e7b896
[18:41:21] skroon: is there a way to keep configuration keys global somewhere in rails app?
[18:41:37] lalalaaa: skroon: config/settings.yml I think
[18:41:41] pumpkindice: That search query from Elasticsearch returns a 500, but the new error I raise I want it to be set to 50X so I can print the appropriate error message in my frontend code
[18:42:02] lalalaaa: skroon: config/secrets.rb
[18:42:21] Leepoff: has joined #RubyOnRails
[18:42:45] cnk: has joined #RubyOnRails
[18:43:28] skroon: lalalaaa: ahh cool config/secrets.rb so then I can make it executable code that checks for the settings... I want to check database (key/value) for config settings first, if that doesn't exist then ENV var, and if that fails have a default
[18:44:02] pumpkindice: lalalaaa: there doesn't seem to be a way to get parent tweets in that client? Otherwise I'd say use a .reject
[18:44:12] lalalaaa: skroon: sounds like you want .apikeys maybe? I got both =)
[18:44:36] lalalaaa: pumpkindice: Hi!
[18:45:06] pumpkindice: lalalaaa: hello!
[18:45:14] chintanparikh: skroon: Why not always use ENV vars and use something like Figaro in development to automatically turn a key/val into ENV vars
[18:45:49] skroon: chintanparikh: because I can't use ENV vars in my production env
[18:46:16] chintanparikh: skroon: Ah I see
[18:46:18] skroon: lalalaaa: .apikeys is that a gem, or some kind of standard?
[18:46:24] jancel: has joined #RubyOnRails
[18:46:30] pumpkindice: lalalaa: I know the twitter api has a retweeted_count
[18:46:43] moeabdol: has joined #RubyOnRails
[18:46:54] jenrzzz: has joined #RubyOnRails
[18:46:55] pumpkindice: actually there's a retweeted:bool too
[18:47:20] smathy: pumpkindice, all un-rescued exceptions in your code will generate a 500. See more here: http://guides.rubyonrails.org/action_controller_overview.html#rescue
[18:48:32] skroon: lalalaaa: is there a way to figure out when config/secrets.rb is getting loaded? because I also want to set my mysql database password this way
[18:48:33] Coldblackice: has joined #RubyOnRails
[18:49:10] gusrub: has joined #RubyOnRails
[18:49:15] bookies: has left #RubyOnRails: ()
[18:49:18] lalalaaa: skroon: Nevermind the .apikeys thing it's just what I use to store env variables read by both pg and node
[18:49:36] lalalaaa: pumpkindice: Sounds awesome let me check it out !!
[18:50:14] srinidhi: has joined #RubyOnRails
[18:50:29] pumpkindice: lalalaaa: in your case might be something like "unless status.retweeted"
[18:51:07] jancel: has left #RubyOnRails: ()
[18:51:16] skroon: lalalaaa: do you perhaps know if it's possible for the password in database.yml to be executable ruby code?
[18:51:59] scott_o: has joined #RubyOnRails
[18:52:19] oystersauce8: has joined #RubyOnRails
[18:52:20] smathy: skroon, yes, you can have ERB in your database.yml
[18:53:40] lalalaaa: pumpkindice: ooooh sweet thanks man =)
[18:53:56] lalalaaa: skroon: i don't know
[18:54:07] edwinvdgraaf: has joined #RubyOnRails
[18:54:29] oystersauce8: has joined #RubyOnRails
[18:54:43] lalalaaa: ACTION Slum Village - I Don't Know - https://www.youtube.com/watch?v=rXd5ZXTjStA
[18:54:48] xall_: has joined #RubyOnRails
[18:55:06] lalalaaa: pumpkindice: almost there =) =)
[18:56:59] mooru_: has joined #RubyOnRails
[18:58:22] mikecmpbll: has joined #RubyOnRails
[18:58:41] lalalaaa: pumpkindice: thanks again, not sure if it works yet because nobody's tweeted yet lol
[18:58:50] skroon: smathy: oke great, than this can probably use my AppConfiguration library
[18:58:50] lalalaaa: Tomorrow morning though I'm sure
[18:59:05] lalalaaa: Cheers bro'
[19:00:24] mustmodify: has joined #RubyOnRails
[19:00:25] oystersauce8: has joined #RubyOnRails
[19:00:58] mustmodify: I have multiple sites for the same client and I want to have a single sign-on apply to all of them. It must be possible -- google does it. How does that work?
[19:01:14] mustmodify: or can someone just give me the correct google term? :)
[19:01:32] mustmodify: I kind of assume SSO will be some kind of enterprisey rabbit hole of pointlessness.
[19:01:33] adam12: Build your own OAuth provider and then use OAuth clients in all the apps
[19:01:35] jgt: has joined #RubyOnRails
[19:01:50] adam12: Doorkeeper + OmniAuth maybe.
[19:02:22] mustmodify: adam12: Well ... seems like oauth requires you to give permission and Google doesn't need permission from itself to do that, right? I mean, if you sign in to gmail, you don't then have to give permission to another google app?
[19:02:24] adam12: You can modify the OAuth to not require verification (2 leg auth vs 3 leg auth)
[19:02:37] lalalaaa: Do you guys allow email accounts or just enforce facebook and google? It's easier that way right?
[19:02:40] mustmodify: ok thanks. That does not sound like fun.
[19:02:55] adam12: mustmodify: Doorkeeper is pretty awesome, but it's a bit of work. Definitely doable.
[19:03:16] adam12: and you just build your own OmniAuth provider. Easy enough.
[19:03:22] pumpkindice: lalalaaa: hah, no worries. You could also do something like this: http://pastie.org/10884453 using reject but I'm not actually sure if that will work with the streaming api
[19:03:35] pumpkindice: but in general I like doing that, feels cleaner... mostly opinion though :P
[19:03:42] mustmodify: ok thanks for the suggestions. I'll check 'em out.
[19:04:22] norc: has joined #RubyOnRails
[19:04:27] lalalaaa: pumpkindice: cool, I was on https://gist.github.com/anonymous/c87474f25d5ba9c604207b381c9c4d26
[19:04:40] dionysus69: I have a minor misbehavior in app, when i update a record it changes position in api. for example I have 3 records and I update first one, it becomes the last one. how can I update it in place?
[19:04:59] pumpkindice: lalalaaa: yeah looks good. You're missing a | at the end of status though ;(
[19:05:01] lalalaaa: yours is simpler no doubt
[19:05:03] adam12: dionysus69: Is it ordering by `updated_at` field?
[19:05:16] dionysus69: adam12: good point, that is the case I assume
[19:05:52] adam12: dionysus69: My guess is that's the case, in which I would update the ordering to something more appropriate.
[19:05:57] dionysus69: but I never discretely ordered it by anything so updated_at should be a default setup
[19:06:08] adam12: Unless you want to not update that timestamp ... which I wouldn't recommend tbh.
[19:06:48] dionysus69: ok thanks I ll look into how I can order it by primary key :)
[19:10:59] banister: has joined #RubyOnRails
[19:11:32] lalalaaa: pumpkindice: like unless.status |do|?
[19:12:21] crystal77: has joined #RubyOnRails
[19:12:26] lalalaaa: probably the silliest question of the day
[19:13:05] dionysus69: adam12: this did it in index action )) @news = News.all.sort_by {|obj| obj.created_at }.reverse
[19:13:47] banister: has joined #RubyOnRails
[19:14:25] desnudopenguino: has joined #RubyOnRails
[19:15:17] nickenchuggets: has joined #RubyOnRails
[19:15:17] nickenchuggets: has joined #RubyOnRails
[19:16:13] skroon: in production mode, do I have to restart the server, when I change the database password? or is there perhaps a way to store the database password somewhere else (not in the database.yml) so it will be read again when it fails to connect?
[19:16:16] djbkd: has joined #RubyOnRails
[19:16:22] adam12: dionysus69: Add a scope to News where you order by created_at DESC
[19:16:42] adam12: dionysus69: scope :oldest_first, ->{ order(created_at: :desc) }
[19:16:47] adam12: @news = News.oldest_first
[19:17:05] desnudopenguino: skroon: set it as an environment variable, and change it in cli, export DBPW="somedbpassword"
[19:17:06] dionysus69: skroon: you shouldnt store db password in database.yml anyways for production. I think you should save it in ENV variables
[19:18:00] dionysus69: adam12: will try that thanks xD
[19:18:17] manfrin: has joined #RubyOnRails
[19:18:45] adam12: dionysus69: Your solution is fine but over eager. You're creating a bunch of objects early, and then re-ordering them, potentially creating N+1 more objects (I'm not familiar with sort_by implementation so just spitballing).
[19:18:50] pumpkindice: lalalaaa: there are no silly questions :) like this: http://pastie.org/10884453
[19:19:15] dionysus69: adam12: ye your sounds more efficient anyways, its easier to change later too
[19:19:17] oystersauce8: has joined #RubyOnRails
[19:19:51] desnudopenguino: i'm running into a strange/annoying issue, I am running a debian DigitalOcean droplet, trying to generate a new model, and keep getting a bug "/var/lib/gems/1.9.1/gems/spring-1.3.6/lib/spring/application.rb:156: in `fork': Cannot allocate memory"
[19:20:25] apotry: has joined #RubyOnRails
[19:21:21] serbalgi: has joined #RubyOnRails
[19:23:13] oystersauce8: has joined #RubyOnRails
[19:27:55] roamingdog: has joined #RubyOnRails
[19:29:03] cnk: what does `top` say about your memory usage?
[19:30:54] chintanparikh: has joined #RubyOnRails
[19:31:38] mustmodify: has left #RubyOnRails: ()
[19:32:51] desnudopenguino: it is pretty much maxed apparently. lol
[19:33:11] desnudopenguino: i just killed the server I am working with, and it worked
[19:33:20] desnudopenguino: killed the server instance that is
[19:33:44] djbkd: has joined #RubyOnRails
[19:34:06] smathy: skroon, why are you concerned about restarting?
[19:34:10] mshowman: has joined #RubyOnRails
[19:35:27] adam12: desnudopenguino: Old ruby version FYI. Are you doing dev on this DO instance?
[19:36:43] desnudopenguino: adam12: yes. I am contemplating dumping and moving to vultr though, because I work in OpenBSD more, and DO doesn't support that
[19:36:58] chintanparikh: has joined #RubyOnRails
[19:37:28] smathy: Was that an explanation for using such an old version of Ruby?
[19:37:29] mooru: has joined #RubyOnRails
[19:37:31] adam12: What version of rails? if you are doing dev work on these instances, you should look at using a ruby version manager and running 2.x. Lots of memory improvements to gain.
[19:37:53] norc: desnudopenguino, either you are genuinely out of memory, your code is leaking objects, or its just a really old bug that was fixed years ago.
[19:38:09] norc: desnudopenguino, without actually profiling it's hard to tell which.
[19:38:23] pawnbox: has joined #RubyOnRails
[19:38:54] desnudopenguino: no big deal, I'll figure it out, if it is something outside of RoR, which it probably is
[19:39:22] desnudopenguino: it looks like spring and thin are eating up the ram
[19:39:40] norc: desnudopenguino, sadly the only ruby profiler for 1.9 that Im aware of requires 1.9.3 at least.
[19:39:47] meoblast001: has joined #RubyOnRails
[19:40:02] desnudopenguino: I'll probably just update/upgrade everythnig and move forward from there
[19:40:50] norc: desnudopenguino, get it to 2.1 at the very least if you can, 2.3 would be much preferrable.
[19:41:38] mikecmpbll: has joined #RubyOnRails
[19:41:41] smathy: ...regardless, it's your app or #instances which will be consuming the RAM.
[19:43:28] DTZUBDUB: has joined #RubyOnRails
[19:44:57] bbrowning_away: has joined #RubyOnRails
[19:46:54] jhass: can I let Rails set a connection timezone for postgresql? (SET TIME ZONE)
[19:47:29] moeabdol: has joined #RubyOnRails
[19:47:41] jenrzzz: has joined #RubyOnRails
[19:47:41] jenrzzz: has joined #RubyOnRails
[19:49:17] srinidhi: has joined #RubyOnRails
[19:49:55] skroon: Rails.cache is that only for activerecord stuff, or can I also use it to lookup keys in memcahed? or perhaps use dalli.get it self?
[19:50:38] adam12: You can use it for whatever.
[19:50:52] adam12: I sometimes stick results from API calls in it, like a recent tweet.
[19:51:05] adam12: Or maybe I am misunderstanding you...
[19:52:13] Spami: has joined #RubyOnRails
[19:53:57] ur5us: has joined #RubyOnRails
[19:54:08] smathy: jhass, you can, not sure if you'll want to.
[19:55:09] jhass: I want at least temporarily, the postgresql master started as the host had the wrong timezone and I don't want to restart it atm
[19:56:39] norc: jhass, change it in your application and force a reconnect on all sessions?
[19:56:58] chintanparikh: has joined #RubyOnRails
[19:57:00] jhass: that's what I'm trying to do?
[19:57:52] moei: has joined #RubyOnRails
[19:57:53] paulca: has joined #RubyOnRails
[19:58:30] hahuang62: has joined #RubyOnRails
[20:00:03] jhass: okay there's "variables" in http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter.html
[20:00:19] jhass: adding that to database.yml, Rails generates SET SESSION TIME ZONE TO 'UTC'
[20:00:23] jhass: the TO is invalid
[20:00:31] norc: jhass, https://github.com/rails/rails/blob/master/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L699-L703
[20:00:33] jhass: in this case
[20:01:00] jhass: ah, interesting
[20:01:21] jhass: can I set that from database.yml somehow?
[20:01:56] norc: jhass, don't think so. There is no code to set this instance_variable explicitly.
[20:02:08] Oliphaunte: has joined #RubyOnRails
[20:02:11] jhass: thanks anyway
[20:02:21] norc: jhass, well you can simply break into the class and do it by hand obviously.
[20:02:43] zmd: has joined #RubyOnRails
[20:02:47] jhass: yeah I think I'll just add a uncommitted initializer for now
[20:02:48] norc: (just call instance_variable_set on the adapter in an initializer)
[20:04:13] DoctorMonocular: has joined #RubyOnRails
[20:04:29] rubyonrails713: has joined #RubyOnRails
[20:04:44] dmz: has joined #RubyOnRails
[20:05:03] jhass: https://github.com/rails/rails/blob/master/activerecord/lib/active_record/core.rb#L60 weird, it should already set it to utc?
[20:06:42] norc: jhass, from the looks of it yeah
[20:07:17] rubyonrails713: Posted a question regarding ways to test HTTParty using Rspec on SO: http://stackoverflow.com/questions/37929738/unexpected-arguments-using-rspec-to-mock-httparty-request, if you guys could take a look, I'd really appreciate it
[20:07:37] jhass: then my issue must be somewhere else :/
[20:08:19] yfeldblum: has joined #RubyOnRails
[20:08:43] norc: jhass, byebug into the postgresql adapter (configure_connection seems like a good start) Id say
[20:09:10] jhass: nah, nvm it is somewhere else, I'm just not sure where yet
[20:09:18] mshowman_: has joined #RubyOnRails
[20:12:35] zave: has joined #RubyOnRails
[20:15:18] gfvcastro: has joined #RubyOnRails
[20:16:41] yardenbar: has joined #RubyOnRails
[20:17:30] ebbflowgo: has joined #RubyOnRails
[20:19:01] moeabdol: has joined #RubyOnRails
[20:19:10] roamingdog: has joined #RubyOnRails
[20:19:20] smathy: cleopatra, ?
[20:20:31] roamingdog: has joined #RubyOnRails
[20:21:55] arup_r: has joined #RubyOnRails
[20:22:41] Darmani: has joined #RubyOnRails
[20:23:02] Macaveli: has joined #RubyOnRails
[20:24:14] roamingd_: has joined #RubyOnRails
[20:24:18] Leepoff: has joined #RubyOnRails
[20:26:22] triptec: has joined #RubyOnRails
[20:27:24] roamingdog: has joined #RubyOnRails
[20:27:35] davidw: Hi, I'm looking into some slowness on a 4.1.14 app: <%= render 'layouts/mygem/navbar' %> is slowing everything way down. Happens both in development, where I was able to strace lots of hunting around for various partials all through the gems, as well as production
[20:29:33] davidw: commenting that speeds up the whole operation by about a second
[20:30:26] norc: davidw, use rack-mini-profiler with stackprof
[20:30:48] norc: (flamegraph is a nice starter to visualize the results)
[20:31:21] norc: davidw, also note that profiling on development is not a wise idea since a lot of things work differently there.
[20:31:44] Oliphaunte: has joined #RubyOnRails
[20:31:55] eserror_: has joined #RubyOnRails
[20:32:03] davidw: norc, yeah, that's why I looked on production too to confirm what I was seeing
[20:32:25] norc: davidw, also use the profiler from your browsers developer tools
[20:32:55] norc: davidw, there are various things that can have a great impact from css bizarreness, slow loading assets, buggy or generally slow JavaScript code.
[20:33:04] davidw: yep, been doing that too... but it's the initial html page load that I'm zeroing in on.... that's like 1.3 seconds, which is too slow as it is, without adding all the JS and other stuff on top of it
[20:33:14] norc: davidw, pure load time?
[20:34:08] emachnic_: has joined #RubyOnRails
[20:34:13] norc: davidw, also rails can tell you how much time it spends in views and activerecord in its logs in
[20:34:29] norc: davidw, that should give you enough points to do cover your basics.
[20:34:38] davidw: Yeah, I can 'time' curl with just the initial HTML thing, and it's 1+ seconds. Drops to 0.3 just by commenting that render
[20:34:46] jtong: has joined #RubyOnRails
[20:34:53] davidw: I was curious if 'render + gem + slow' rang any bells for people
[20:34:59] norc: davidw, plug in rack-mini-profiler with stackprof and flamegraph please.
[20:35:14] norc: davidw, even if it did - profile it yourself since a profiler is better than guesswork.
[20:35:26] norc: It will tell you precisely which part of the code is the offending bit.
[20:35:27] dionysus69: has joined #RubyOnRails
[20:40:10] rickmasta: has joined #RubyOnRails
[20:41:28] evansbee: has joined #RubyOnRails
[20:41:32] rafaelfr_: has joined #RubyOnRails
[20:41:56] triptec: has joined #RubyOnRails
[20:43:36] diegoaguilar: has joined #RubyOnRails
[20:43:39] jtong: has joined #RubyOnRails
[20:43:57] smathy: davidw, no, it won't be anything generic like that, it'll be something specific you're doing (or some gem's code is doing). A common one for some nav views is authorization checks if you're doing that on a per link basis.
[20:44:10] davidw: yeah, that might be it
[20:44:48] smathy: ...solution might be to cache each role or user's nav partial.
[20:45:53] oystersauce8: has joined #RubyOnRails
[20:46:04] siaw23: i’ll appreciate some help http://stackoverflow.com/questions/37931514/shoulda-matchers-not-recognized-by-rspec
[20:47:18] jgt: has joined #RubyOnRails
[20:48:25] jenrzzz: has joined #RubyOnRails
[20:48:49] manfrin_: has joined #RubyOnRails
[20:56:36] nickenchuggets: has joined #RubyOnRails
[20:57:29] cnk: siaw23: do shoulda matchers work in other tests? that are not shared examples / included in some other test?
[20:57:51] solars: has joined #RubyOnRails
[20:59:10] lalalaaa: pumpindice man
[20:59:24] lalalaaa: pumpkindice man
[20:59:50] beneggett: has joined #RubyOnRails
[21:03:01] yellow5: has joined #RubyOnRails
[21:05:06] yfeldblum: has joined #RubyOnRails
[21:06:51] jord-n: has joined #RubyOnRails
[21:08:09] beneggett: has joined #RubyOnRails
[21:09:43] mwlang: has joined #RubyOnRails
[21:13:41] siaw23: cnk: nopw
[21:17:38] FooMunki: has joined #RubyOnRails
[21:18:05] oystersauce8: has joined #RubyOnRails
[21:19:36] Rodya_: has joined #RubyOnRails
[21:21:13] danostrowski: has joined #RubyOnRails
[21:21:15] oystersauce8: has joined #RubyOnRails
[21:22:03] macsteps: has joined #RubyOnRails
[21:22:22] skroon: is it possible for rails not to cache the mysql database password, and just recheck it everytime ?
[21:22:25] mwlang: if I have a Docket which has many Parties and Party belongs to Role…how do I order the docket.parties association by the role.display_name? Docket has_many :parties, -> { order( …) }?
[21:22:53] skroon: adam12: yeah thanks, that was I was indeed wondering :)
[21:23:55] adaedra: skroon: rails does not "cache" the mysql password, it just keeps the connection open
[21:24:17] arup_r: display_name is a column?
[21:24:30] mwlang: arup_r: yes
[21:24:42] arup_r: then what u have shown will work
[21:24:44] norc: skroon, you can simply change the adapter configuration and force a reconnect if you insist.
[21:24:55] norc: But I really don't see why you would want that.
[21:25:18] arup_r: but need a bit joins :)
[21:26:32] norc: http://guides.rubyonrails.org/active_record_querying.html#using-array-hash-of-named-associations
[21:27:00] arup_r: hmm ^ that, and then order
[21:27:09] emachnic: has joined #RubyOnRails
[21:27:11] jgt: has joined #RubyOnRails
[21:28:52] mwlang: geez…was writing “display_name” when the column name was “display_order” d-oh!
[21:29:09] skroon: adaedra: ow thanks, I didn't know
[21:30:38] skroon: in my database.yml i'm using a ruby object that is loaded in config/initializers/app_config.rb everything works when I run the rails server, however when doing a database migration it complains about uninitialized constant... how can I make sure my db migrations also require 'app_config' that is in lib/app_config.rb
[21:34:36] beneggett: has joined #RubyOnRails
[21:35:47] mikecmpbll: has joined #RubyOnRails
[21:37:10] oryman: has joined #RubyOnRails
[21:37:23] arup_r: lib/app_config.rb or config/initializers/app_config.rb ? check twice :)
[21:37:32] kwerle: has joined #RubyOnRails
[21:38:10] arup_r: do u really have 2 such files, or u typed wrong here?
[21:38:19] arup_r: skroon: ^
[21:38:21] acovrig: has joined #RubyOnRails
[21:39:01] moeabdol: has joined #RubyOnRails
[21:39:23] acovrig: what is the recommended/best practice method to deal with record validation errors: I.E. trying to create a duplicate record should return a pretty error message (I.E. render json: {…}) as opposed to spewing source or just returning a 500?
[21:39:55] oystersauce8: has joined #RubyOnRails
[21:40:09] skroon: arup_r: I really have to such files, in the initializers one, I do a: require 'app_config'
[21:40:12] acovrig: I’m currently thinking a begin; rescue; end thing and catching the validation error and `render json: {…} and return`
[21:40:22] acovrig: has left #RubyOnRails: ()
[21:40:37] acovrig: has joined #RubyOnRails
[21:40:39] arup_r: why not keeping only in the config/initializers ?
[21:41:40] arup_r: acovrig: validation error will not blow you, if u do call like .create, .save or .valid
[21:41:48] GodFather: has joined #RubyOnRails
[21:41:49] roamingdog: has joined #RubyOnRails
[21:42:07] arup_r: so use them, and then based on the return value, write ur json data
[21:42:08] Honeycomb: has joined #RubyOnRails
[21:42:23] arup_r: instead of those ugly begin/rescue/end
[21:42:38] banister: has joined #RubyOnRails
[21:43:24] acovrig: arup_r: they currently are: I have a .save! and it’s throwing an ActiveRecord::RecordInvalid (Validation failed: ModelName has already been taken)
[21:43:43] arup_r: .save and .save! is not same dear friend.
[21:44:16] d0nn1e: has joined #RubyOnRails
[21:45:23] acovrig: from what I understand save doesn’t actually commit to DB, but save! does; I’ll look into save vs save! however this specific instance isn’t actually a save! (sorry), it’s a item.foreign_key_colum << foreign_item statement
[21:45:29] arup_r: most useful is .save because it returns true if data is valid, or false in other case
[21:45:31] acovrig: as a many to many relationship
[21:45:57] oryman: has joined #RubyOnRails
[21:46:09] acovrig: arup_r: so if save then save! else return pretty error?
[21:46:41] Rodya_: has joined #RubyOnRails
[21:46:51] arup_r: no.. if save will save it to DB, if valid and return you true, u don't need again another save on it
[21:47:54] greengriminal: has joined #RubyOnRails
[21:48:28] acovrig: oh, so save returns true and /actually/ saves, save! tries to save, but throws an Exception if it fails
[21:48:52] kwerle: I have a ruby/rails performance question. I have a very basic service that returns JSON data. Let’s say I have a record I fetch -call it a book - and the pages for that book (of which there are about 9000). The entire result set is about 2.2MB. Rails is taking about 4s to process all this data into active records and customize the response JSON. I’m interested in ideas about how to improve performance. Cachine is fine and works great - but most
[21:48:53] kwerle: the lookups are going to be fresh/different. How can I improve performance?
[21:48:56] cnk: so you can use if thing.save ... else ... errors end
[21:48:58] arup_r: those bangs I use when I am debugging
[21:49:10] arup_r: otherwise not..
[21:49:12] jenrzzz: has joined #RubyOnRails
[21:49:12] jenrzzz: has joined #RubyOnRails
[21:49:28] acovrig: OK, I have a many to many: Event, Contact; I’ve been doing contact.events << event; should I do ContactEvents.create() instead?
[21:49:43] acovrig: to add a contact to an event
[21:49:55] acovrig: and to remove should I do contact.events.delete(event)?
[21:50:36] skroon: adaedra: i'm storing my configuration in memcache, so I would like to force a reload whenever I change the settings in memcache
[21:50:40] skroon: without having to restart rails
[21:50:41] kwerle: acovrig: event.contact.build
[21:51:40] kwerle: and maybe event.contacts.destroy
[21:51:54] acovrig: kwerle: will that return false if the relationship already exists? (build)
[21:51:57] kwerle: skroon: Rails.cache.clear()
[21:52:03] acovrig: kwerle: won’t that remove all contacts from the event?
[21:52:56] kwerle: Sorry - you’re right. You just want to destroy the contact.
[21:53:10] acovrig: kwerle: just remove *that* contact from *that* event
[21:53:23] kwerle: And/or event.contacts = event.contacts.reject{|c| c.id == DELETE_ID}
[21:53:43] acovrig: kwerle: context: just before those lines I have an event=Event.find(blah) and contact=Contact.find(blah)
[21:53:47] jord-n: has joined #RubyOnRails
[21:53:54] kwerle: You may even be able to just do contact.event = nil and let rails sort things out.
[21:54:07] kwerle: See also inverse_of and has_many delete rules.
[21:54:24] acovrig: kwerle: however, a contact can have multiple events, so it wouldn’t know what event, right?
[21:54:32] acovrig: for the contact.event = nil
[21:54:41] Oliphaunte: has joined #RubyOnRails
[21:54:50] kwerle: For that you need the inverse right and the delete rules right.
[21:55:12] acovrig: kwerle: so, would contact.events.build(event_id: event.id) ?
[21:55:17] emachnic: has joined #RubyOnRails
[21:55:38] kwerle: You can’t build from events - just a single event.
[21:55:47] Elinos: has joined #RubyOnRails
[21:56:14] kwerle: Ah - you mentioned many to many. Yeah, you just need to assign the relationships that you want to change - like the reject line above.
[21:57:20] acovrig: kwerle: currently I’m doing contact.events << event and that’s throwing a validation error as it should, but I want to catch that and give a pretty error
[21:57:56] acovrig: kwerle: something like if (contact.events << event); render plain: ‘OK’; else; render plain: ‘error’; end but meh
[21:58:21] kwerle: It sounds like you’re doing a lot of thinking about contact_event. It is possible you really want to treat that join like a first class object/model.
[21:58:30] acovrig: kwerle: so would it be better to do ContactEvents.create(contact_id: contact.id, event_id: event.id) ?
[21:58:55] kwerle: Given how much you are thinking about it, I’d say so.
[21:59:11] kwerle: And/or rename it participants and treat it like a real thing.
[21:59:29] acovrig: what do you mean real thing?
[21:59:41] Chaterz: has joined #RubyOnRails
[21:59:44] kwerle: participant? attendee? Like something your users are interacting with.
[21:59:59] kwerle: Instead of “just a join” table.
[22:00:22] Chaterz: has joined #RubyOnRails
[22:00:57] kwerle: Because you want timestamps. And next you want to know who added them.
[22:01:46] acovrig: oh, I think I see what you mean, I’m not sure that would apply here, but I do have timstamps on the join table, so I think I’m fine
[22:01:52] Jasaka: has joined #RubyOnRails
[22:02:17] acovrig: kwerle: thanks for the help, TTFN
[22:02:33] kwerle: I have a ruby/rails performance question. I have a very basic service that returns JSON data. Let’s say I have a record I fetch -call it a book - and the pages for that book (of which there are about 9000). The entire result set is about 2.2MB. Rails is taking about 4s to process all this data into active records and customize the response JSON. I’m interested in ideas about how to improve performance. Cachine is fine and works great - but most
[22:02:34] kwerle: the lookups are going to be fresh/different. How can I improve performance?
[22:04:19] moeabdol: has joined #RubyOnRails
[22:04:39] oystersauce8: has joined #RubyOnRails
[22:09:47] adam12: kwerle: Might help swapping JSON engines out.
[22:09:59] danostrowski: has joined #RubyOnRails
[22:10:06] adam12: kwerle: Maybe to Yajl? https://github.com/brianmario/yajl-ruby
[22:11:05] adam12: or Oj? You'd have to compare.
[22:11:26] kwerle: I don’t think that the JSON part is the problem. I’m *pretty sure* the problem is fetching the 9000 pages and doing the hash tweaking. I have not proved that, but I’m *pretty sure* that the json part is very optimised. I’m using OJ.
[22:12:05] adam12: Oh, well if you can avoid creating 9000 ActiveRecord objects I'd start there..
[22:12:12] agit0: has joined #RubyOnRails
[22:12:22] adam12: Can you gist some code?
[22:12:27] kwerle: Right - so how do I do that? Do I use select_all?
[22:13:36] oystersauce8: has joined #RubyOnRails
[22:13:44] kwerle: It’s very boring: https://gist.github.com/kwerle/d3a9275655b34008d848231e7e0f9c40
[22:13:54] adam12: select_all + some arel to build the query will work.... Arel is kind of a pain tho
[22:14:01] kwerle: in this code, ‘self’ is the book. self.w_ban_cell_hourlys are the pages.
[22:14:25] kwerle: I was wondering if I could get at the SQL that self.w_ban_cell_hourlys would generate and pass that into select_all?
[22:15:38] adam12: Possibly? You could likely #to_sql it, but if it would port right over, no idea.
[22:21:02] smathy: has joined #RubyOnRails
[22:24:40] pontiki: has joined #RubyOnRails
[22:24:43] lalalaaa: has joined #RubyOnRails
[22:29:15] oystersauce8: has joined #RubyOnRails
[22:29:45] cnk: And what is going to consume a 2 MB JSON response?
[22:30:13] lupine: 2MB isn't all that unusual
[22:30:26] lupine: I've got an API that can spit that out in ~50ms
[22:30:40] lupine: it's, um, not rails
[22:31:00] smathy: ...or it's, umm, not ActiveRecord ;)
[22:31:13] lupine: it's also not AR :D
[22:31:30] pontiki: that shouldn't be that hard for rails to do, either
[22:31:41] wethu: has joined #RubyOnRails
[22:31:51] lupine: kwerle: you want to avoid AR, or at least AR instantiation, for this sort of thing. that might boil down to just using pluck
[22:32:04] lupine: it might be that you shouldn't be putting pages in a relational database at all
[22:32:32] lupine: I've had fantasies for a while of a JSON "API" that is just a thin access control layer on top of a bunch of static .json files in a directory
[22:32:47] lupine: when an update is made, regenerate all the relevant .json files
[22:33:11] jhack: has joined #RubyOnRails
[22:33:49] kwerle: The datasource is not my choice/decision - sadly.
[22:34:08] Dimik: has joined #RubyOnRails
[22:34:09] kwerle: cnk: the consumer is a docker container running right next door.
[22:34:16] pontiki: i did that as an experiment with Jekyll using the new processing hooks
[22:34:44] lupine: sounds like you've got some benchmarking to do then ^^. Start by seeing just how fast you can select() the records from the database, using the same queries AR is generating
[22:35:02] lupine: if that's performant, you can just skip the AR object instantiation. if it's not, you can look at writing some custom queries
[22:35:05] smathy: If your records aren't changing rapidly it'd be pretty trivial to cache the prepared JSON for each record in something very quick, like memcached or redis, and invalidate the cache any time an update comes in.
[22:35:07] oystersauce8: has joined #RubyOnRails
[22:35:13] lupine: maybe you've got an N+1 hiding in there or somethin
[22:36:09] kwerle: There is no N+1, and we’re talking about a LOT of data. Not terebytes, yet, but GB. Not something I want to try to store in memcached.
[22:36:37] kwerle: pluck. Yeah, maybe. The data is simple enough. OK - thanks for the ideas, all!
[22:36:39] lupine: hmmm, does the whole dataset fit into ram?
[22:37:14] lupine: if not, you could add more ram, or. OR. you could get a database cursor and stream the json so you don't have to hold it all in ram simultaneously
[22:37:17] kitsuneyo: has joined #RubyOnRails
[22:37:20] lupine: sounds kind of fun
[22:37:52] kwerle: It’s an interesting challenge. It makes me a little sad ruby isn’t [way] more performant.
[22:38:16] lupine: anyway. rule out the SQL queries as the cause of the slow. it won't hurt you much to rip out AR entirely if it's the slow bit
[22:38:48] smathy: lupine, it's 2MB, holding it all in RAM shouldn't be an issue :)
[22:39:08] lupine: ah, of course, GiB is the whole dataset, not just the request
[22:39:28] lupine: you need to benchmark. I can't see what's happening from here :p
[22:42:13] smathy: Yeah, it's hard to imagine the records needed to create 2MB of JSON data taking 4 seconds to load from the DB.
[22:42:58] gfvcastro: has joined #RubyOnRails
[22:43:43] Cache_Money: has joined #RubyOnRails
[22:43:54] lupine: it should be pretty obvious just from the SQL whether that's the problem or not
[22:43:59] GodFather: has joined #RubyOnRails
[22:44:16] Radar: GOOD MORNING
[22:45:16] evansbee: has joined #RubyOnRails
[22:45:19] kwerle: Yeah, fetching the ARs: 2s. plucking all the columsn: 0.2s. Thanks again.
[22:45:50] roamingdog: has joined #RubyOnRails
[22:49:58] jenrzzz: has joined #RubyOnRails
[22:50:55] sloggerkhan: So dumb question, but when you have a form for updating/creating a collection, like maybe a person can have cars or something that you choose via multi-select of some sort, and there's a M2M sort of thing going on, how is the form/endpoint normally dealt with?
[22:53:27] triptec: has joined #RubyOnRails
[22:53:34] sloggerkhan: Answered my own question
[22:54:45] oystersauce8: has joined #RubyOnRails
[22:55:59] lupine: kwerle: 200ms is still pretty awful :D
[22:56:12] Radar: time to rewrite it in Phoenix
[22:56:20] kwerle: The db is far from me and may not be very fast.
[22:56:33] kwerle: I *hope* that a lot of that is wire time for 2.2MB data.
[22:56:50] kwerle: I’ll need to test closer to the DB to see for sure.
[22:56:56] lupine: fingers crossed, eh
[22:57:18] kwerle: I always think of an order of magnitude as being progress, though :-)
[22:57:19] lupine: I guess the browser-side parsing of that blob is going to limit the usefulness of further server-side timming
[22:57:21] lupine: trimming*
[22:57:34] kwerle: No browser. Another nearby process.
[22:57:40] lupine: oh, fair enough
[22:57:47] cleopatras: has joined #RubyOnRails
[22:57:57] lupine: have you considered database integration over web services integration?
[22:58:22] lupine: if you can get away with it, you can skip a lot of code
[22:58:23] kwerle: MS SQL Server. And I’m not much of a DB person to start with.
[22:59:09] sdwrage: has joined #RubyOnRails
[22:59:28] kwerle: And we really want to keep folks out of the DB. We’re hoping one day to shut down access to these tables and make them really ours. At that time maybe postgres and storing the JSON instread of this work.
[23:00:32] oystersauce8: has joined #RubyOnRails
[23:02:36] Cache_Money: How do I render the "new" view and pass in a URL param if the object isn't successfully saved within `create` action? https://gist.github.com/anonymous/e56d960d983b5ff05f2c6b37c8fef585
[23:04:44] jtong: has joined #RubyOnRails
[23:04:49] danostrowski: has joined #RubyOnRails
[23:06:35] oystersauce8: has joined #RubyOnRails
[23:07:28] mikecmpbll: has joined #RubyOnRails
[23:07:54] rickmasta: has joined #RubyOnRails
[23:07:58] smathy: Cache_Money, you're confusing things, `render` just renders a view, it uses whatever instance variables are defined in the controller, nothing to do with URL params.
[23:08:01] cnk: Cache_Money: in your else, set @golf_tournement based on fatasy_tame's golf_touernemnt_id
[23:08:47] triptec: has joined #RubyOnRails
[23:09:44] Cache_Money: smathy: To create a new FantasyGame I need to know which GolfTournament it is. So, the link to the new page looks like `new_fantasy_game_path(golf_tournament_id: tournament.id)`
[23:10:33] Cache_Money: But if the create action fails I need to send them back to the new action, for that same golf_tournament (and display any errors)
[23:10:47] Rodya_: has joined #RubyOnRails
[23:11:00] smathy: Cache_Money, right, as I said, you're getting confused. "render :new" does not "send them back to the new action" - it just renders the new view.
[23:11:38] Cache_Money: smathy: I tried `redirect_to new_fantasy_game_path(golf_tournament_id: @fantasy_game.golf_tournament_id)` but there were no error messages displayed when I did that
[23:11:52] smathy: Right, because it's a redirect.
[23:12:32] cnk: For your flow, you want render :new, not redirect
[23:12:50] cnk: just fill in the instance variables that your form will need before you do the render
[23:12:53] bbrowning_away: has joined #RubyOnRails
[23:13:30] bbrowning_: has joined #RubyOnRails
[23:14:08] Cache_Money: Okay, that makes sense.
[23:15:29] bbrowning__: has joined #RubyOnRails
[23:16:53] rickmasta: has joined #RubyOnRails
[23:18:24] diegoaguilar: has joined #RubyOnRails
[23:19:00] cleopatras: has joined #RubyOnRails
[23:19:29] bbrowning_: has joined #RubyOnRails
[23:19:52] replay: has joined #RubyOnRails
[23:20:27] Darmani: has joined #RubyOnRails
[23:20:48] rickmasta: has joined #RubyOnRails
[23:20:55] arBmind: has joined #RubyOnRails
[23:22:13] bbrowning: has joined #RubyOnRails
[23:26:13] jkwood: has joined #RubyOnRails
[23:27:49] dalbuschat: has joined #RubyOnRails
[23:30:52] lightt: has joined #RubyOnRails
[23:33:11] wd40s: has joined #RubyOnRails
[23:33:44] jetpackjoe: has joined #RubyOnRails
[23:35:17] jtong: has joined #RubyOnRails
[23:35:41] emachnic: has joined #RubyOnRails
[23:40:09] superlou: has joined #RubyOnRails
[23:41:57] greghoggard: has joined #RubyOnRails
[23:43:29] brettu: has joined #RubyOnRails
[23:44:54] kitsuneyo: how do i call a flash message from a js.coffee file, with bootstrap?
[23:45:19] greghogg_: has joined #RubyOnRails
[23:47:29] kitsuneyo: it seems like a ball-ache to do flash with ajax
[23:48:55] Tref: has joined #RubyOnRails
[23:49:14] Tref: Whats the best way to determine which file is rendering a partial?
[23:49:27] Tref: Im having a hard time figuring out what template is calling this partial I have
[23:49:58] Tref: I have a pry session loaded from inside my template but dont know how to access anything about the “parent” template
[23:50:14] smathy: kitsuneyo, "call a flash message" does not make sense.
[23:51:02] smathy: tref, add some logging or debug breakpoints into the suspected templates and see which one is being run.
[23:51:13] jhass: tref: anything interesting in caller?
[23:51:20] banister: has joined #RubyOnRails
[23:51:23] jhass: Kernel#caller that is
[23:51:37] kitsuneyo: smathy, i have an update action that uses ajax. i can't seem to use flash[:success] = "Whatever" in that action. i figured i should put it in update.js.coffee
[23:51:47] kitsuneyo: i don't know how to do it
[23:51:55] Tref: jhass: caller.. boom
[23:52:20] alfiemax: something totally weird just happened
[23:53:07] alfiemax: i had been running an app locally for more than 24hrs now, and suddenly everything just crashed
[23:53:25] alfiemax: getting PG::ConnectionBad
[23:53:29] smathy: kitsuneyo, well you can use it, but Rails doesn't do anything magical to insert it into the response. You need to do that yourself, just like you do for the HTML responses.
[23:54:12] smathy: kitsuneyo, for an HTML response you'll include something in your layout or view templates to output the flash messages, you need to do something analogous to that for your JS or JSON responses.
[23:54:15] kitsuneyo: smathy, i guess i just don't really understand how flash works in my own app
[23:54:35] smathy: alfiemax, sounds like your app lost connection to your postgres DB.
[23:54:37] alfiemax: i stopped the server and trying to start again, its giving me log write failed, please ensure that developemnt.log has write access
[23:54:40] kitsuneyo: at the moment the flash appears only when i refresh the page
[23:54:55] smathy: alfiemax, sounds like it can't write to development.log
[23:55:02] alfiemax: smathy, yeah, i figured, but why?
[23:55:05] kitsuneyo: ...that's what i include flash in the controller action
[23:55:31] alfiemax: i did nothing, it has been running without any issues and all of a sudden it stopped??
[23:55:53] jhass: alfiemax: maybe check S.M.A.R.T logs :P
[23:56:21] smathy: kitsuneyo, all about flash: http://guides.rubyonrails.org/action_controller_overview.html#the-flash
[23:56:48] smathy: alfiemax, could be a million different things, none of them related to Rails.
[23:57:36] smathy: alfiemax, power surge, hard drive glitch, bad spot on RAM, electromagnetic pulse, butterflies....
[23:57:52] pilne: has joined #RubyOnRails
[23:57:55] jhass: ... smathy sneaking into your home and flipping some bits
[23:58:28] jkwood: I sell a special smathy-repellent for that particular eventuality.
[23:58:30] smathy: ACTION uses butterflies
[23:59:20] smathy: I keep a whole swarm of butterflies for nefarious purposes.