« Back to channel list

#RubyOnRails - 02 July 2015

« Back 1 day Forward 1 day »
[00:00:31] mwlang: Do ya think its just my code (incorrect usage) or is it worth reproducing in a fresh app?
[00:01:00] eggoez: has joined #RubyOnRails
[00:01:52] GnuYawk: has joined #RubyOnRails
[00:01:52] GnuYawk: has joined #RubyOnRails
[00:02:29] celly: Radar: checking the rails console, its still showing confirmed_at: nil. UGH!!! i'm about ready to pull my locs out
[00:02:58] celly: tested using both user.confirm! and user.skip_confirmation!
[00:06:06] jenrzzz: has joined #RubyOnRails
[00:06:16] mwlang: ugh???just tried upgrading from 4.1.4 to 4.1.12 on a whim to see if above problem solved, but discovered an odd monkey patch by previous developers. any idea what this is? https://gist.github.com/mwlang/d646a3bae598598c0026
[00:07:55] zeitue: has joined #RubyOnRails
[00:08:25] roamingdog: has joined #RubyOnRails
[00:08:54] hardtail: has joined #RubyOnRails
[00:09:37] Radar: My goodness.
[00:09:48] Radar: remove it and see what breaks
[00:10:49] mwlang: Radar: doing just that???sure would be nice to have some test specs. :-)
[00:19:21] mwlang: Radar: It???s an ActiveAdmin workaround: https://github.com/rails/rails/issues/10507
[00:19:26] Radar: !activeadmin
[00:19:26] helpa: brb, shooting myself
[00:20:24] Radar: I think I'll change that to be less extreme
[00:20:26] Radar: !activeadmin
[00:20:26] helpa: *makes a cross with fingers and says a prayer*
[00:20:41] bradleyprice: has joined #RubyOnRails
[00:20:42] mwlang: Radar: I gather you dislike AA?
[00:20:50] mwlang: (and the 12 steps it brings?)
[00:20:53] Radar: extraordinarily.
[00:21:09] mwlang: why???s that?
[00:21:15] Radar: List of things I hate: 1) turbolinks 2) activeadmin 3) angular 4) cucumber (the vegetable)
[00:21:27] one_zero: has joined #RubyOnRails
[00:21:32] Radar: Because it pretends like it gives you a good solution and then pisses on the carpet when you try to do anything remotely complex.
[00:21:36] mwlang: I???m with you on #1 and #3
[00:21:37] Radar: Same problem Angular has
[00:21:47] Radar: Great for prototyping, not great for production.
[00:22:00] tubbo`: Radar: no, angular's problem is that it's a javascript framework invented by someone who doesn't know how to write javascript. written for people who don't like javascript and don't want to learn it.
[00:22:08] mwlang: Has anyone done backend admin any better?
[00:22:21] Radar: mwlang: Yes, plenty of people have done it better by writing it themselves.
[00:22:36] sevenseacat: has joined #RubyOnRails
[00:22:36] Radar: It's the a similar kind of issue that I have against automated documentation generation for APIs.
[00:22:40] tubbo`: unfortunately, admin isn't really a "set and forget" kind of thing
[00:22:49] mwlang: Radar: well, there???s that and I???m one of those???but really???any engines out there doing it better than AA?
[00:23:01] Radar: mwlang: no
[00:23:13] tubbo`: they all suffer from the same problem
[00:23:47] mwlang: tubbo`: which is???.just that it???s challenging to do something remotely complex?
[00:24:19] tubbo`: mwlang: well, activeadmin and rails_admin are kinda like second systems.
[00:24:26] tubbo`: http://www.catb.org/jargon/html/S/second-system-effect.html
[00:24:46] tubbo`: they end up replicating a lot of what rails does in a less-useful way.
[00:25:43] Matadoer: has joined #RubyOnRails
[00:27:19] LeoDee: has joined #RubyOnRails
[00:27:52] mwlang: ???there is a tendency to become grandiose in one's success and design an elephantine feature-laden monstrosity.???
[00:28:29] Radar: the best admin systems I have seen designed are ones that don't use rails_admin / active_admin
[00:28:47] Radar: Similar to how the best hamburgers I've ever had have not been from McDonalds.
[00:28:52] mwlang: I need to go back and read TMM ??? it???s been a long time since my Freshman year in college...
[00:28:58] artto: has joined #RubyOnRails
[00:29:09] Radar: Generic admin areas aren't feasible for production systems.
[00:29:13] iliketurtles: has joined #RubyOnRails
[00:30:05] Radar: And we tried doing this kind of thing when Rails would generate the whole set of actions in a controller for you with one method "scaffold_controller"
[00:30:25] Radar: I think that's what the method was called anyway
[00:30:41] mwlang: Radar: ugh???I seem to vaguely recall that
[00:30:58] Radar: That went away with Rails 2.0
[00:31:02] mwlang: Rails got ridiculous before it got better.
[00:31:12] iliketurtles: i'm building a gem for rails; wondering how one goes about including partials that the gem business logic will render? just stick them in app/views/... ? or something special?
[00:31:13] Radar: Then there was the inherited_resources gem which tried to do it too.
[00:31:27] tubbo`: i liked inherited_resources
[00:31:30] Radar: iliketurtles: app/views will work if the gem is an engine.
[00:31:53] mwlang: heh???AA uses inherited_resources to drive.
[00:32:20] Radar: I'm going to be tasked with writing API documentation fairly soon and I won't be using an automated solution.
[00:32:30] Radar: An automated solution won't understand the nuance between taxon_slug and taxon_id.
[00:32:40] Radar: It won't understand that the images resource is linked to the adverts resource.
[00:33:14] mwlang: I???ve never really found a good way to automate documentation
[00:33:20] mwlang: gave up trying, really.
[00:33:36] mwlang: it???s better to fire up a wiki-based PM approach and document as you build the sucker.
[00:33:37] tubbo`: i've been trying to extend YARD so that it outputs controller documentation in API request format
[00:34:07] tubbo`: like instead of having to browse the class name, you could just view POST /some_resource and go to the docs for SomeResourceController#create
[00:34:14] mwlang: tubbo`: I actually tried that as well, but was less than happy with the results.
[00:34:15] tubbo`: s/view/click on
[00:34:24] Radar: For the past-... forever, I've thought "What would GitHub do?" when writing API documentation. https://developer.github.com/
[00:35:08] tubbo`: yeah i don't think that's automated at all, it's just a big static jekyll site right?
[00:35:15] Radar: yeah iirc
[00:35:27] tubbo`: we have this thing at work that's pretty strange
[00:35:37] tubbo`: they're called "style guides" and they're deployed in every application
[00:35:42] Radar: https://github.com/github/developer.github.com
[00:35:50] Radar: Built with nanoc.
[00:35:56] mwlang: Radar: what would be nice is human organized documentation that you can just point at a source file for the actual method call signatures with some sort of inclusion tag.
[00:36:37] tubbo`: they include the color scheme, fonts used in the app, and other stuff
[00:37:13] ProLoser: has joined #RubyOnRails
[00:38:18] stardiviner: has joined #RubyOnRails
[00:38:29] tubbo`: i suppose the main problem with auto-generated docs is that it can't be easily proofread.
[00:38:52] tubbo`: i think that's why hand-editing docs tend to look better, because humans read it over and made sure shit made sense
[00:41:54] roolo_: has joined #RubyOnRails
[00:42:01] sankaber: has joined #RubyOnRails
[00:46:27] Scripore: has joined #RubyOnRails
[00:47:42] Spami: has joined #RubyOnRails
[00:48:07] mostlybadfly: has joined #RubyOnRails
[00:50:27] zemmihates: has joined #RubyOnRails
[00:51:30] bruno-: has joined #RubyOnRails
[00:54:03] chouhoulis: has joined #RubyOnRails
[00:56:02] w09x: has joined #RubyOnRails
[00:58:45] yaymukund: has joined #RubyOnRails
[00:59:02] s2013: has joined #RubyOnRails
[00:59:30] artto: has joined #RubyOnRails
[01:00:55] RegulationD: has joined #RubyOnRails
[01:01:19] artto: has joined #RubyOnRails
[01:02:08] twilling: has joined #RubyOnRails
[01:07:15] giowong_: has joined #RubyOnRails
[01:12:34] zorak8: has joined #RubyOnRails
[01:14:29] wsmoak: has joined #RubyOnRails
[01:21:27] Denarii: has joined #RubyOnRails
[01:22:41] shyshy: has joined #RubyOnRails
[01:22:46] roamingdog: has joined #RubyOnRails
[01:24:56] nettoweb: has joined #RubyOnRails
[01:27:58] fryguy9: has left #RubyOnRails: ()
[01:28:01] pgatt: has joined #RubyOnRails
[01:28:13] fryguy: has joined #RubyOnRails
[01:28:37] nettoweb_: has joined #RubyOnRails
[01:28:54] frishi: has joined #RubyOnRails
[01:29:06] JeramyRR: has joined #RubyOnRails
[01:31:57] djbkd: has joined #RubyOnRails
[01:32:53] skkeeper: has joined #RubyOnRails
[01:34:32] beauby: has joined #RubyOnRails
[01:49:40] blackhuey: has joined #RubyOnRails
[01:53:15] momomomomo: has joined #RubyOnRails
[01:53:26] tubbo`: has joined #RubyOnRails
[01:54:55] roamingdog: has joined #RubyOnRails
[01:56:59] ALVxRIO: has joined #RubyOnRails
[01:59:04] blackhuey1: has joined #RubyOnRails
[01:59:27] acti0nman: has joined #RubyOnRails
[02:02:12] artto: has joined #RubyOnRails
[02:02:57] bruno-: has joined #RubyOnRails
[02:04:00] blackhuey: has joined #RubyOnRails
[02:04:39] Jarboe: has joined #RubyOnRails
[02:07:32] jeanlinux: has joined #RubyOnRails
[02:09:55] beauby: has joined #RubyOnRails
[02:12:32] lapidary: has joined #RubyOnRails
[02:14:00] lapidary: I am looking for an example of nested resources and making a new.html.erb and _form.html.erb
[02:17:02] sevenseacat: https://github.com/rubysherpas/r4ia_examples/tree/master/ticketee/app/views/tickets ?
[02:20:51] jtdoncas: has joined #RubyOnRails
[02:22:38] charliesome: has joined #RubyOnRails
[02:22:51] bf4: has joined #RubyOnRails
[02:24:46] chouhoulis: has joined #RubyOnRails
[02:25:12] cashnguns: has joined #RubyOnRails
[02:27:33] lapidary: thanks sevenseacat I think I understand it
[02:31:48] bmurt: has joined #RubyOnRails
[02:32:05] Sylario: has joined #RubyOnRails
[02:32:37] herpless: has joined #RubyOnRails
[02:32:43] El3ktra: has joined #RubyOnRails
[02:33:53] beauby: has joined #RubyOnRails
[02:37:57] huck5: has joined #RubyOnRails
[02:38:30] chipotle: has joined #RubyOnRails
[02:39:49] ejnahc: has joined #RubyOnRails
[02:41:04] dc1: has joined #RubyOnRails
[02:45:10] lessless: has joined #RubyOnRails
[02:48:23] bradleyp_: has joined #RubyOnRails
[02:51:07] artto: has joined #RubyOnRails
[02:52:07] iliketurtles: say i have a module designed to be mixed into ActionController::Base, and it also has a few .jbuilder templates it expects in app/views. i want to port this functionality into a gem. would you go standard gem route or use a rails engine? rails engine seems a bit overkill :\
[02:52:21] ivanskie: has joined #RubyOnRails
[02:53:45] dopie: has joined #RubyOnRails
[02:54:05] pipework: iliketurtles: Why do you think it's overkill?
[02:54:11] bradleyprice: has joined #RubyOnRails
[02:54:31] iliketurtles: pipework: well, in order to use the app/views jbuilder templates wouldnt the user of my gem need to mount the engine in their router?
[02:54:36] tubbo`: has joined #RubyOnRails
[02:54:56] pipework: iliketurtles: Why would you need to mount an engine in a router to add views to your view paths?
[02:55:14] iliketurtles: pipework: that's what i'm asking -- i'm reading the guide, and perhaps i misunderstood it
[02:55:28] pipework: iliketurtles: An engine is not overkill.
[02:55:31] iliketurtles: so, the views in the engine are automatically added to the view paths, even if you dont mount the engine?
[02:55:39] pipework: Though you don't need a full rails app as an engine though.
[02:55:59] ghanima: has joined #RubyOnRails
[02:56:10] eggoez: has joined #RubyOnRails
[02:56:40] ghanima: anyone familar testing rails app with device by saving the token from a cookie
[02:56:54] ghanima: I have seen a few tutorials but none of them so far seems to be working for me
[02:57:56] drale2k: has joined #RubyOnRails
[02:59:45] baweaver: has joined #RubyOnRails
[03:00:01] lethjakman: has joined #RubyOnRails
[03:00:17] iliketurtles: thansk pipework will give it a shot
[03:00:44] sankaber: has joined #RubyOnRails
[03:01:05] RegulationD: has joined #RubyOnRails
[03:02:14] konsolebox: has joined #RubyOnRails
[03:02:51] Radar: ghanima: Can you give us an example of what you mean?
[03:03:02] Radar: lapidary: If you don't understand it, read Chapter 5 of Rails 4 in Action ;)
[03:04:37] lapidary: oh, I didn???t know about that option: I plan to buy Agile Web Development this weekend
[03:05:12] Radar: because we wrote a better book and have a huge bias towards it :P
[03:05:22] ghanima: Radar: so I am using this site as a reference http://leknarf.net/blog/2013/08/30/load-testing-a-rails-app-with-apache-bench/#.VWipzllVhBc
[03:05:31] x44x45x41x4E: has joined #RubyOnRails
[03:05:40] ghanima: Radar: but pretty much trying to run the curl command against my site
[03:05:47] surrealanalysis: has joined #RubyOnRails
[03:05:55] Radar: ghanima: Aha. I don't have any experience with something like that, sorry!
[03:05:59] giowong: has joined #RubyOnRails
[03:06:14] ghanima: Radar: e.g curl --cookie_jar filename URL | grep csrf-token
[03:06:23] ghanima: Radar: Oh ok understood thanks for responding
[03:08:32] jeanlinux: has joined #RubyOnRails
[03:08:37] ewitchin: has joined #RubyOnRails
[03:08:39] Trynemjoel: has joined #RubyOnRails
[03:11:18] beauby: has joined #RubyOnRails
[03:11:19] braincrash: has joined #RubyOnRails
[03:11:28] mheld: has joined #RubyOnRails
[03:12:45] s2013: has joined #RubyOnRails
[03:17:38] icehawk78: has joined #RubyOnRails
[03:18:55] lethjakman: ghanima: just so you're aware. there's a whole channel dedicated to curl #curl
[03:19:15] lethjakman: but what's wrong with that command?
[03:19:40] ghanima: lethjakman: yes I am aware but no one is answering so I thought I try other avenues....
[03:20:10] ghanima: lethjakman: so Everything in the article executes without error except for the curl after login
[03:20:23] ghanima: I am able to grab the csrf token
[03:20:56] ghanima: I am able to do the initial login and save the result to file
[03:21:10] ghanima: but when I try to access other pages I am getting redirected back to my login page
[03:22:17] lethjakman: you have cookie file saved to "cookie_file" I'm assuming?
[03:22:35] lethjakman: in the directory you're curling from
[03:22:53] ghanima: lethjakman: that is correct
[03:24:21] hahuang65: has joined #RubyOnRails
[03:24:34] lethjakman: hmmm, this looks about right. it's been a minute since I've done this though.
[03:25:27] lethjakman: and are you useing devise or something else?
[03:25:46] ghanima: lethjakman: that is correct I am using devise
[03:26:05] ghanima: and rails 4.2
[03:26:28] erich: has joined #RubyOnRails
[03:27:48] lethjakman: just a shot in the dark, but did you see the stack overflow post? http://stackoverflow.com/questions/4673027/how-do-you-use-curl-to-authenticate-on-a-rails-application-that-uses-devise
[03:30:23] lethjakman: I bet your cookie isn't set up quite right somehow.
[03:31:07] yfeldblum: has joined #RubyOnRails
[03:32:09] ghanima: lethjakman: didn't see this particular one but have also tried doing search on stackoverflow... I agree with you its my cookie not being setup or properly but outside of the article not sure what other reference to follow... let me take a look at the link you just sent
[03:32:51] lethjakman: ghanima: I remember tweaking the cookie when I did this.
[03:33:32] lethjakman: the only issue with the stack overflow is it's trying to grab xml, I'm assuming you'll want to modify it to do a get request for html.
[03:35:01] ghanima: lethjakman: so my purpose is to submit GIT request to multiple pages that require a token
[03:35:25] lethjakman: sounds reasonable to me.
[03:36:17] ghanima: so the article I read didn't do a POST however the stackflow article does do a Post
[03:36:30] ghanima: hmmm let me try to give that try
[03:39:12] frishi: has joined #RubyOnRails
[03:42:03] darrencauthon: has joined #RubyOnRails
[03:43:04] bmurt: has joined #RubyOnRails
[03:43:59] erich: has joined #RubyOnRails
[03:48:00] Scripore: has joined #RubyOnRails
[03:51:51] artto: has joined #RubyOnRails
[03:51:56] jordanstorz: has joined #RubyOnRails
[03:53:24] lethjakman: has joined #RubyOnRails
[03:54:02] bruno-: has joined #RubyOnRails
[03:55:18] tubbo`: has joined #RubyOnRails
[03:55:40] ChinhBui: has joined #RubyOnRails
[03:58:16] hahuang65: has joined #RubyOnRails
[04:02:11] RegulationD: has joined #RubyOnRails
[04:02:57] Spami: has joined #RubyOnRails
[04:03:11] cornerma1: has joined #RubyOnRails
[04:03:27] hahuang65: has joined #RubyOnRails
[04:06:03] m3_del: has joined #RubyOnRails
[04:06:41] giowong: has joined #RubyOnRails
[04:08:11] icosa1: has joined #RubyOnRails
[04:09:16] futilegames: has joined #RubyOnRails
[04:14:56] Frem: has joined #RubyOnRails
[04:17:20] braincra-: has joined #RubyOnRails
[04:19:31] towski_: has joined #RubyOnRails
[04:22:11] FailBit: has joined #RubyOnRails
[04:22:19] FailBit: getting the weirdest crash shit
[04:22:49] FailBit: I installed the rack-mini-profiler gem and it repeatedly crashes my webserver
[04:22:52] FailBit: https://liamwhite1.ngrok.io/stuff/holyshit.txt
[04:23:13] FailBit: > Did you mean recursion?
[04:24:50] chelbs: has joined #RubyOnRails
[04:30:14] x-light: has joined #RubyOnRails
[04:31:35] jenrzzz: has joined #RubyOnRails
[04:32:48] rhizome: maybe it doesn't like your rails version
[04:33:17] rhizome: i meant the gem
[04:33:47] FailBit: just installed the github version, same thing
[04:34:03] rhizome: when was the last commit?
[04:34:28] FailBit: 17 days ago
[04:34:29] rhizome: is it even implicated in the crash?
[04:34:33] FailBit: https://github.com/MiniProfiler/rack-mini-profiler
[04:34:47] rhizome: read the stack trace
[04:34:56] jordanstorz: has joined #RubyOnRails
[04:35:05] FailBit: I did, it's very near the bottom
[04:35:18] FailBit: 04:05:54 webrick.1 | /home/derpibooru/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-mini-profiler-0.9.3/lib/mini_profiler/profiler.rb:95:in `serve_results'
[04:35:20] FailBit: 04:05:54 webrick.1 | /home/derpibooru/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-mini-profiler-0.9.3/lib/mini_profiler/profiler.rb:118:in `serve_html'
[04:37:37] rhizome: what's the error message?
[04:37:49] FailBit: SystemStackError: stack level too deep
[04:38:07] FailBit: infinite recursion, basically
[04:38:45] rhizome: look for references to application code in the stack trace
[04:39:12] FailBit: none at all
[04:39:31] FailBit: just the places where NewRelic has patched itself in as middleware
[04:39:50] rhizome: maybe that's what it doesn't play nice with
[04:39:57] FailBit: I tried removing it, it's no different
[04:40:08] FailBit: still crashes with SystemStackError
[04:40:12] rhizome: sounds like you have some digging to do
[04:40:35] FailBit: https://paste.debian.net/plainh/773e8578
[04:41:41] FailBit: ACTION tries removing oj_mimic_json
[04:42:13] FailBit: ... aaand that fixed it
[04:42:18] frek818: has joined #RubyOnRails
[04:48:19] arBmind: has joined #RubyOnRails
[04:49:22] x-light: I'm posting a search to a controller but rails won't render the search result page for me. According to the log rails has rendered the html but I don't see the results page appear in the browser. gist: https://gist.github.com/x-light/51f2e024ddfe6f6d2111
[04:50:47] rhizome: why the render :show?
[04:51:15] x-light: that was my attempt to get it to render something.
[04:51:51] x-light: should I just have a search.html.haml so that it will render that?
[04:51:59] rhizome: just use the search view
[04:52:19] x-light: let me give it a crack.
[04:52:28] artto: has joined #RubyOnRails
[04:56:06] tubbo`: has joined #RubyOnRails
[04:56:21] eggoez: has joined #RubyOnRails
[04:57:00] chrissonar: has joined #RubyOnRails
[04:57:02] x-light: rhizome, I renamed show.html.haml to search.html.haml and removed the render :show. Nothing changed, except for https://gist.github.com/x-light/51f2e024ddfe6f6d2111#file-search-log-L10 which displays the name of the newly named search file.
[04:57:21] jeanlinux: has joined #RubyOnRails
[04:57:58] lethjakman: has joined #RubyOnRails
[04:58:03] rhizome: are you sure that ids/@candidate stuff is working like you think it should?
[04:58:16] rhizome: you're querying Candidate twice
[04:59:11] x-light: let me remove the querying
[04:59:16] x-light: and retry.
[04:59:38] rhizome: is there anything else in the view file? put garbage text in there to be sure
[05:00:18] kies^: has joined #RubyOnRails
[05:01:37] x-light: its just static html. but let me remove it and try a couple of things, and I''l come back.
[05:03:01] djinni`: has joined #RubyOnRails
[05:03:32] dustinm`: has joined #RubyOnRails
[05:05:52] workmad3: has joined #RubyOnRails
[05:06:20] ferr: has joined #RubyOnRails
[05:07:44] yaymukund: has joined #RubyOnRails
[05:08:23] sevenseacat: how are you calling this search action? via js?
[05:08:46] x-light: yes, angular. I was just pondering that
[05:09:15] sevenseacat: well you need to handle the response somehow - rails is doing its part
[05:09:27] sevenseacat: sending the proper html response
[05:09:47] krz: has joined #RubyOnRails
[05:10:33] x-light: sorry, how do you mean? Like doing something with the returned json for the search results?
[05:11:15] EasyCo: has joined #RubyOnRails
[05:12:09] ferr: Hey, I need some basic help. I need a single page where you could input the text and word frequency would be displayed. http://pastie.org/private/wqplegafegpqstowkkg1xa How do I make this work?
[05:12:50] sevenseacat: x-light: you're not returning json
[05:12:53] sevenseacat: you're returning html
[05:13:31] ferr: sevenseacat: I know you're a good guy, I'll hand you a glass of milk with a cookie
[05:13:53] sevenseacat: ferr: I'm not any kind of guy, but thanks for asking.
[05:16:14] snockerton: has joined #RubyOnRails
[05:17:36] snockerton: if i'm making REST calls via RestClient::Request.execute( method: :get ) in a module method i'm calling here and there, is it bad if I let them hang around without cleanup?
[05:17:47] snockerton: or will a ruby thread somewhere do this for me?
[05:18:25] ferr: sevenseacat: do I need to make the post action to the frequency method?
[05:18:44] sevenseacat: ferr: I didn't look at your code.
[05:18:54] x-light: sevenseacat: you are right, that code doesn't return json. forget I said json. how would I make the proper html response so that rails renders a page, or do I need to do that through angular?
[05:19:19] sevenseacat: x-light: I don't have enough context to say.
[05:19:35] sevenseacat: I think you need to tell angular what to do with the HTML.
[05:20:17] shogun_: has joined #RubyOnRails
[05:20:19] x-light: sevenseacat: I think you're right, just thinking through it myself. ty for your help
[05:20:37] x-light: ty to rhizome too :)
[05:23:34] jeanlinux: has joined #RubyOnRails
[05:24:24] jeanlinux: has joined #RubyOnRails
[05:26:22] djbkd: has joined #RubyOnRails
[05:28:05] ur5us: has joined #RubyOnRails
[05:28:47] jeanlinux: has joined #RubyOnRails
[05:30:18] lxsameer: has joined #RubyOnRails
[05:30:18] lxsameer: has joined #RubyOnRails
[05:31:39] dc1: has joined #RubyOnRails
[05:32:26] futilegames: has joined #RubyOnRails
[05:32:49] Rukeal: has joined #RubyOnRails
[05:33:24] FailBit: has left #RubyOnRails: ("WeeChat 0.4.2")
[05:34:17] microdex: has joined #RubyOnRails
[05:34:19] trollga: has joined #RubyOnRails
[05:34:53] tlarevo: has joined #RubyOnRails
[05:35:17] abuzze: has joined #RubyOnRails
[05:38:47] dnewkerk: has joined #RubyOnRails
[05:41:03] shogun_: has left #RubyOnRails: ()
[05:43:47] tagrudev: has joined #RubyOnRails
[05:45:00] anthonys: has joined #RubyOnRails
[05:49:01] simrat: has joined #RubyOnRails
[05:49:44] rvanlieshout: has joined #RubyOnRails
[05:53:14] artto: has joined #RubyOnRails
[05:55:33] yardenbar: has joined #RubyOnRails
[05:56:43] tubbo`: has joined #RubyOnRails
[05:57:50] eGGsha: has joined #RubyOnRails
[06:00:32] rromanchuk: has joined #RubyOnRails
[06:00:36] wsmoak: has joined #RubyOnRails
[06:03:29] wsmoak_: has joined #RubyOnRails
[06:03:46] speaking1ode: has joined #RubyOnRails
[06:05:32] jeanlinux: has joined #RubyOnRails
[06:06:13] wsmoak: has joined #RubyOnRails
[06:06:54] eoy: has joined #RubyOnRails
[06:08:28] jeanlinux: has joined #RubyOnRails
[06:08:53] darrencauthon: has joined #RubyOnRails
[06:09:01] wsmoak_: has joined #RubyOnRails
[06:11:28] roamingdog: has joined #RubyOnRails
[06:11:46] wsmoak: has joined #RubyOnRails
[06:12:41] nya: has joined #RubyOnRails
[06:12:53] gr00t: has joined #RubyOnRails
[06:14:37] wsmoak_: has joined #RubyOnRails
[06:15:32] solars: has joined #RubyOnRails
[06:17:23] wsmoak: has joined #RubyOnRails
[06:18:32] yfeldblum: has joined #RubyOnRails
[06:18:48] Xiti: has joined #RubyOnRails
[06:20:08] wsmoak_: has joined #RubyOnRails
[06:21:55] riotjones: has joined #RubyOnRails
[06:22:15] oliver3: has joined #RubyOnRails
[06:22:56] wsmoak: has joined #RubyOnRails
[06:25:43] wsmoak_: has joined #RubyOnRails
[06:25:49] GnuYawk: has joined #RubyOnRails
[06:25:49] GnuYawk: has joined #RubyOnRails
[06:26:02] mike___1234: has joined #RubyOnRails
[06:26:42] sandstrom: has joined #RubyOnRails
[06:27:40] michaellippold: has joined #RubyOnRails
[06:28:04] ivanskie: has joined #RubyOnRails
[06:28:30] wsmoak: has joined #RubyOnRails
[06:28:30] wsmoak: has joined #RubyOnRails
[06:29:41] DEA7TH_: has joined #RubyOnRails
[06:31:18] wsmoak_: has joined #RubyOnRails
[06:33:45] arup_r: has joined #RubyOnRails
[06:34:10] wsmoak: has joined #RubyOnRails
[06:34:10] wsmoak: has joined #RubyOnRails
[06:34:29] trollga: has joined #RubyOnRails
[06:35:40] tubbo`: has joined #RubyOnRails
[06:36:59] wsmoak_: has joined #RubyOnRails
[06:37:34] arup_r1: has joined #RubyOnRails
[06:39:44] wsmoak: has joined #RubyOnRails
[06:41:37] lessless: has joined #RubyOnRails
[06:42:35] wsmoak_: has joined #RubyOnRails
[06:43:25] dopie: has joined #RubyOnRails
[06:45:21] wsmoak: has joined #RubyOnRails
[06:45:21] wsmoak: has joined #RubyOnRails
[06:45:35] ndrei: has joined #RubyOnRails
[06:47:06] lethjakman: has joined #RubyOnRails
[06:48:08] wsmoak_: has joined #RubyOnRails
[06:50:54] wsmoak: has joined #RubyOnRails
[06:52:01] Sylario: has joined #RubyOnRails
[06:52:40] benhuda: has joined #RubyOnRails
[06:53:12] lestrade: has joined #RubyOnRails
[06:53:38] mbuf: has joined #RubyOnRails
[06:53:42] wsmoak_: has joined #RubyOnRails
[06:53:53] mbuf: is it possible to redirect_to a different controller 'create' method?
[06:53:54] Palsson: has joined #RubyOnRails
[06:54:18] raunicolae: has joined #RubyOnRails
[06:54:40] workmad3: has joined #RubyOnRails
[06:54:44] sevenseacat: no. redirects will make browsers issue GET requests.
[06:55:04] Rukeal: has joined #RubyOnRails
[06:55:43] mbuf: sevenseacat, I see
[06:56:26] wsmoak: has joined #RubyOnRails
[06:56:54] mbuf: sevenseacat, what about API requests?
[06:57:00] sevenseacat: what about them?
[06:58:03] eGGsha: has joined #RubyOnRails
[06:58:13] mbuf: sevenseacat, the same goes with API controllerl?
[06:58:25] raunico3: has joined #RubyOnRails
[06:58:27] mbuf: sevenseacat, which just respond with JSON
[06:59:09] abuzze: has joined #RubyOnRails
[06:59:14] wsmoak_: has joined #RubyOnRails
[07:02:01] wsmoak: has joined #RubyOnRails
[07:04:50] wsmoak: has joined #RubyOnRails
[07:06:03] cac: has joined #RubyOnRails
[07:06:28] comrad: has joined #RubyOnRails
[07:07:04] alex88: has joined #RubyOnRails
[07:07:38] wsmoak_: has joined #RubyOnRails
[07:09:17] jeanlinux: has joined #RubyOnRails
[07:09:59] darrencauthon: has joined #RubyOnRails
[07:10:01] phikes: I need a pointer into the right direction. What I want to do is: When a record is updated I want the associated records to have the old data associated. Anyone got an idea?
[07:10:27] wsmoak: has joined #RubyOnRails
[07:10:45] sandstrom: has joined #RubyOnRails
[07:12:46] jeanlinux: has joined #RubyOnRails
[07:13:12] wsmoak: has joined #RubyOnRails
[07:16:02] wsmoak_: has joined #RubyOnRails
[07:16:05] rhizome: what do you mean?
[07:17:13] artto: has joined #RubyOnRails
[07:18:47] wsmoak: has joined #RubyOnRails
[07:18:47] wsmoak: has joined #RubyOnRails
[07:19:17] phikes: Say I have an Invoice that references different Items. When the price of an item changes I don't want the old invoices to pick up that price change as they would get invalid then.
[07:19:56] phikes: What I am looking for (before implementing it myself) is an auditing gem that has this capability, but I couldn't find one.
[07:20:10] jenrzzz: has joined #RubyOnRails
[07:20:34] ebbflowgo_: has joined #RubyOnRails
[07:20:51] rvanlieshout: phikes: copy those attributes to the invoice-models
[07:20:54] rvanlieshout: duplicate that data
[07:21:14] ddv: phikes, why not using something like invoice lines and store the price in the line
[07:21:38] wsmoak_: has joined #RubyOnRails
[07:21:47] rhizome: or have a price model with an association to the line_item
[07:22:39] phikes: That would solve this particular case, but there are others in my app where I have to do this. And upon creation/editing of invoices users interact with the associated models. So this would pretty much mess up my frontend.. That's why I was looking for something easier.
[07:22:59] rhizome: it's not really an "easy" thing
[07:23:14] ddv: phikes, your original design was wrong
[07:23:14] phikes: My current idea is to have a "latest" flag on the item model and upon update just create a new one and set the old ones latest flag to false
[07:23:18] rhizome: "it" == price history
[07:23:30] rvanlieshout: the best thing is just to duplicate
[07:23:32] rvanlieshout: when it comes to invoices
[07:23:47] rhizome: yes, my other idea was: new price == new item
[07:23:59] rhizome: and an 'inactive' type flag
[07:24:23] phikes: I encountered this so many times and always wondered if noone made a gem out of that..
[07:24:26] wsmoak: has joined #RubyOnRails
[07:24:26] wsmoak: has joined #RubyOnRails
[07:24:42] ddv: phikes, you want a gem to wipe your butt too?
[07:24:53] ddv: phikes, this is just standard crud
[07:25:02] phikes: ddv: men calm down :D..
[07:25:48] rhizome: it's not just standard crud
[07:25:50] phikes: ddv: and all the code we write somewhere breaks down to assembler.. what are you trying to tell me? If you just want to offend me please refrain and let me have a normal conversation with other.
[07:26:15] phikes: btt I think I will go the way of adding a flag
[07:26:27] phikes: possibly packing it into a gem in the end and making it available to others
[07:26:41] rvanlieshout: it's just before_create
[07:26:45] rhizome: you might look into ancestry type gems and see if there's a way to associate to older models
[07:26:46] rvanlieshout: self.foobar = relationship.foobar
[07:27:11] wsmoak_: has joined #RubyOnRails
[07:27:26] rvanlieshout: invoices should contain snapshot data of related stuff
[07:27:35] phikes: It's really not that easy rvanlieshout. What about show actions? I need to find a mechanism to render only the latest records of a model
[07:27:44] rvanlieshout: phikes: you don't have to do that
[07:27:51] rvanlieshout: an invoice has it's own attributes
[07:27:55] phikes: s/show/index
[07:28:05] rvanlieshout: your other objects just have it's current state
[07:28:15] rvanlieshout: so there is nothing that changes about them
[07:28:31] dhjondoh: has joined #RubyOnRails
[07:28:34] ddv: rvanlieshout, 'should', 'the bet thing is'.... because? any arguments, these are all tradeoffs but very simple to implement phikes
[07:29:07] sandelius: has joined #RubyOnRails
[07:29:45] phikes: I think I found a pretty general solution (regarding ruby's way of doing things) to implement what I am after. I just wanted to see if such solutions already exist.
[07:29:49] phikes: Thanks for your help ;-)
[07:29:56] ddv: it has nothing to do with ruby
[07:30:00] wsmoak: has joined #RubyOnRails
[07:30:22] phikes: Yes it has. I am talking of convention over configuration and thus making it work in 80% of the cases.
[07:30:27] rvanlieshout: any solution that doesn't copy the data to the invoice-model(s) is potentially unsafe
[07:30:40] phikes: Because you could always argue that my approach needs a lot of space etc
[07:30:54] phikes: but for 80% of the people using ror that would not matter (imho)
[07:31:00] bruno-: has joined #RubyOnRails
[07:31:00] rvanlieshout: so it's the simplest and safes solution for invoices
[07:31:03] phikes: thats what i mean by ruby's way of things
[07:31:17] phikes: rvanlieshout: Why would it be unsafe?
[07:31:37] rvanlieshout: because that history mechanism on item should work in theory but always seem to fail at a certain point
[07:31:41] rvanlieshout: and invoices are snapshots
[07:31:42] phikes: See, database-wise it's a horrible solution to duplcate another model's columns
[07:31:50] rvanlieshout: it's not a duplication
[07:31:52] rvanlieshout: it's a snapshot
[07:31:59] rhizome: rvanlieshout: how much should be in the invoice? all line_item data and prices?
[07:32:24] rvanlieshout: at least anything you need when presenting an invoice
[07:32:39] rvanlieshout: even the customer's name and address
[07:32:54] wsmoak_: has joined #RubyOnRails
[07:32:57] phikes: You are preventing optimizations that way.. normalization etc
[07:33:11] rhizome: phikes: you're already well into denormalization
[07:33:16] rvanlieshout: cause it's a snapshot
[07:33:21] phikes: rvanlieshout: Please don't do it like that
[07:33:27] phikes: That is relly the worst solution
[07:33:36] phikes: And I am not into denormalization
[07:33:45] rhizome: you'd better be
[07:33:53] phikes: Upon copying I prevent denormalization
[07:33:54] rvanlieshout: until you find yourself in a situation where you have an invoice and unable to fetch the related data
[07:33:55] rhizome: it's not a bad word
[07:34:06] phikes: Of course not, but it's a bad thing
[07:34:55] rhizome: it's a choice, a huge gray area
[07:35:01] sandstrom: has joined #RubyOnRails
[07:35:39] wsmoak: has joined #RubyOnRails
[07:35:40] phikes: Thanks for your input, I am back to work now :)
[07:35:43] ddv: rvanlieshout, and why would you be unable to fetch associated data? sounds more like a design problem of your application
[07:36:00] rvanlieshout: ddv: because you've thought of the history system and in theory it all works well
[07:36:05] rvanlieshout: but that one day it didn't for some reason
[07:36:26] tubbo`: has joined #RubyOnRails
[07:37:30] futilegames: has joined #RubyOnRails
[07:37:30] phikes: This is pretty much the description of any software ^^
[07:37:42] rvanlieshout: so you know it's going to happen
[07:37:44] TinkerTyper: has joined #RubyOnRails
[07:37:46] rvanlieshout: and invoices are a different thing imo
[07:38:00] rvanlieshout: they should just be right
[07:38:25] wsmoak_: has joined #RubyOnRails
[07:38:30] rvanlieshout: when the irs asks you about an invoice you've sent three years ago...
[07:39:17] ddv: yeah just snapshot/copy everything and forget about relational databases lol
[07:40:14] rhizome: you're kind of hung up on that. invoices should essentially be frozen, as if saved to a text file
[07:40:42] rvanlieshout: using a file is also a way in creating a snapshot
[07:40:47] rvanlieshout: doesn't have to be in the db
[07:41:03] Contigi: has joined #RubyOnRails
[07:41:09] rvanlieshout: ddv: there is no realtion between the invoice back then and the current item
[07:41:14] wsmoak: has joined #RubyOnRails
[07:41:21] rvanlieshout: besides that it was originally based on that item
[07:41:54] rvanlieshout: that time difference has a huge impact on what that relationship means
[07:44:02] wsmoak: has joined #RubyOnRails
[07:44:59] krz: has joined #RubyOnRails
[07:45:32] siemprefresco: has joined #RubyOnRails
[07:46:48] wsmoak: has joined #RubyOnRails
[07:49:38] wsmoak_: has joined #RubyOnRails
[07:52:27] wsmoak: has joined #RubyOnRails
[07:52:45] siemprefresco: has joined #RubyOnRails
[07:53:57] braincrash: has joined #RubyOnRails
[07:55:12] wsmoak: has joined #RubyOnRails
[07:56:02] zenspider: has joined #RubyOnRails
[07:56:52] Dopagod: has joined #RubyOnRails
[07:57:29] zenspider: ARGH the asset pipeline is a nightmare and it is driving me bonkers. I'm upgrading a client from rails 3 to 4 and getting a BUNCH of encoding errors (less-rails trying to import a font file) followed by a BUNCH of files not found. Is this a known set of issues with a known solution or am I up shit creek?
[07:57:58] wsmoak_: has joined #RubyOnRails
[07:58:15] x-light: has joined #RubyOnRails
[08:00:43] ndrei_: has joined #RubyOnRails
[08:00:49] wsmoak: has joined #RubyOnRails
[08:01:09] jsrn_: has joined #RubyOnRails
[08:03:36] wsmoak_: has joined #RubyOnRails
[08:03:53] raunicolae: has joined #RubyOnRails
[08:04:03] rromanchuk: has joined #RubyOnRails
[08:04:37] eGGsha: has joined #RubyOnRails
[08:04:44] cha1tanya: has joined #RubyOnRails
[08:05:34] chouhoulis: has joined #RubyOnRails
[08:06:02] drPoggs: has joined #RubyOnRails
[08:06:10] elektronaut: has joined #RubyOnRails
[08:06:24] wsmoak: has joined #RubyOnRails
[08:06:24] wsmoak: has joined #RubyOnRails
[08:07:30] tubbo`: has joined #RubyOnRails
[08:09:09] wsmoak_: has joined #RubyOnRails
[08:10:07] adre: has joined #RubyOnRails
[08:10:21] darutoko: has joined #RubyOnRails
[08:11:07] darrencauthon: has joined #RubyOnRails
[08:11:18] dc1: has joined #RubyOnRails
[08:11:57] wsmoak: has joined #RubyOnRails
[08:12:45] Hates_: has joined #RubyOnRails
[08:12:56] Hates_: has joined #RubyOnRails
[08:14:33] simrat: has joined #RubyOnRails
[08:14:45] wsmoak_: has joined #RubyOnRails
[08:17:35] wsmoak: has joined #RubyOnRails
[08:20:26] wsmoak: has joined #RubyOnRails
[08:21:31] Ergo: has joined #RubyOnRails
[08:22:01] rrawlins: has joined #RubyOnRails
[08:23:08] wsmoak_: has joined #RubyOnRails
[08:23:15] speaking1ode: has joined #RubyOnRails
[08:24:30] cac: has joined #RubyOnRails
[08:26:00] wsmoak: has joined #RubyOnRails
[08:26:31] rikkipitt: has joined #RubyOnRails
[08:28:08] rikkipitt: hey guys, what's a good way of appending html before a closing tag in some other html?
[08:28:38] rvanlieshout: rikkipitt: rendering a partial?
[08:28:48] wsmoak: has joined #RubyOnRails
[08:29:11] rikkipitt: rvanlieshout: it's html from the database, but I'd like to add a "Read more..." link inline at the end of it
[08:29:30] arup_r: has joined #RubyOnRails
[08:29:34] rvanlieshout: and it's a full html page in the db
[08:30:56] rrawlins: Morning All. What are people preferences for enforcing SSL? At a web-server level? In Rack using Rack::SSLEnforcer? Rails config.force_ssl? A combination?
[08:31:22] rrawlins: Assuming it's a Rails 4 app, running on something like Unicorn.
[08:31:31] wsmoak_: has joined #RubyOnRails
[08:31:40] lessless: has joined #RubyOnRails
[08:31:46] bruno-: has joined #RubyOnRails
[08:32:22] arup_r1: has joined #RubyOnRails
[08:33:14] zenspider: has left #RubyOnRails: ("ERC Version 5.3 (IRC client for Emacs)")
[08:33:48] rikkipitt: rvanlieshout: no, just a summary for a post...
[08:35:56] lethjakman: has joined #RubyOnRails
[08:37:35] bobbobbins: has joined #RubyOnRails
[08:38:26] rrawlins: rvanlieshout: thanks for the tip. Any specific reason?
[08:39:08] tvw: has joined #RubyOnRails
[08:40:29] aceRacer: has joined #RubyOnRails
[08:40:33] ur5us: has joined #RubyOnRails
[08:43:17] jamey-uk: has joined #RubyOnRails
[08:43:30] workmad3: has joined #RubyOnRails
[08:43:48] jamey-uk: I get the error "mail destination not given" when trying to send an email but only on production. What might I be doing wrong?
[08:44:22] sevenseacat: jamey-uk: not giving a mail destination
[08:44:39] aceRacer: I am going to make a simple table for conversation between two users, so I was thinking, I can have a table conversations, sender_id, reciever_id, msg_content; and then User has_many :sent_messages, foreign_key :sender_id, class_name: "User" and User has_many :recieved_messages, fk :reciever_id, class_name: "User" :(
[08:44:46] jamey-uk: sevenseacat: but I appear to be giving one, it's clearly shown in the airbrake dump
[08:44:58] sevenseacat: jamey-uk: got any code, error, anything for us to see?
[08:45:27] lxsameer: has joined #RubyOnRails
[08:46:43] jamey-uk: sevenseacat: http://i.imgur.com/YvONhvJ.png
[08:47:24] sevenseacat: jamey-uk: ok, so in code not in screenshot, where are you setting the mail destination?
[08:48:13] jamey-uk: sevenseacat: sorry, here in this mailer class: http://pastebin.com/7AKZph4Q
[08:48:27] aceRacer: would it be ok? what better naming can I use than sent_messages and recieved_messages
[08:48:47] jamey-uk: sevenseacat: or even here https://gist.github.com/anonymous/48e156bf3a4de3dafa5e (sorry helpa...)
[08:48:51] Dopagod: has joined #RubyOnRails
[08:48:52] Dopagod: has joined #RubyOnRails
[08:49:56] sevenseacat: jamey-uk: and what is user ?
[08:50:52] jamey-uk: sevenseacat: it's passed through on line 122 of the user.rb model, i.e. 'self'
[08:51:04] sevenseacat: jamey-uk: yes, but what *is* it?
[08:51:14] sevenseacat: something that doesnt have an email set, apparently
[08:51:21] jamey-uk: how can I debug that on production?
[08:51:29] n008f4g_: has joined #RubyOnRails
[08:51:48] sevenseacat: err, you wouldn't, you'd debug it in development
[08:51:49] RegulationD: has joined #RubyOnRails
[08:51:58] jamey-uk: exactly, but this issue never occurs
[08:52:24] anthonys1: has joined #RubyOnRails
[08:52:31] sevenseacat: with the exact same code and data?
[08:53:10] sevenseacat: it looks like it is happening in development, given by that screenshot, unless you're making errors publicly available
[08:53:23] jamey-uk: yes, I was making errors publicly available
[08:53:35] jamey-uk: trying now again and making sure it's the exact same data
[08:53:44] sevenseacat: I'd turn that off right now.
[08:54:51] jamey-uk: sevenseacat: yeah I just tried it with identical data, the development opens the generated email with letter_opener, the production one gives the "mail destination not given" error.
[08:55:00] sevenseacat: jamey-uk: same code?
[08:55:39] jamey-uk: yes, same commit
[08:57:43] bin_005: has joined #RubyOnRails
[08:58:04] startupality: has joined #RubyOnRails
[08:58:28] sevenseacat: can you gist the full backtrace from the error - just grab it from airbrake
[08:59:17] weckl: has joined #RubyOnRails
[08:59:58] jamey-uk: sevenseacat: https://gist.github.com/anonymous/38fce094604b33bee527
[09:00:33] sevenseacat: `to` has to be nil, so the user you're using doesn't have an email set
[09:00:54] sevenseacat: do you have some email middleware you're only using in production or something?
[09:01:05] Trefex: has joined #RubyOnRails
[09:01:28] jamey-uk: in terms of production-only gems, I only have puma, pg and rails_12factor
[09:01:48] jamey-uk: for dev and test, the only email-related gem I have is letter_opener
[09:06:28] chouhoulis: has joined #RubyOnRails
[09:07:46] sevenseacat: so thats a yes or no to the middleware question?
[09:07:49] abuzze: has joined #RubyOnRails
[09:08:14] tubbo`: has joined #RubyOnRails
[09:09:01] sevenseacat: like, middleware that adds a cc/bcc list or something
[09:10:49] jamey-uk: sevenseacat: that's a no I think, this is my first rails project so it's relatively simple
[09:10:51] abdulsattar: has joined #RubyOnRails
[09:11:53] darrencauthon: has joined #RubyOnRails
[09:13:07] marr: has joined #RubyOnRails
[09:14:34] sevenseacat: well that error only gets raised if you provide a list of `to` addresses and its either empty or they're all invalid addresses
[09:15:34] sevenseacat: and yours is the latter - all invalid addresses
[09:15:40] sevenseacat: https://github.com/ruby/ruby/blob/v2_2_0/lib/net/smtp.rb#L857
[09:15:56] sevenseacat: have you configured your smtp server correctly?
[09:16:07] sevenseacat: how are you sending email? are all emails broken, or just this one?
[09:16:32] jamey-uk: sevenseacat: I'll check, it was working fine but maybe the env variables got lost
[09:17:31] jamey-uk: sevenseacat: yep, the SMTP username/password environment variables have gone
[09:18:18] xhoy: has joined #RubyOnRails
[09:18:20] sevenseacat: thats not a great error message
[09:18:27] jamey-uk: yeah, not really???
[09:19:14] jamey-uk: it's not best practise to put the SMTP details in the environment config file, but it seems like a better idea
[09:20:11] sevenseacat: mmmm I wouldn't do that
[09:20:23] Moonlight-Angel: has joined #RubyOnRails
[09:20:47] jamey-uk: yeah not gonna, just frustrating??? I'll add a tidbit to the readme so I don't forget :)
[09:22:00] abuzze: has joined #RubyOnRails
[09:22:05] aceRacer: But there is one thing I can't think properly is how do I ensure the two users' are friends ? should there be a through :friends in the association too?
[09:24:08] jamey-uk: sevenseacat: apparently using ENV.fetch in my production config will raise an error
[09:26:44] microdex: has joined #RubyOnRails
[09:27:10] sevenseacat: aceRacer: sounds like a validation on whatever your object is
[09:27:18] sevenseacat: if the two users arent friends, then its not valid
[09:27:36] abuzze: has joined #RubyOnRails
[09:27:57] sevenseacat: jamey-uk: i didnt know that, but normally I just use ENV["whatever"] || "whatever"
[09:28:21] sevenseacat: or even leave off the || "whatever"
[09:29:02] jamey-uk: sevenseacat: yeah I've got ENV['whatever'] at the moment and it doesn't throw up anything when they're not set
[09:29:23] jamey-uk: I'm deploying to a dokku instance, it won't even let me 'git push dokku' now :)
[09:29:40] sevenseacat: ENV["whatever"] || raise("oh shit") ? I dunno
[09:30:01] sevenseacat: an initializer that raises an exception if they're not set?
[09:30:40] jamey-uk: good idea, giving it a go now
[09:31:18] jamey-uk: yep it still aborts the deployment but gives me a nice clear error
[09:31:36] aceRacer: oh, ok.. thanks.. sevenseacat
[09:31:50] sevenseacat: clear errors are good.
[09:32:33] bruno-: has joined #RubyOnRails
[09:33:02] abuzze: has joined #RubyOnRails
[09:33:51] workmad3: has joined #RubyOnRails
[09:34:32] anjen: has joined #RubyOnRails
[09:35:49] srinidhi: has joined #RubyOnRails
[09:38:00] dnewkerk_: has joined #RubyOnRails
[09:44:31] eGGsha: has joined #RubyOnRails
[09:44:47] Jasaka|NA: has joined #RubyOnRails
[09:45:32] Lightsword: has joined #RubyOnRails
[09:53:19] jenrzzz: has joined #RubyOnRails
[09:56:19] dhjondoh: has joined #RubyOnRails
[09:57:17] man_in_the_b0x: has joined #RubyOnRails
[09:57:22] alex88: has joined #RubyOnRails
[09:57:45] tvw: has joined #RubyOnRails
[09:58:19] User458764: has joined #RubyOnRails
[09:59:07] jamey-uk: has joined #RubyOnRails
[10:01:31] stamina: has joined #RubyOnRails
[10:07:17] chouhoulis: has joined #RubyOnRails
[10:08:05] benhuda: has joined #RubyOnRails
[10:09:07] tubbo`: has joined #RubyOnRails
[10:10:51] eGGsha: has joined #RubyOnRails
[10:12:29] masscrx: can anybody help me with authentication ?
[10:12:39] darrencauthon: has joined #RubyOnRails
[10:17:18] masscrx: I have problem with understand authentication on rails and js framework
[10:17:42] masscrx: I know that js framework needs to send pass & email to rails and get response with token
[10:18:07] masscrx: but I dont know how to generate view with form, by rails or by js framework ?
[10:18:32] nya: has joined #RubyOnRails
[10:19:41] nya: has joined #RubyOnRails
[10:20:30] rickmasta: has joined #RubyOnRails
[10:22:57] strcmp1: has joined #RubyOnRails
[10:24:40] lethjakman: has joined #RubyOnRails
[10:25:30] zorak8: has joined #RubyOnRails
[10:25:31] speaking1ode: has joined #RubyOnRails
[10:28:13] microdex: has joined #RubyOnRails
[10:32:07] mostlybadfly: has joined #RubyOnRails
[10:32:08] Ropeney: has joined #RubyOnRails
[10:33:18] bruno-: has joined #RubyOnRails
[10:33:30] benhuda: has joined #RubyOnRails
[10:34:01] cac: has joined #RubyOnRails
[10:36:24] vasilakisFiL: has joined #RubyOnRails
[10:36:31] frishi: has joined #RubyOnRails
[10:37:01] vasilakisFiL: hi! is anyone using docker for development or production or both?
[10:37:39] leslie: I use a Rails engine for storing models shared between sites. How can I configure rspec to run both the tests in the current site and the tests in the engine?
[10:38:54] atrius: has joined #RubyOnRails
[10:39:02] Detch: has joined #RubyOnRails
[10:40:35] RegulationD: has joined #RubyOnRails
[10:41:35] jeanlinux: has joined #RubyOnRails
[10:41:45] lxsameer: has joined #RubyOnRails
[10:43:17] [gmi]: has joined #RubyOnRails
[10:46:17] sankaber: has joined #RubyOnRails
[10:52:17] thelastinuit: has joined #RubyOnRails
[10:55:21] darrencauthon: has joined #RubyOnRails
[10:58:44] eGGsha: has joined #RubyOnRails
[10:58:54] nettoweb: has joined #RubyOnRails
[11:00:10] rodfersou: has joined #RubyOnRails
[11:00:31] sandstrom: has joined #RubyOnRails
[11:00:41] bullcitydev: has joined #RubyOnRails
[11:03:34] abdulsattar: has left #RubyOnRails: ()
[11:04:15] sandstrom: has joined #RubyOnRails
[11:07:16] startupality: has joined #RubyOnRails
[11:07:49] cobranet: has joined #RubyOnRails
[11:08:50] artto: has joined #RubyOnRails
[11:09:50] tubbo`: has joined #RubyOnRails
[11:11:35] ndrei: has joined #RubyOnRails
[11:11:44] fgo: has joined #RubyOnRails
[11:11:48] mikecmpbll: has joined #RubyOnRails
[11:13:57] wethu: has joined #RubyOnRails
[11:14:26] six: has joined #RubyOnRails
[11:16:03] wsmoak: has joined #RubyOnRails
[11:16:03] wsmoak: has joined #RubyOnRails
[11:16:34] hardtail: has joined #RubyOnRails
[11:16:58] anthonys1: has joined #RubyOnRails
[11:19:56] mikecmpbll: eugh. if you still use the secret_token.rb initializer for your secret_key_base don't try and access Rails.application.secrets in an initializer that runs before the secret_token.rb.
[11:20:04] jamon_: has joined #RubyOnRails
[11:20:16] mikecmpbll: or you'll stop rails from assigning the secret_key_base correctly.
[11:20:24] mikecmpbll: took me a day to work out what was going on there :'(
[11:20:30] cajone: has joined #RubyOnRails
[11:21:55] momomomomo: has joined #RubyOnRails
[11:22:54] wethu: has joined #RubyOnRails
[11:23:36] voker57: has joined #RubyOnRails
[11:25:02] diegoviola: has joined #RubyOnRails
[11:25:22] nettoweb: has joined #RubyOnRails
[11:27:01] wsmoak: has joined #RubyOnRails
[11:27:01] wsmoak: has joined #RubyOnRails
[11:29:00] microdex: has joined #RubyOnRails
[11:30:50] lessless: has joined #RubyOnRails
[11:35:03] dici: has joined #RubyOnRails
[11:36:18] Schalla: has joined #RubyOnRails
[11:37:03] artto: has joined #RubyOnRails
[11:37:19] rickmasta: has joined #RubyOnRails
[11:37:20] rustymyers: has joined #RubyOnRails
[11:37:54] frishi: has joined #RubyOnRails
[11:40:46] quazimodo: has joined #RubyOnRails
[11:42:18] jeanlinux: has joined #RubyOnRails
[11:42:43] bruno-: has joined #RubyOnRails
[11:42:47] hardtail: has joined #RubyOnRails
[11:43:24] sonOfRa: has joined #RubyOnRails
[11:46:35] DoubleMalt: has joined #RubyOnRails
[11:47:11] suy: has joined #RubyOnRails
[11:47:26] jeromelanteri: has joined #RubyOnRails
[11:48:18] MEATCHICKEN: has joined #RubyOnRails
[11:48:25] kaspernj: has joined #RubyOnRails
[11:48:34] aceRacer: someone please revive proxylocal gem
[11:49:57] JoshL: has joined #RubyOnRails
[11:50:30] Hates_: aceRacer: does it no longer work?
[11:50:52] Hates_: aceRacer: personally I use https://ngrok.com now
[11:51:01] Hates_: aceRacer: https is a real nice feature
[11:51:23] jeromelanteri: i search good design patern practice for do some pages dependent of type of content: i have a "works" controller and model... then i "AddTypeToWorks type:string in my model. then i have a nav bar can dropdown and supposed to let me go on index pages of "Works" by type content. What's the good practice with keep my controller Works and add roots and type order list ?
[11:51:46] aaronr: has joined #RubyOnRails
[11:51:51] pontiki: has joined #RubyOnRails
[11:52:11] radialneon: has joined #RubyOnRails
[11:53:04] jeromelanteri: for exemple, i have many works... ok, index let me see them. but from link rooted specific, depend of type of works, i would like to see index for only type of content. how to do that ? do you know a link show it ?
[11:54:19] Hates_: jeromelanteri: you just filter them in the controller
[11:54:26] jeromelanteri: i think i need to pass a params[:type] to index... and create the roots... right ?
[11:54:27] Hates_: jeromelanteri: pass in some paramter
[11:55:08] jeromelanteri: for parameters, i think i see how to do and catch in the controller, but for the routes ? i don't know.
[11:55:32] jeromelanteri: i search a link who can teach me that.
[11:55:59] Hates_: jeromelanteri: you don't have to add anything extra to your routes if just passing in a parameter
[11:56:20] jeromelanteri: Hates_: Rails do it automaticaly for me ?
[11:56:27] Hates_: jeromelanteri: yes
[11:56:36] Hates_: jeromelanteri: just try it and see, you will see the parameter in the logs
[11:56:46] jeromelanteri: very good. and for link8to for dropdown menu... ?
[11:57:13] jeromelanteri: what could be the name of the patch ?
[11:57:14] Hates_: jeromelanteri: just link_to "X", your_path(work_type: "x")
[11:57:31] jeromelanteri: very good. thank you Hates_
[11:58:15] ldnunes: has joined #RubyOnRails
[11:58:31] jeromelanteri: so looks like (if i well understand) link_to 'electronic', works_path(type: "electronic') ?
[11:58:40] Hates_: jeromelanteri: try it and see :)
[11:58:48] jeromelanteri: ok, thank you.
[11:59:19] voodo: has joined #RubyOnRails
[12:02:50] voodo: has left #RubyOnRails: ()
[12:03:00] voodo: has joined #RubyOnRails
[12:04:17] acti0nman: has joined #RubyOnRails
[12:04:31] erich: has joined #RubyOnRails
[12:04:36] voodo: has joined #RubyOnRails
[12:07:39] voodo: I'm having a strange problem that i can't manage to solve. Rails return me this error: File to import not found or unreadable: susy. So in short it can't load susy and breakpoints (an other css lib). this project has it's own gemset, i'm using rubinius and the susy and breakpoints file are phisically preset in the gem list but it still says it can't find them.
[12:07:40] benhuda: has joined #RubyOnRails
[12:08:04] chouhoulis: has joined #RubyOnRails
[12:09:07] Brom: has joined #RubyOnRails
[12:09:12] eGGsha: has joined #RubyOnRails
[12:10:34] tubbo`: has joined #RubyOnRails
[12:11:33] elektronaut: has joined #RubyOnRails
[12:11:57] drPoggs: has joined #RubyOnRails
[12:12:15] rustymye_: has joined #RubyOnRails
[12:13:27] lethjakman: has joined #RubyOnRails
[12:13:39] Brom: Hey everyone! I???m a bit of a noob and am having trouble writing an activerecord query to return rows where the current time is between the times in columns ???open??? and ???close???(which are of type time). Any help would be greatly appreciated
[12:15:08] shyshy: has joined #RubyOnRails
[12:15:23] Brom: I???ve currently got .where(???? BETWEEN open and close???, @current_time)
[12:21:20] simrat: has joined #RubyOnRails
[12:21:23] bhorn1: has joined #RubyOnRails
[12:22:26] yaymukund: has joined #RubyOnRails
[12:23:35] choke: has joined #RubyOnRails
[12:23:54] lessless: has joined #RubyOnRails
[12:25:43] jeromelanteri: Brom: did you try to test first on rails console ?
[12:28:01] jeromelanteri: Brom: znf zldo, do you add ".take" at the end ?
[12:28:12] jeromelanteri: end then... (sorry)
[12:28:29] Brom: I???ve been playing around on the console trying to get something to work
[12:29:02] jeromelanteri: so if you have a model well linked to the database, and your console show you a result, then this works fine.
[12:29:04] Brom: I haven???t used ???.take???
[12:29:23] jeromelanteri: .take give you back the content of the answer... if not, you have an object.
[12:29:29] RegulationD: has joined #RubyOnRails
[12:29:33] moeabdol: has joined #RubyOnRails
[12:29:42] microdex: has joined #RubyOnRails
[12:29:57] Deck`: has joined #RubyOnRails
[12:29:57] Brom: okay???thanks for your help!
[12:30:04] jeromelanteri: without .take, you can uyse this object inside a loop
[12:30:28] Brom: it???s being used in a loop
[12:30:59] Deck`: Hi! I have a User model. It belongs to Team model. How to select all users from two teams give I have array of team names?
[12:31:14] jeromelanteri: so you can first use .where(...) and then use the object in the loop for answer
[12:31:51] Brom: yup???it???s just trying to get my query to return the object that???s giving me the issue
[12:32:10] jeromelanteri: look at his here: http://guides.rubyonrails.org/active_record_querying.html
[12:32:49] jeromelanteri: Brom: there is also a gem can give you a nice view of datas the console give back...
[12:33:07] Brom: cool???what gem would that be?
[12:33:17] jeromelanteri: (i not remember the name, but little search in 'rails gems' will show you wich is
[12:33:28] Brom: k, thanks
[12:34:20] voodo: has joined #RubyOnRails
[12:37:05] cajone: has left #RubyOnRails: ()
[12:38:31] simrat: has joined #RubyOnRails
[12:41:18] El3ktra: has joined #RubyOnRails
[12:43:17] ndrei: has joined #RubyOnRails
[12:44:29] Brom: @jeromelanteri: I think that my problem involves the fact that my columns are storing complete timestamps, so the years are throwing it off and no matches are returned. Is there a way to base the query on just the hour and minute values of the columns?
[12:46:16] eggoez: has joined #RubyOnRails
[12:46:27] bullcitydev: has joined #RubyOnRails
[12:46:44] guillaume-rb: has joined #RubyOnRails
[12:47:28] shyshy: has joined #RubyOnRails
[12:49:15] vedu: Hello. I am getting this error with my polymorphic associations "...column 'type' is reserved for storing the class in case of inheritance ". code: https://gist.github.com/vedant1811/4323ff187326442a101d
[12:50:03] moeabdol: has joined #RubyOnRails
[12:52:14] jeromelanteri: Brom: yes, maybe there is some different way.
[12:53:06] rvanlieshout: vedu: what are you trying to do in that migration?
[12:53:06] jeromelanteri: first you have to compare with sql through activerecord, and then form the answer to have what you search to show
[12:53:14] jimbeaudoin: vedu: in your migration you try to rename your column with the name type
[12:53:30] jimbeaudoin: you cant do that
[12:53:51] jimbeaudoin: this is a reserved keyword
[12:54:22] workmad3: jimbeaudoin: unless you change the STI column in your model
[12:55:18] jeromelanteri: Brom: you can make in form at the end with .strftime('%H:%M')
[12:55:36] workmad3: self.inheritance_column = "something_else" <-- lets you use 'type' as a column name for your own purposes, not STI
[12:55:50] vedu: jeromelanteri, rvanlieshout: yeah. I used 'category' instead of 'type' and everthing worked fine :)
[12:56:12] jenrzzz: has joined #RubyOnRails
[12:56:31] wasamasa: has joined #RubyOnRails
[12:57:00] microdex: has joined #RubyOnRails
[12:57:01] wasamasa: not sure why I get a notice by chanserv although I'm already identified, but ok
[12:57:27] surrealanalysis: has joined #RubyOnRails
[12:57:55] wasamasa: I'm currently working on a rails project with loads of migrations (83) and have found a rather puzzling oddity
[12:58:21] wasamasa: if I run rake db:drop && rake db:migrate && rake db:seed, the initialization of the database goes perfectly well
[12:58:26] jeromelanteri: Brom: but i'm not sure to understand what's your problem... if the problem is the data tyoe of your columns inside the tables from database, this is because you not use the good way from Rails migration. I have some columns (like created_at and others who works fine... look at them in db migration files
[12:58:41] wasamasa: however if I have a rake task with these three as prerequisites and run that, it fails at the seed stage
[12:59:20] wasamasa: replacing db:migrate with db:schema:load works, but isn't perfect as it's easy to forget to migrate for updating schema.rb
[12:59:38] Brom: jeromelanteri: I???ll do that???thanks again
[12:59:49] eGGsha: has joined #RubyOnRails
[12:59:58] wasamasa: could anyone explain what can go wrong when running database initialization tasks in an automated manner?
[13:00:14] chipotles: has joined #RubyOnRails
[13:00:35] jordanstorz: has joined #RubyOnRails
[13:00:59] Kedric: has joined #RubyOnRails
[13:01:37] arup_r: has joined #RubyOnRails
[13:01:50] slash_nick: wasamasa: fails at the seed stage? might want to show us a stack trace (and maybe the rake task)
[13:02:10] chipotles: has joined #RubyOnRails
[13:02:35] wasamasa: slash_nick: yes, if I do printf-debugging, I see that in the first version I get a correctly migrated database object and in the second one an incompletely migrated one
[13:02:51] wasamasa: slash_nick: so the backtrace tells me I'm trying to use an attribute of it that doesn't exist
[13:03:13] wasamasa: the task is "task :all => %w[db:drop db:migrate db:seed]"
[13:04:43] wasamasa: what I'm asking for is whether there are any known reasons for these two to behave differently
[13:05:18] arup_r: has joined #RubyOnRails
[13:05:49] _blizzy_: has joined #RubyOnRails
[13:05:51] anthonys1: has joined #RubyOnRails
[13:05:57] _blizzy_: has left #RubyOnRails: ("Leaving")
[13:06:43] wasamasa: I've also grabbed the migration debug output and it's the same for both, save the timings
[13:06:45] slash_nick: wasamasa: stack trace
[13:07:03] wasamasa: slash_nick: the stack trace is useless as it only tells you that a method wasn't found
[13:07:04] k4nd4lf: has joined #RubyOnRails
[13:07:26] slash_nick: wasamasa: same for both? i thought create->migrate->seed worked when done by hand, but failed when done in rake task
[13:07:41] slash_nick: wasamasa: it tells you that a column wasn't found.
[13:08:04] arup_r: Guys any hints... what is going wrong ? http://stackoverflow.com/questions/31183449/why-getting-empty-css-files-in-production
[13:08:09] cac: has joined #RubyOnRails
[13:08:33] wasamasa: "ActiveRecord::UnknownAttributeError: unknown attribute: title_en"
[13:09:04] wasamasa: and a NoMethodError a bit below that
[13:10:06] slash_nick: wasamasa: what did you mean "it's the same for both"?
[13:10:30] Trefex: has joined #RubyOnRails
[13:10:43] wasamasa: slash_nick: as both run db:migrate at some time, they emit a log to STDOUT of the migrations they do
[13:10:55] wasamasa: slash_nick: which is the same save the timings
[13:11:19] tubbo`: has joined #RubyOnRails
[13:12:00] slash_nick: wasamasa: i'm still confused... is it true that migrations fail when done from the command line as well as when done by launching your rake task?
[13:12:15] ekain: has joined #RubyOnRails
[13:12:24] jordanstorz: has joined #RubyOnRails
[13:12:43] bmurt: has joined #RubyOnRails
[13:13:08] wasamasa: slash_nick: no, migrations work for both, but the rake task fails seeding while executing seeding manually works
[13:13:47] DEA7TH: has joined #RubyOnRails
[13:14:03] slash_nick: wasamasa: Did you say that "rake db:setup" does not fail?
[13:14:16] lethjakman: has joined #RubyOnRails
[13:14:16] wasamasa: slash_nick: I didn't write anything about db:setup at all
[13:14:32] jamey-uk: has joined #RubyOnRails
[13:15:03] Silex: wasamasa: iirc, you need to reload!
[13:15:11] slash_nick: wasamasa: ah, you kind of did without knowing... you said rake db:schema:load works but isn't perfect... rake db:setup calls rake db:create;rake db:schema:load;rake db:seed
[13:15:38] wasamasa: slash_nick: but that doesn't update schema.rb if there is some newer migration
[13:16:10] wasamasa: Silex: is that some standard rake task?
[13:16:14] slash_nick: wasamasa: i think that your seeds make use of some column that is not created as a result of only running migrations
[13:16:49] DEA7TH: My routes are not working when they really should. Is my syntax incorrect: get '/digi', to: 'welcome#index' start the server via: rails s -b -p 8899 then visit: http://localhost/digi:8899
[13:17:01] Silex: wasamasa: http://stackoverflow.com/questions/1890709/combining-many-rake-tasks-into-one-rake-task
[13:17:05] rvanlieshout: DEA7TH: http://localhost:8899/digi
[13:17:08] slash_nick: wasamasa: that column *is* in your schema... when you run rake db:drop;rake db:create; rake db:migrate, is there a change to your schema? any missing columns when you do `git diff db/schema.rb`?
[13:17:13] voodo: I'm having a strange problem that i can't manage to solve. Rails return me this error: File to import not found or unreadable: susy. So in short it can't load susy and breakpoints (an other css lib). this project has it's own gemset, i'm using rubinius and the susy and breakpoints file are phisically preset in the gem list but it still says it can't find them.
[13:17:25] DEA7TH: I knew it was something stupid ^^
[13:17:26] Silex: wasamasa: if I recall correctly, the problem is simply that your env is not reloaded after the migration
[13:17:34] wasamasa: Silex: oh, that could indeed be the case
[13:17:46] Silex: wasamasa: try with the syntax from the linked page
[13:17:53] Silex: which uses the shell or smth
[13:18:08] Silex: Rake::Task["db:drop"].invoke
[13:18:41] Silex: ah meh, the second answer does it like you do
[13:18:53] griffindy: has joined #RubyOnRails
[13:18:53] Silex: so I'm confused now, try to figure out what fails in the seed
[13:19:49] slash_nick: wasamasa: read my last bit
[13:20:29] startupality: has joined #RubyOnRails
[13:21:08] wasamasa: slash_nick: there is no change indicated in git
[13:21:15] Silex: wasamasa: Rake::Task['db:seed'].reenable (see https://gist.github.com/wulftone/1332577)
[13:21:23] victortyau: has joined #RubyOnRails
[13:21:25] wasamasa: Silex: and no, the alternative syntax doesn't change it
[13:23:07] Silex: wasamasa: hum, inspect your models from the seed file
[13:23:14] Silex: e.g Model.connection or Model.reload or whatever
[13:23:47] chouhoulis: has joined #RubyOnRails
[13:24:08] Silex: wasamasa: maybe the db transaction isn't over yet? :)
[13:25:47] wasamasa: Silex: migration is wrapped in a transaction that spans over to other rake tasks?
[13:25:59] wasamasa: how is that even possible
[13:26:02] nettoweb: has joined #RubyOnRails
[13:27:21] slash_nick: i'd still like to see your entire rake file... whether it be a lib/task/*.rb or your Rakefile... i don't mind running it locally and trying to reproduce your problem
[13:27:49] raunicolae: has joined #RubyOnRails
[13:28:00] wasamasa: ok guise, I think I have worked around it
[13:28:14] wasamasa: ActiveRecord::Base.descendants.each{|c| c.reset_column_information}
[13:28:17] wasamasa: from http://stackoverflow.com/questions/200813/how-do-i-force-activerecord-to-reload-a-class
[13:28:21] rickmasta: has joined #RubyOnRails
[13:28:51] wasamasa: I guess some of the migrations are pretty screwy
[13:29:12] twilling: has joined #RubyOnRails
[13:29:42] slash_nick: wasamasa: must be... i can't reproduce your problem over here. screwy how?
[13:29:47] Silex: wasamasa: I'm just exploring ideas
[13:29:54] Silex: wasamasa: I'm good at finding possible causes :)
[13:29:57] roshanavand: has joined #RubyOnRails
[13:30:18] wasamasa: Silex: thank you, I've found that while looking for what your reload! commandment may possibly refer to
[13:30:39] Silex: wasamasa: "reload!" is what you type in "rails console" to reload everything
[13:30:42] wasamasa: ACTION wonders whether to put a truly cargo-style comment over this line to make sure nobody tampers with it
[13:31:40] wasamasa: slash_nick: some of the migrations add columns to the tables
[13:31:41] Juanchito: has joined #RubyOnRails
[13:31:51] rvanlieshout: wasamasa: or just add comment about why you're doing that
[13:32:09] wasamasa: slash_nick: so, if rails assumes for some reason that the currently held table definitions are still valid although they aren't...
[13:32:57] jamiely: has joined #RubyOnRails
[13:34:56] Scripore: has joined #RubyOnRails
[13:34:59] wasamasa: slash_nick: reloading the table definitions in seeds.rb helps
[13:35:04] wasamasa: rvanlieshout: boooring
[13:36:22] bf4: has joined #RubyOnRails
[13:36:59] dhjondoh: has joined #RubyOnRails
[13:37:45] rickmasta: has joined #RubyOnRails
[13:39:19] dhjondoh: has joined #RubyOnRails
[13:40:09] jobewan: has joined #RubyOnRails
[13:41:35] sevenseacat: has joined #RubyOnRails
[13:43:04] Coldblackice: has joined #RubyOnRails
[13:43:14] bratsche: has joined #RubyOnRails
[13:44:18] darrencauthon: has joined #RubyOnRails
[13:44:40] wasamasa: rvanlieshout: but ok, I've put a more serious comment above
[13:44:59] darrenca_: has joined #RubyOnRails
[13:48:24] [H]unt3r: has joined #RubyOnRails
[13:49:30] chouhoulis: has joined #RubyOnRails
[13:51:58] sandstrom: has joined #RubyOnRails
[13:53:14] paulcsmith: has joined #RubyOnRails
[13:53:35] rickmasta: has joined #RubyOnRails
[13:56:04] cashnguns: has joined #RubyOnRails
[13:56:33] Papierkorb: has joined #RubyOnRails
[13:57:17] moeabdol: has joined #RubyOnRails
[13:58:45] jeanlinux: has joined #RubyOnRails
[13:59:28] ferr: has joined #RubyOnRails
[14:00:24] RegulationD: has joined #RubyOnRails
[14:00:55] ferr: Hey, I need to create a wiki, any suggestions what to use?
[14:01:57] cochise: has joined #RubyOnRails
[14:02:33] rvanlieshout: you need to create one, but you want to use one?
[14:06:49] Maletor: has joined #RubyOnRails
[14:09:23] Toska: has joined #RubyOnRails
[14:10:13] siddart: has joined #RubyOnRails
[14:10:21] eGGsha: has joined #RubyOnRails
[14:12:49] sye: has joined #RubyOnRails
[14:13:25] codepete: has joined #RubyOnRails
[14:13:49] RegulationD: has joined #RubyOnRails
[14:14:03] man_in_the_b0x: has joined #RubyOnRails
[14:14:18] wasamasa: has left #RubyOnRails: ("Bye")
[14:15:00] dopie: has joined #RubyOnRails
[14:15:01] lethjakman: has joined #RubyOnRails
[14:15:04] charliesome: has joined #RubyOnRails
[14:15:34] a346: has joined #RubyOnRails
[14:16:59] disgrntld: has joined #RubyOnRails
[14:19:13] weckl: has joined #RubyOnRails
[14:19:37] tubbo`: has joined #RubyOnRails
[14:21:17] bullcitydev: has joined #RubyOnRails
[14:21:35] oflannabhra: has joined #RubyOnRails
[14:24:27] erich: has joined #RubyOnRails
[14:24:34] gambl0re: has joined #RubyOnRails
[14:26:57] kies^: has joined #RubyOnRails
[14:28:26] radialneon: has joined #RubyOnRails
[14:28:37] jeanlinux: has joined #RubyOnRails
[14:30:11] bullcitydev: has joined #RubyOnRails
[14:31:35] coderhs: has joined #RubyOnRails
[14:32:09] findaway: has joined #RubyOnRails
[14:32:36] sonofdirt: has joined #RubyOnRails
[14:35:12] jeromelanteri_: has joined #RubyOnRails
[14:35:39] brain_shim: has joined #RubyOnRails
[14:36:05] krz: has joined #RubyOnRails
[14:36:44] Maletor: has joined #RubyOnRails
[14:37:08] dstarh: has joined #RubyOnRails
[14:37:57] bullcitydev: has joined #RubyOnRails
[14:39:25] kitsuneyo: has joined #RubyOnRails
[14:40:13] kitsuneyo: hi, quick question about using "_destroy" to remove fields in a form - does this tap into the destroy action on the model's controller?
[14:40:55] kitsuneyo: do i need a destroy action for it to work?
[14:41:34] sevenseacat: it doesnt, no.
[14:41:49] sevenseacat: its all done in the model layer
[14:42:05] kitsuneyo: ah, hi sevenseacat. thanks for that.
[14:42:28] kitsuneyo: i don't know if you remember helping me the other day but i got my embedded form working :D
[14:43:47] startupality: if one rails method/route takes around 8 seconds to load, how should i go in optimizing it?
[14:44:06] sevenseacat: startupality: start by working out why it takes 8 seconds
[14:44:08] kitsuneyo: haha, well thanks
[14:44:09] sevenseacat: and then fix the slow parts :)
[14:44:24] startupality: yeah, but there are tools to do thata
[14:44:34] startupality: i want to be able to test the improvement
[14:44:39] startupality: but without to much hassle
[14:45:22] jenrzzz: has joined #RubyOnRails
[14:48:02] mary5030: has joined #RubyOnRails
[14:49:44] mary5030: has joined #RubyOnRails
[14:52:57] nfk: has joined #RubyOnRails
[14:53:02] chipotles: has joined #RubyOnRails
[14:53:36] lestrade: has joined #RubyOnRails
[14:53:58] kitsuneyo: Ok so I follows Railscase #196 on nested model forms, adding a javascript destroy link to my form. The link removes the field by doesn't destroy my link table record. What am I missing?
[14:54:06] Kedric: Is there anyway to get a mounted engines mount path?
[14:54:16] kitsuneyo: *but doesn't destroy
[14:54:21] tubbo: startupality: do you already have the tools at your disposal or are you looking for recommendations on what to use in order to find out what is wrong and optimize?
[14:54:54] tubbo: kitsuneyo: !gist the code
[14:54:54] helpa: kitsuneyo: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[14:55:31] gaussblurinc1: has joined #RubyOnRails
[14:56:31] sonofdirt: has joined #RubyOnRails
[14:56:46] startupality: @tubbo looking for the best tools
[14:57:02] lindii_: has joined #RubyOnRails
[14:57:10] gaussblurinc1: hi! I want to know how to remove object with all his many-to-many relationships. Actually, I have two tables many-to-many and one join table. I put before_destroy: hook for removing all related stuff from join table. is it a right way?
[14:57:59] tubbo: startupality: check out New Relic, it's probably the best tool for optimizing production-level performance issues
[14:58:09] tubbo: startupality: if this is happening in development, you probably have other issues
[14:58:18] kitsuneyo: here's my gist https://gist.github.com/kitsuneyo/cfa29644f5353ddc014b
[14:58:39] nzst: has joined #RubyOnRails
[14:58:55] nzst: Hi, how do I combine these two sql queries into a single query? http://pastebin.com/hGpuWC4h
[14:59:04] sevenseacat: kitsuneyo: https://gist.github.com/kitsuneyo/cfa29644f5353ddc014b#file-games_controller-rb-L43 you're missing the _destroy field
[14:59:19] nzst: that pastie link includes the closing )
[15:00:04] nzst: Here's the pastie, http://pastie.org/10270123 , How do I combine those two queries?
[15:00:17] jamey-uk1: has joined #RubyOnRails
[15:00:21] tubbo: kitsuneyo: you never actually make the ajax request back to the server that is required to tell rails you want to delete that genre
[15:00:28] kitsuneyo: that's it sevenseacat? so i add :_destroy to permitted attributes? with a leading underscore?
[15:00:45] ylluminarious: has joined #RubyOnRails
[15:00:50] tubbo: ^ also that
[15:01:08] kitsuneyo: there's something else missing tubbo?
[15:01:17] sevenseacat: also, don't preventDefault()
[15:01:25] sevenseacat: let the field be checked
[15:01:27] tubbo: kitsuneyo: can you confirm that the DELETE request is happening on your server?
[15:01:35] tubbo: if that doesn't come through it won't ever actually delete the record
[15:01:36] sevenseacat: tubbo: nah its good
[15:01:43] dhjondoh: has joined #RubyOnRails
[15:01:44] gaussblurinc1: could anybody helps with many-to-many ? https://gist.github.com/lolgear/19c2c91d7bc85baf5114
[15:01:47] kitsuneyo: lemme test it
[15:01:51] tubbo: not sure how much remote form/remote link_to stuff is going on there
[15:02:01] sevenseacat: tubbo: its a delete link that checks a hidden _destroy checkbox
[15:02:04] startupality: has joined #RubyOnRails
[15:02:07] jamey-uk1: has left #RubyOnRails: ()
[15:02:16] kitsuneyo: holy crap it works, thanks guys :D
[15:02:47] kitsuneyo: i always think everything is gonna be harder than it is, it stresses me out
[15:03:13] tubbo: gaussblurinc1: sorry...what's the issue you're having?
[15:03:22] dhjondoh: has joined #RubyOnRails
[15:03:36] sevenseacat: kitsuneyo: recommendation for things like this: add https://github.com/rubysherpas/r4ia_examples/blob/master/ticketee/config/environments/test.rb#L46 into your config/environments/development.rb
[15:03:49] sevenseacat: instead of getting a little log message about the unpermitted param, you'll get a big exception
[15:03:51] kitsuneyo: do you think it's worth adding html versions of these links, or does every site expect users to have javascript now?
[15:04:19] sevenseacat: without js, parts of rails apps won't work very well.
[15:04:34] tubbo: well, unless you write it so that it will
[15:04:43] tubbo: but that's true everywhere
[15:04:50] sevenseacat: well no, you wont have put or delete links
[15:04:55] sonofdirt: has joined #RubyOnRails
[15:05:11] tubbo: that doesn't matter too much since browsers don't support PUT or DELETE anyway
[15:05:16] kitsuneyo: so i add that one line of code to application.js?
[15:05:23] sevenseacat: true, but rails makes it so they work
[15:05:27] tubbo: that's why rails has a _method="PUT" and _method="DELETE" param in there
[15:05:31] sevenseacat: for forms yes
[15:05:34] tubbo: you can just do that yourself and rails will interpret as a PUT or DLEETE
[15:05:45] gaussblurinc1: tubbo: if i destroy one object in many-to-many relationship, it still exists in collection of another object in relationship
[15:05:47] tubbo: sevenseacat: why would it be any different? it's just an HTTP request
[15:05:54] kitsuneyo: i think there are ways to make html delete and add links, which call the controller action
[15:05:56] tubbo: and furthermore it's a POST request
[15:06:12] tubbo: gaussblurinc1: try doing app.reload before checking
[15:06:23] sevenseacat: if you make a link_to with method: :delete, it will make a proper DELETE request
[15:06:32] sevenseacat: via jquery_ujs
[15:06:40] tubbo: sevenseacat: yeah, but if you just did POST /the/same/route?_method=delete it's the same thing
[15:06:43] tubbo: with curl or whatever
[15:06:46] sevenseacat: hell no its not
[15:07:20] kitsuneyo: it's all over my head right now guys, but thanks for the help, i'll stick with javascript only for stuff like this
[15:07:22] tubbo: i mean...i thought it was just rails interpreting http requests
[15:07:32] sevenseacat: it is, via javascript
[15:07:40] tubbo: no, it can't be doing that
[15:07:47] tubbo: becuase you don't need rails_ujs to make DELETE requests
[15:07:49] Coldblackice: has joined #RubyOnRails
[15:08:26] sevenseacat: to make them with a <a href="#" data-method="delete"> yes you do
[15:08:28] Deck`: I have a param "team_id" in controller. Is there a way to convert it as "team: {id: <value>}". Because I perform a query after join. Actualy it's filtering feature for users, but user can have many teams
[15:08:38] tubbo: yeah...but that's not the only way to make DELETEs
[15:08:53] tubbo: not everyone uses rails_ujs (like us)
[15:09:00] tubbo: and we still DELETE shit all the time
[15:09:39] tubbo: Deck`: params[:team] = { id: params[:team_id] }? :)
[15:10:16] fgo: has joined #RubyOnRails
[15:10:52] sevenseacat: I never said anything like 'you cant make DELETE requests without using js" but okay :)
[15:11:54] nzst: I have an array of ids that I pass to a sql query, is there anyway to chain these two queries together? http://pastie.org/10270123
[15:13:04] Deck`: tubbo, is it good way to do such things? I have User table with teams and select field to choose a team. I need to filter users by team
[15:13:13] tubbo: has joined #RubyOnRails
[15:13:25] Scripore: has joined #RubyOnRails
[15:13:29] tubbo: sevenseacat: uhh, you kinda did say that
[15:13:49] Axilla: has joined #RubyOnRails
[15:13:51] ayonkhan: has joined #RubyOnRails
[15:13:52] sevenseacat: no, I said you can't use Rails' view helpers without using JS to make them work
[15:14:08] tubbo: well, what you really said was "parts of rails apps"
[15:14:22] tubbo: and both of what we were talking about is technically a part of a rails app, just a different part :)
[15:14:30] sevenseacat: [23:06:22] sevenseacat: if you make a link_to with method: :delete, it will make a proper DELETE request
[15:14:30] sevenseacat: [23:06:30] sevenseacat: via jquery_ujs
[15:14:32] tubbo: i just didn't understand what part you were talking about
[15:14:35] kitsuneyo: has joined #RubyOnRails
[15:14:50] tubbo: sevenseacat: without js, parts of rails apps won't work very well.
[15:14:56] tubbo: tubbo: well, unless you write it so that it will
[15:15:01] tubbo: sevenseacat: well no, you wont have put or delete links
[15:15:11] sevenseacat: thats correct, you won't.
[15:15:16] snockerton: has joined #RubyOnRails
[15:15:23] sevenseacat: you cannot make a link do anything other than GET, without using JS.
[15:15:42] tubbo: not really rails' fault but still :)
[15:15:49] tubbo: why can't browsers just fucking support the full HTTP spec already lol
[15:15:50] lethjakman: has joined #RubyOnRails
[15:15:56] sevenseacat: because theyre stupid
[15:15:56] kitsuneyo: sevenseacat, does that line actually go in development.rb?
[15:16:04] sevenseacat: kitsuneyo: thats what I said, yes.
[15:16:11] letitflow: has joined #RubyOnRails
[15:16:11] letitflow: has joined #RubyOnRails
[15:16:37] kitsuneyo: missed that sorry
[15:17:02] tubbo: honestly though turning javascript off is also stupid. it's like being a fully grown child-free adult and enabling parental controls on your television for yourself.
[15:17:30] tubbo: use an ad blocker, block the shit that's annoying...but don't just sledgehammer it and never see JS, that's ridiculous. the web will move on without you.
[15:17:56] sonofdirt: has joined #RubyOnRails
[15:20:32] chouhoulis: has joined #RubyOnRails
[15:20:49] nzst: tubbo: some people think the way most javascript is delivered isn't free, which sours the whole experience. The end user gets a mangled and minified javascript
[15:20:50] rromanchuk: has joined #RubyOnRails
[15:22:00] fryguy: any ideas how to set up haml helpers such that capture_haml is defined in tests? I'm trying to do some testing with a form_for block in a test and haml is complaining about capture_haml missing
[15:22:58] fatephd: has joined #RubyOnRails
[15:24:34] jokke: i'm experiencing some major class caching weirdness in production
[15:24:51] jokke: i have an engine that uses devise
[15:24:59] AzaToth: has joined #RubyOnRails
[15:26:09] jokke: i use the decorators gem to monkeypatch devise like so: http://p.jreinert.com/jR7P/ruby
[15:26:41] jokke: none of my helper methods are included however
[15:26:48] jokke: and it get's weirder
[15:27:34] jokke: http://p.jreinert.com/2j51q/
[15:28:13] IanV0rn2341: has joined #RubyOnRails
[15:28:38] jokke: http://p.jreinert.com/2j51q/ruby
[15:29:02] polly_wog: has joined #RubyOnRails
[15:29:10] jokke: that's in the context of my binding pry call in the decorator
[15:29:23] jokke: wth is going on here
[15:29:34] jokke: this works perfectly fine in development
[15:30:57] moeabdol: has joined #RubyOnRails
[15:32:26] Spami: has joined #RubyOnRails
[15:33:08] yaymukund: has joined #RubyOnRails
[15:35:29] jokke: i already posted an issue on github for the decorators gem but i think this might not be specific for this gem
[15:38:37] dynomist: has joined #RubyOnRails
[15:40:10] dynomist: If I have two models that were created separately, and I want to link them, can I simply add at the top of the order.rb file 'belongs_to :customer' or do I also need to generate a migration?
[15:40:51] slava_: is using eager_load = true bad and worsens performance?
[15:40:52] jokke: dynomist: depends on your database
[15:41:40] jokke: dynomist: if you use an sql database you need a migration to add a column to store the referenced model id in
[15:42:57] diegoviola: I'm trying to build a chat based app, but it's more like something that talks to a bot and everyone is like "use node.js for that"
[15:43:03] diegoviola: but I'm not experienced with this
[15:43:18] bullcitydev: has joined #RubyOnRails
[15:43:20] pixelhandler: has joined #RubyOnRails
[15:43:37] jokke: diegoviola: yeah well
[15:43:44] jokke: diegoviola: you need something reactive
[15:44:01] jokke: diegoviola: i'd say "use meteor" (which is based on node.js) :P
[15:44:06] diegoviola: asynchronous you mean?
[15:44:29] jokke: your ui needs to respond to changes to the data in real time
[15:44:54] dynomist: jokke postgreSQL counts as sql in this case then?
[15:45:07] jokke: diegoviola: meteor is fairly easy to work with. i'd give it a try if i were you
[15:45:12] jokke: dynomist: yup
[15:45:21] kitsuneyo: i'm still working on my embedded form and i'm trying to make an "add field" link with js following railscast #196... does this stuff all still work or is it out of date?
[15:45:56] kitsuneyo: the code is kind of complex, it's not working for me atm although i need to check for typos
[15:45:57] jokke: kitsuneyo: mmh.. are you using accepts_nested_attributes for?
[15:45:59] diegoviola: jokke: I got this to work with Rails and ajax just fine, but it gets frustrating after a while because I need to do multiples requests via ajax to the server and get updates frequently and it gets frustrating after a while
[15:46:13] jokke: diegoviola: sure
[15:46:13] kitsuneyo: yep, the form is working otherwise
[15:46:26] kitsuneyo: i can remove fields ok
[15:46:31] jokke: kitsuneyo: accepts_nested_attributes_for is pretty ugly..
[15:46:43] sandstrom: has joined #RubyOnRails
[15:46:46] kitsuneyo: ugly in what sense?
[15:46:47] jokke: kitsuneyo: today you'd go with something like reform
[15:47:09] jokke: kitsuneyo: in every sense :P
[15:47:18] jokke: ask anyone
[15:47:21] diegoviola: jokke: for example, I type something in a form, hit enter, I send the data via $.post(), the server reads input and gets json from somewhere else, I parse that and I get the response back via ajax and update the DOM, then I also need to rate/star the responses, that's another $.post() right there... annoying
[15:47:24] jokke: it's a pain to work with
[15:47:26] kitsuneyo: i see, is that easy to implement? is it built into ruby or a gem?
[15:47:32] jokke: it's a gem
[15:47:49] jokke: but it doesn't solve any javascript problems
[15:47:54] kitsuneyo: is it fairly easy for a novice like me to set up?
[15:47:56] diegoviola: jokke: I wonder if there's a better way to do this
[15:48:01] jokke: kitsuneyo: i think so
[15:48:06] blackmesa: has joined #RubyOnRails
[15:48:11] kitsuneyo: ok i'll take a look at it!
[15:48:15] jokke: kitsuneyo: but it doesn't handle any js problems
[15:48:31] jokke: kitsuneyo: i can tell you what i did for this:
[15:48:35] kitsuneyo: so you still need to get your js right?
[15:48:58] kitsuneyo: ok please show me jokke
[15:48:59] jokke: i have a controller for getting form partials via ajax requests
[15:49:14] jokke: it renders the partials to text
[15:49:20] jokke: (in a json
[15:50:46] jokke: so i basically have something like {"form_partial": "<div><input type="text" name="some_field"></div>"}
[15:50:48] surrealanalysis: has joined #RubyOnRails
[15:50:56] Scriptonaut: has joined #RubyOnRails
[15:51:01] jokke: which i can easily hook into the dom
[15:51:11] jokke: but it's always a bit of work
[15:51:26] kitsuneyo: and this is with reform?
[15:51:37] jokke: kitsuneyo: it's independent of that
[15:51:56] kitsuneyo: excuse me, i'm a novice at programming
[15:52:09] cashnguns: has joined #RubyOnRails
[15:52:25] giowong: has joined #RubyOnRails
[15:52:26] jokke: i would just advice you to go through the controller, because rendering the views dynamically on the server is much less error prone and avoids duplication than hard coding templates in your javascript.
[15:53:04] jokke: but this is just my opinion. there are others of course
[15:53:08] slava_: so it seems like config.eager_load = true improves performance.. not sure by how much, but it breaks some globalize translations and make globalize work unpredictable in some places. (such as form_for) it doesn't translate text_area form content. anyone have any ideas why it's happening?
[15:53:51] kitsuneyo: ok. it's something i have to keep in mind for now, because right now i have to follow a tutorial for everything i do... still so much to learn before i can make smart choices about how to approach a problem
[15:53:58] jokke: diegoviola: yeah. rails is not really made for that
[15:54:08] jokke: kitsuneyo: sure sure
[15:54:26] jokke: diegoviola: or that's how i feel
[15:55:31] kitsuneyo: appreciating the help in this chan, cheers
[15:57:31] diegoviola: jokke: so rails is better for like CRUD/REST apps
[15:57:43] diegoviola: resources :photos
[15:57:45] diegoviola: things like that
[15:57:50] jokke: very good even
[15:57:58] Maletor: has joined #RubyOnRails
[15:58:21] jokke: but for responsive ui i'd go with js frameworks
[15:58:34] diegoviola: JS is a pain in the ass though
[15:58:40] jokke: even though js is ...
[15:58:41] diegoviola: callbacks hell, etc
[15:58:42] Fire-Dragon-DoL: has joined #RubyOnRails
[15:58:47] nzst: Why does this return Rcms::BlocksDocuments objects, I'm trying to return Rcms::Documents? http://pastie.org/10270207
[15:58:54] jokke: diegoviola: meteor does that better than most
[15:59:02] jokke: lot of it is synchronous
[15:59:02] workmad3: diegoviola: promises ftw!
[15:59:14] jokke: and what workmad3 said
[15:59:16] diegoviola: workmad3: I hear that but I haven't tried that yet
[15:59:32] workmad3: diegoviola: if you're in callback hell, the '00s are calling and want their code back ;)
[15:59:50] fryguy: promises are hardly a panacea
[15:59:59] diegoviola: what's promises
[16:00:06] diegoviola: it promises not to suck?
[16:00:22] nzst: diegoviola: http://andyshora.com/promises-angularjs-explained-as-cartoon.html
[16:00:34] workmad3: fryguy: no, but they at least give you a sensible, standardised way to collapse your pyramids of doom :D
[16:00:59] jokke: oh god not angular
[16:01:21] workmad3: diegoviola: http://www.html5rocks.com/en/tutorials/es6/promises/ too
[16:01:29] nzst: angular is a nice framework
[16:01:46] workmad3: nzst: it's a framework, so you got that much right at least...
[16:01:48] towski_: has joined #RubyOnRails
[16:01:50] jokke: i agree to disagree
[16:02:01] jokke: workmad3: haha
[16:02:12] nzst: It hooks up nicely to a rails api-endpoint
[16:02:30] jokke: nzst: and ember doesn't?
[16:02:38] paulcsmith: has joined #RubyOnRails
[16:02:46] jokke: not that i'd be an ember fan either
[16:03:00] jokke: but i like it more than angular
[16:03:23] kitsuneyo: i listen this ruby-on-rails podcast presented by sean devine, the guy is obsessed with ember now
[16:03:38] jokke: right now i'm a complete meteor fanboy though. It feels like rails did after php.
[16:03:47] kitsuneyo: separate rails api and ember front end
[16:04:16] nzst: kitsuneyo: we do that in production, but with an angular frontend. The seperation of concerns is nice
[16:04:20] jokke: kitsuneyo: rails for api only is pretty bloat imho
[16:04:21] workmad3: jokke: I should give meteor another go at some point... last time I used it was at 0.5.0, it had only just gotten channel authentication primitives and it was nice but still pretty rough
[16:04:49] nzst: jokke: why? it serves a json template just as easy as an html template
[16:04:50] jokke: workmad3: yeah. it's 1.0 now \o/
[16:05:04] kitsuneyo: i guess you could use meteor in the same way as ember? is that what meteor is about?
[16:05:13] baweaver: has joined #RubyOnRails
[16:05:14] jokke: kitsuneyo: no
[16:05:16] jokke: not at all
[16:05:18] workmad3: kitsuneyo: no, meteor is client & server, isomorphic JS
[16:05:37] jokke: with great latency compensation
[16:05:41] artto: has joined #RubyOnRails
[16:05:44] kitsuneyo: ok, this is first time i'm hearing of it
[16:05:45] jokke: meteor apps feel very native
[16:05:54] jokke: super snappy
[16:06:11] kitsuneyo: how hard is learning javascript compared to rails? i'm guessing i need to learn it alongside rails
[16:06:23] lupine: javascript is a bit bizarre
[16:06:25] jokke: if you want it or not
[16:06:36] workmad3: depends on what you're doing with it
[16:06:44] jokke: and it's very confusing, because ruby is _so_ unlike js
[16:06:54] kitsuneyo: i just stole my first js from railscast, my add fields link is working ;)
[16:07:05] lupine: personally, I'd learn them in series, but you don't always get the option
[16:07:34] kitsuneyo: lupine: yeah, i'm trying to learn by doing
[16:07:35] jokke: but once you get the hang of js it's not as frustrating anymore
[16:07:48] kitsuneyo: although i have followed several ruby and rails books
[16:07:54] jokke: the scope concept was the hardest thing for me to grasp
[16:08:05] givanse: has joined #RubyOnRails
[16:08:09] kitsuneyo: jokke: scope as in the routes?
[16:08:19] lupine: I think variable scope, most likely
[16:08:20] jokke: the way you have to juggle 'this' around
[16:08:44] aldodelgado: has joined #RubyOnRails
[16:08:57] kitsuneyo: js looks so much more complex on the screen than ruby
[16:09:16] jokke: ruby is way more complex
[16:09:22] kitsuneyo: to me it does anyway
[16:09:34] jokke: but it masks it from the dev :P
[16:09:38] radialneon: has joined #RubyOnRails
[16:09:39] jokke: ok gotta go
[16:09:50] kitsuneyo: thanks for your help jokke
[16:10:04] aldodelgado: Suggestions: I???m looking for a good way to update the statuses of a record as it gets updated by users or sidekiq jobs. I???m looking for any suggestions on a good way of implementing this.
[16:10:49] aldodelgado: I was thinking of creating a concern and having it update on a before_create but I???m not sure if that's the best implementation
[16:13:25] radialneon: has joined #RubyOnRails
[16:15:29] aldodelgado: Is there a way to have a record follow a strict order? I dont want a record to go from status 4 back to status 1 unless its go to 3, 2 and then back to 1
[16:16:57] sonofdirt: has joined #RubyOnRails
[16:18:53] tvw: has joined #RubyOnRails
[16:19:49] cac: has joined #RubyOnRails
[16:20:45] bricker: has joined #RubyOnRails
[16:21:08] dionysus69: has joined #RubyOnRails
[16:21:23] a346: has joined #RubyOnRails
[16:21:45] zendrix: has joined #RubyOnRails
[16:25:34] cornerma1: has joined #RubyOnRails
[16:26:43] elaptics: aldodelgado: you could implement it as a state machine to enforce specific transitions
[16:26:44] Guest1094: has joined #RubyOnRails
[16:27:00] arup_r: has joined #RubyOnRails
[16:27:06] aldodelgado: elaptics: Looking into that now. Thank you :-)
[16:27:07] lindii_: rails 4 is no longer including jquery-ui?
[16:28:47] lessless: has joined #RubyOnRails
[16:28:59] aldodelgado: elaptics: that's exactly what I need
[16:29:18] arup_r: I have active_admin.css.scss file.. where I want to import all the css files from a directory.. To do that, I tried @import "admin/plugins/*"; but it is not including this.. I need to give each file like @import "admin/plugins/a.css";
[16:29:28] arup_r: @import "admin/plugins/b.css";
[16:29:32] arup_r: then it is working..
[16:29:39] moeabdol: has joined #RubyOnRails
[16:29:42] arup_r: what is the way to include all at once ?
[16:30:18] arup_r: as per this answer http://stackoverflow.com/a/16575366/2767755 `/*` should work
[16:30:46] DEA7TH: has joined #RubyOnRails
[16:32:29] eggoez: has joined #RubyOnRails
[16:33:21] yourabi: has joined #RubyOnRails
[16:34:35] jenrzzz: has joined #RubyOnRails
[16:34:49] ramortegui: has joined #RubyOnRails
[16:36:11] s2013: has joined #RubyOnRails
[16:39:47] asheinfeld: has joined #RubyOnRails
[16:40:24] arup_r: found the reason http://sass-lang.com/documentation/file.SASS_REFERENCE.html#import
[16:40:51] arup_r: `/*` will not import files having .css extension
[16:41:10] slash_nick: Anyone know of a good, non-rails, beginner html/css/js project? maybe koan like, maybe not
[16:46:38] fwaokda: has joined #RubyOnRails
[16:47:03] Zadrel: has joined #RubyOnRails
[16:47:05] jsrn_: has joined #RubyOnRails
[16:47:42] dopie: has joined #RubyOnRails
[16:47:42] fwaokda: I'm using friendlyid gem and I'm wanting to use the id in the slug, however the slug is generated before I get an id for the record. Anyone that has used friendlyid know how i can handle this?
[16:47:59] diegoviola: would you tell your boss he's an idiot if he's being one? :p
[16:48:11] surrealanalysis: has joined #RubyOnRails
[16:49:51] Zadrel: hi there! could someone help me? the explanation is in the first file of the gist. basically i have a routing problem in a "grandchild" form. https://gist.github.com/rmatuoka/58c05b4f07751c0a3cb1
[16:51:12] annlewis: has joined #RubyOnRails
[16:51:19] rubyonrailed: has joined #RubyOnRails
[16:51:55] fgo: has joined #RubyOnRails
[16:51:56] erich: has joined #RubyOnRails
[16:52:27] blackmesa: has joined #RubyOnRails
[16:53:20] giowong: has joined #RubyOnRails
[16:53:32] DEA7TH: has joined #RubyOnRails
[16:53:54] Siyo_: has left #RubyOnRails: ()
[16:55:31] rikkipitt: has joined #RubyOnRails
[16:55:55] srinidhi: has joined #RubyOnRails
[16:56:01] tbuehlmann: diegoviola, just quit. or stop complaining.
[16:56:12] rikkipitt: hey guys, have any of you had much luck with Dalli and MemCachier on Heroku for speeding up the assets compilation time?
[16:56:14] diegoviola: tbuehlmann: sorry
[16:56:56] fryguy: any advice on using fields_for in a helper and rendering multiple things?
[16:57:28] Zadrel: hello there, anyone got any ideas?
[16:57:41] rikkipitt: each deploy with Dalli is taking 3x longer than without... even when assets don't change between deploys
[16:57:48] diegoviola: tbuehlmann: I won't quit, I'm getting work done here
[16:58:41] shinnya: has joined #RubyOnRails
[16:59:33] Zadrel: diegoviola: you need to pay attention if he's being an idiot according to your judgement or in overall. if in overall i think you should respectfully talk to your manager first, if it doesn't work, respectfully talk to your boss, if still not work i got no ideas.
[17:01:06] roolo: has joined #RubyOnRails
[17:01:10] Zadrel: diegoviola: in case that you misunderstood, i think that tbuehlmann told you to quit your job, not the irc. sry if the misunderstading is from my side;
[17:01:42] tbuehlmann: I don't care, just let the complaining quit :>
[17:01:51] arBmind: has joined #RubyOnRails
[17:03:20] Zadrel: tbuehlmann: it's odd, if you think, how people tinks that they're dependant on what they got through life. like PCs and toothbrushes, TV and other things that isn't vital;
[17:03:42] Zadrel: tbuehlmann: that's what hold them to a job that sucks;
[17:04:09] nzst: has joined #RubyOnRails
[17:04:15] Zadrel: tbuehlmann: or even the fear of quitting;
[17:04:37] lethjakman: has joined #RubyOnRails
[17:04:56] Zadrel: tbuehlmann: sry, i forgot this isn't a filosophy channel;
[17:06:05] Zadrel: anyways, please tell me if i'm begging already but if anyone could please check my question or at least tell me that don't have time, i would be grateful :D
[17:09:03] rikkipitt: has joined #RubyOnRails
[17:10:44] bullcitydev: has joined #RubyOnRails
[17:11:10] glenab: has joined #RubyOnRails
[17:13:39] anjen: has joined #RubyOnRails
[17:13:46] gloscombe: has joined #RubyOnRails
[17:15:25] hahuang65: has joined #RubyOnRails
[17:15:52] CheckYourSix: has joined #RubyOnRails
[17:16:49] Zadrel: could someone help me? the explanation is in the first file of the gist. basically i have a routing problem in a "grandchild" form. https://gist.github.com/rmatuoka/58c05b4f07751c0a3cb1
[17:16:52] giowong: has joined #RubyOnRails
[17:17:26] nzst: I can't seem to do right joins properly in rails, is there a guide other than the main documentations that is decent?
[17:18:11] cnk: has joined #RubyOnRails
[17:18:17] benlieb: has joined #RubyOnRails
[17:18:33] raunicolae: has joined #RubyOnRails
[17:18:47] Zadrel: nzst: google "railsguides" you should bump in the official docs. they are prety clear for me :)
[17:19:49] tubbo: has joined #RubyOnRails
[17:20:03] cobragoat: has joined #RubyOnRails
[17:20:16] Zadrel: could someone help me? the explanation is in the first file of the gist. basically i have a routing problem in a "grandchild" form. https://gist.github.com/rmatuoka/58c05b4f07751c0a3cb1
[17:20:35] mikecmpbll: has joined #RubyOnRails
[17:20:43] IdleGod: has joined #RubyOnRails
[17:20:56] bradleyprice: has joined #RubyOnRails
[17:21:13] towski_: has joined #RubyOnRails
[17:24:34] uri__: has joined #RubyOnRails
[17:24:40] bradleyprice: has joined #RubyOnRails
[17:24:57] Scripore: has joined #RubyOnRails
[17:25:25] IdleGod: Hey, I'm having a problem with responding as JS; nothing in a block gets called with respond_to / format.js { }, no matter what I do
[17:26:21] tbuehlmann: IdleGod, have some code? how do you call the action?
[17:27:33] IdleGod: It's pretty straight forward, which is why it's so odd... just respond_to {|format| format.js { .. anything here ... } }
[17:27:41] asheinfeld: has joined #RubyOnRails
[17:28:09] trollga: has joined #RubyOnRails
[17:28:21] bricker: IdleGod: And what makes you think the format is JS?
[17:28:25] bricker: when that code is run
[17:28:32] rikkipitt: has joined #RubyOnRails
[17:28:46] IdleGod: I'm trying to force it to render a partial instead of a full template, and control the content_type, but if it's not doing that code, I can't do that. Worked in rails 3, but not 4.2.1 (upgrading to 4.2.3 as we speak)...
[17:29:23] asheinfeld: has joined #RubyOnRails
[17:29:31] IdleGod: bricker, the logs show that it's considering it as JS, which is from an XHR. If I remove the format.js, it behaves as an HTML render, and behaves itself
[17:30:37] gloscombe: has joined #RubyOnRails
[17:31:25] gaussblurinc1: has joined #RubyOnRails
[17:32:48] IdleGod: so, to test it, I've gone as simple as just dropping in a logger.debug "calling js"... but nothing ever appears. Tried to format.js { render "somthing" }, and it just ignores it
[17:34:07] Spami: has joined #RubyOnRails
[17:34:50] bricker: IdleGod: k, I can't help anymore without seeing code
[17:34:57] alex88: has joined #RubyOnRails
[17:36:07] Spami: has joined #RubyOnRails
[17:38:21] IdleGod: https://gist.github.com/bmurray/c0341ccd20b95416c0a7
[17:39:20] IdleGod: the message "render format JS" never appears in the logs. If I remove format.js, it calls the format.html just fine
[17:39:20] hanss: has joined #RubyOnRails
[17:40:39] bricker: IdleGod: in the format.js block, try adding `render text: 'test'` or something, so it doesn't try to render a template
[17:41:14] devdazed: has joined #RubyOnRails
[17:41:23] cac: has joined #RubyOnRails
[17:41:48] IdleGod: yea, tried that too, still gives the same error as if it's soldiering on to try rendering normally
[17:42:10] IdleGod: damnit, figured it out
[17:42:43] snockerton: has joined #RubyOnRails
[17:42:47] IdleGod: I had registered the mime_type js in my initializers from a version that didn't do js by default (it's an old app, don't judge me)... removing it fixed it
[17:42:51] nzst: How do I combine these queries? http://pastie.org/10270207
[17:43:21] IdleGod: thanks Bricker!
[17:44:58] tubbo: has joined #RubyOnRails
[17:45:36] IdleGod: has left #RubyOnRails: ()
[17:46:03] erich: has joined #RubyOnRails
[17:46:31] Wolland: has joined #RubyOnRails
[17:50:14] slava_: so it seems like config.eager_load = true improves performance.. not sure by how much, but it breaks some globalize translations and make globalize work unpredictable in some places. (such as form_for) it doesn't translate text_area form content. anyone have any ideas why it's happening?
[17:50:18] chouhoul_: has joined #RubyOnRails
[17:50:26] cac: has joined #RubyOnRails
[17:50:43] meoblast001: has joined #RubyOnRails
[17:51:33] fwaokda: when using user = User.new(params) I'm getting the error: *** TypeError Exception: class or module required -- can i wrap the .new() in a block to get more information about why I'm getting the error?
[17:51:35] Kedric: has joined #RubyOnRails
[17:51:37] nzst: Updated my pastie, how can I make this query better? http://pastie.org/10270370
[17:51:54] benlieb: has joined #RubyOnRails
[17:52:27] benlieb: has joined #RubyOnRails
[17:52:57] gambl0re: has joined #RubyOnRails
[17:53:50] nzst: ideally I'd like it to be a single query, but I can't seem to get it right
[17:54:47] voker57: has joined #RubyOnRails
[17:55:28] bin_005: has joined #RubyOnRails
[17:55:29] chouhoulis: has joined #RubyOnRails
[17:55:49] djbkd: has joined #RubyOnRails
[17:56:00] snockerton: has left #RubyOnRails: ()
[17:56:08] snockerton: has joined #RubyOnRails
[17:56:20] momomomomo: has joined #RubyOnRails
[17:56:23] Dopagod: has joined #RubyOnRails
[17:57:05] zendrix: has joined #RubyOnRails
[17:57:17] huck5: has joined #RubyOnRails
[17:58:49] bf4: has joined #RubyOnRails
[17:59:09] momomomomo_: has joined #RubyOnRails
[17:59:10] s2013: does rails 3.2 work with ruby 2.x?
[17:59:28] bricker: s2013: Yes but you have to use the 3-2-stable branch
[17:59:46] bricker: actually there may be a release now that has all of the ruby 2 updates, not sure
[17:59:48] s2013: i inherited a project at work but its an older rails app
[18:01:06] s2013: hm its using ruby 1.9.3
[18:01:53] bricker: update if you can, 193 is EOL'd
[18:02:27] s2013: yeah im going to try..
[18:04:04] s2013: they still use rvmrc but thats deprecated right
[18:04:37] tubbo: it's probably easier to use .ruby-version these days rather than .rvmrc
[18:07:31] s2013: its just such an old project and they are reluctant to upgrade
[18:07:50] snockerton: has joined #RubyOnRails
[18:07:55] fmcgeough: has joined #RubyOnRails
[18:07:56] s2013: should i just remove rvmrc?
[18:08:15] nya: has joined #RubyOnRails
[18:08:57] Pwnna: has joined #RubyOnRails
[18:09:24] Pwnna: is there a way when using model_url(@model) so that it doesn't use the @model's id to construct the URL?
[18:09:43] Pwnna: My routes is like resources :model, param: :name
[18:10:00] Pwnna: so the path would be like /model/name_of_model rather than /model/123456
[18:10:08] blackmesa: has joined #RubyOnRails
[18:10:17] Pwnna: but if i do model_url(@model) generates http://.../model/1234567
[18:10:23] tubbo: Pwnna: check out friendly_id
[18:10:34] Pwnna: is there anyway to do this without introducing another gem?
[18:11:16] s2013: does the latest version ruby work with rails 3.2.22
[18:12:03] ProLoser: has joined #RubyOnRails
[18:12:12] nzst: Any way to speed up Dragonfly::Middleware#call?
[18:12:45] s2013: nvm guess not
[18:13:01] blackmes1: has joined #RubyOnRails
[18:13:13] charliesome: has joined #RubyOnRails
[18:14:20] rhizome: ruby 2.1 is fine
[18:15:03] man_in_the_b0x_: has joined #RubyOnRails
[18:15:40] dideler: has joined #RubyOnRails
[18:16:14] man_in_the_b0x_: has joined #RubyOnRails
[18:16:50] arup_r: I wrote `validates_presence_of :user, message: "Renter name can't be blank"` to get the message `Renter name can't be blank` but getting `User Renter name can't be blank`
[18:16:57] arup_r: what wrong I made ?
[18:17:04] dc1: has joined #RubyOnRails
[18:17:06] momomomomo: has joined #RubyOnRails
[18:18:51] skyjumper: is there a way to pass blocks to partials? something like this - https://gist.github.com/anonymous/604dbef97e6b97581990
[18:19:54] nzst: skyjumper: http://guides.rubyonrails.org/layouts_and_rendering.html#passing-local-variables
[18:19:54] rhizome: you are doing form partials wrong
[18:20:31] baweaver: has joined #RubyOnRails
[18:20:52] a346: has joined #RubyOnRails
[18:21:02] skyjumper: clearly. i'm trying to find a better way
[18:23:03] cmisenas: has joined #RubyOnRails
[18:23:15] rhizome: rails g scaffold foo; vim app/views/foos/edit.html.blahblah; rails destroy scaffold foo
[18:24:21] skyjumper: i'm trying to do things a little differently. for the 'new' view, pass the form a simple set of inputs
[18:24:52] skyjumper: for the 'edit' view, pass it a more complex form with javascript-enabled tabs
[18:25:08] tubbo: seems like these shouldn't be partials
[18:25:13] tubbo: err, the form shouldn't be a partial*
[18:25:28] tubbo: the edit/new templates clearly differ from one another
[18:25:42] skyjumper: edit/new will repeat a lot of the same stuff, then
[18:25:57] tubbo: partialize the fields then, not the form
[18:26:22] tubbo: say you have the same <fieldset> appearing in both places, compartmentalize that into a partial
[18:26:22] rhizome: which is the scaffold way
[18:26:45] arup_r: any help ?
[18:27:10] alexhartley: has joined #RubyOnRails
[18:27:34] guillaume-rb: has joined #RubyOnRails
[18:27:40] skyjumper: if partials can't yield to a block, that's the only other option
[18:27:59] s2013: https://gist.github.com/ss2k/56ce56040b026e4237ed any clue
[18:28:02] choke: has joined #RubyOnRails
[18:28:05] s2013: eventmachine
[18:28:19] tubbo: arup_r: you didn't do anything wrong, that's how rails validation message overriding works
[18:28:40] arup_r: Yes.. so how to get what I want ?
[18:28:52] rhizome: arup_r: your question is literally as old as rails. try google.
[18:29:15] darrencauthon: has joined #RubyOnRails
[18:29:32] tubbo: s2013: eventmachine 0.12.10 is hella old
[18:29:42] s2013: but its not in the gemfile
[18:29:50] s2013: its an old ass project
[18:30:00] tubbo: s2013: find it in Gemfile.lock so you can see what is depending on it
[18:30:05] tubbo: probably Thin, in which case just remove the Thin gem for now
[18:30:09] tubbo: webrick is fine
[18:30:11] voodo: has joined #RubyOnRails
[18:30:13] arup_r: but I am new... lets see
[18:30:18] rhizome: are you going to paste "somegisturl whats up" for every step of the update?
[18:31:24] asheinfeld: has joined #RubyOnRails
[18:32:39] tubbo: jokke: on Meteor...have you tried the latest version? how is it? we use Meteor here to make a little game app (n3rd street squares)
[18:33:51] Kedric: has joined #RubyOnRails
[18:37:06] s2013: latest meteor is supposed to be cool
[18:37:07] workmad3: has joined #RubyOnRails
[18:37:33] hahuang65: has joined #RubyOnRails
[18:37:38] s2013: stupid q but does bundle update updates all gems to tehir latest version or updates the gems to the latest version that works with ruby/rails combo in that project
[18:38:27] qejk: has joined #RubyOnRails
[18:39:02] CatMartyn: has joined #RubyOnRails
[18:39:08] a346: has joined #RubyOnRails
[18:39:36] arup_r: solved... I used yaml to customize it like http://stackoverflow.com/a/19320190/2767755
[18:39:56] hd1: has left #RubyOnRails: ()
[18:40:05] zendrix: has joined #RubyOnRails
[18:40:45] tubbo: s2013: `bundle update` is still going to pay attention to the constraints laid out in Gemfile or the gemspecs of each gem
[18:41:20] GPrime: has joined #RubyOnRails
[18:41:24] kitsuneyo: has joined #RubyOnRails
[18:42:18] kitsuneyo: hey all, what's the best way to do sidebars in rails?
[18:42:25] tubbo: sidebars?
[18:42:35] kitsuneyo: not sure how to structure my layouts
[18:43:00] kitsuneyo: yeah, i'm using bootstrap and i want to have a kind of 6-3-3 column layout
[18:43:10] CatMartyn: has joined #RubyOnRails
[18:43:43] kitsuneyo: the content for the narrower columns will be different depending on the controller, but it will be shared across some views
[18:44:05] kitsuneyo: what's the DRY way to do that?
[18:44:12] rhizome: boostrap has columns built in last i checked
[18:44:31] bf4: has joined #RubyOnRails
[18:44:38] GPrime: and you can use overflow-y so it get feeling like 3 windows in 1
[18:44:39] rhizome: look at content_for
[18:44:41] kitsuneyo: yeah it does, but how do i render the content with layouts
[18:44:51] kitsuneyo: content_for, is that pretty easy to use?
[18:44:54] tubbo: kitsuneyo: i would make a _sidebar partial in your app/views/{controller}/ and then just always `render 'sidebar'` in your layout
[18:45:14] rhizome: yes, content_for is easy to use.
[18:45:15] tubbo: the way rails view path lookups work, it first looks for the partial in the current dir, then the containing dir, and recursively until it gets to app/views
[18:45:25] tubbo: only throwing an exception when it can't find a partial anywhere in the tree
[18:45:48] tubbo: kitsuneyo: so you could have a generic partial living at app/views/application/_sidebar.html, and then a more specific partial for say users at app/views/users/_sidebar.html
[18:46:00] tubbo: all you have to do is render 'sidebar' to get that partial
[18:46:25] tubbo: this particular subtle feature of rails is something i find really awesome...because it makes refactoring that much easier
[18:46:28] kitsuneyo: so i could make multiple _sidebar partials, then the default would load for controllers that don't have a _sidebar partial in the folder?
[18:47:35] kitsuneyo: ok, so can i use that alongside content_for (which i know nothing about right now)
[18:47:54] tubbo: i wouldn't even use content_for until you need to
[18:48:27] tubbo: try to accomplish this with partials...content_for is more useful if you want to inject markup into already-rendered content like the <head>
[18:48:37] tubbo: but...i also advise against using that because it makes your code harder to refactor later on
[18:49:04] tubbo: say...if you want to render that partial in an ajax request, but not any other part of the layout around it. now you're missing content, because content_for :head won't be called.
[18:49:27] CatMartyn: has joined #RubyOnRails
[18:50:08] Senjai: I want to render no template, with no view. And just have the layout be rendered
[18:50:09] rhizome: it's just sidebars man
[18:50:19] Senjai: How to accomplish this madneess?
[18:50:30] tubbo: Senjai: git grep 'yield', delete that line of code. problem solved. :)
[18:50:40] tubbo: rhizome: you're just sidebars man
[18:50:44] Senjai: tubbo: wat, no.
[18:50:45] tubbo: it's still real to me dammit!
[18:50:47] guillaume-rb: has joined #RubyOnRails
[18:50:53] kitsuneyo: i guess i'll see how well partials work out for me
[18:51:17] tubbo: Senjai: no really, if you don't have a `yield` in your view it won't render the template
[18:51:26] sinkensabe: has joined #RubyOnRails
[18:51:29] Senjai: Im saying for this controller
[18:51:31] Senjai: I dont want an empty view
[18:51:37] tubbo: Senjai: render text: ''
[18:51:38] Senjai: but I want it to render the template
[18:51:47] tubbo: you just contradicted yourself
[18:51:49] rhizome: sense: you're not making it
[18:51:54] bricker: Senjai: `render template: false` might work, I dunno, otherwise just make an empty template file and render that.
[18:52:03] kitsuneyo: the only problem i see is, i might have some sidebar content that's common to different controllers... i guess i could render that with partials
[18:52:09] Senjai: tubbo: render text: true doesnt include the layout
[18:52:30] tubbo: Senjai: render text: true, layout: :application
[18:52:32] Senjai: bricker: nope :(, might just have to make an empty template file
[18:52:40] hotpancakes: has joined #RubyOnRails
[18:52:45] Senjai: tubbo: I dont want to create a dependency on the name of the layout
[18:52:52] Senjai: Is there a way to get the current layout?
[18:53:04] kies^: has joined #RubyOnRails
[18:53:10] tubbo: Senjai: when was the last time you didn't have an app/views/layouts/application.html.* file in your project?
[18:53:13] tubbo: i'll tell you when: never
[18:53:26] Senjai: tubbo: We don't
[18:53:28] tubbo: i believe there is a way to get the "current layout", whatever that may be
[18:53:31] lethjakman: has joined #RubyOnRails
[18:53:34] tubbo: lol what is wrong with your project
[18:53:40] tubbo: sounds like a pile of hacks
[18:53:54] Senjai: tubbo: Or you just have never had a project with multiple layouts
[18:53:55] Senjai: https://github.com/solidusio/solidus/tree/master/backend/app/views/spree/layouts
[18:54:03] rhizome: they renamed it to base.html.* and put layout 'base' in application_controller
[18:54:03] tubbo: Senjai: oh FACK ok :)
[18:54:05] tubbo: it's spree
[18:54:11] tubbo: you should have told me haha
[18:54:21] Senjai: It still wouldn't have changed the solution .. :/
[18:54:24] tubbo: even on my projects w/multiple layouts, i still have an application layout.
[18:54:35] Senjai: Yes, but I want to use whatever layout the parent is using
[18:54:38] Senjai: adding an explicit name
[18:54:41] Senjai: is another dependency
[18:54:45] Senjai: that you shouldn't need to have
[18:54:49] tubbo: Senjai: yeah, i think the best way to go here is to just make an empty file...maybe put a comment in there or something
[18:54:54] tubbo: it would certainly be canonical
[18:54:57] Senjai: Yeah, that's what I'm thinkin
[18:55:05] slava_: so it seems like config.eager_load = true improves performance.. not sure by how much, but it breaks some globalize translations and make globalize work unpredictable in some places. (such as form_for) it doesn't translate text_area form content. anyone have any ideas why it's happening?
[18:55:09] diegoviola: how is websockets support in ruby/rails?
[18:55:23] ivanskie: has joined #RubyOnRails
[18:55:27] Senjai: diegoviola: crappy, use elixir/erlang/node
[18:55:31] tubbo: diegoviola: eh. it's about to get better with ActionCable but for now it's not that great.
[18:55:37] tubbo: use elixir.
[18:55:43] Senjai: I did say that one first :P
[18:55:51] bricker: use whatever you want it's all the same
[18:56:04] Senjai: bricker: Except ruby, there are marked downsides to using ruby
[18:56:09] tubbo: yeah i'm kidding obviously
[18:56:10] Senjai: for that kind of approach
[18:56:20] bricker: Senjai: yes, ruby is a pretty bad programming language
[18:56:22] Senjai: Unless you use jruby or something
[18:56:23] tubbo: this is basically AC: http://www.phoenixframework.org/v0.14.0/docs/channels
[18:56:27] diegoviola: Senjai: do I really have to use node for this? sigh
[18:56:38] Senjai: diegoviola: It's better than ruby, the best solution is elixir
[18:56:45] Senjai: diegoviola: for this usecase, not all usecases
[18:56:47] tubbo: diegoviola: considering he offered 3 different other suggestions before he got to node...no?
[18:56:59] diegoviola: I need to build a chat thing
[18:57:00] rhizome: ruby is not a bad programming language
[18:57:08] Senjai: bricker: It isn't, just that there are things meant to solve this kind of problem.
[18:57:15] Senjai: diegoviola: elixir
[18:57:16] tubbo: diegoviola: but there are WS libs for ruby and you *can* accept websockets with a rails app iirc
[18:57:23] bricker: rhizome: I guess it depends who you ask an in what context
[18:57:24] tubbo: it's just not that great
[18:57:40] Senjai: TBH you could do this fine with jruby
[18:57:47] Senjai: and hook into the java libs for this kind of stuff
[18:57:54] Senjai: but its not worth the hassle imo
[18:58:09] Senjai: ruby as a language is fine
[18:58:17] rodfersou: has joined #RubyOnRails
[18:58:19] Senjai: it's the constraints at the lower level that hold it back in certain cases
[18:58:38] gambl0re: has joined #RubyOnRails
[19:00:12] chouhoul_: has joined #RubyOnRails
[19:00:54] kitsuneyo: is there a layout view file i can create for each controller?
[19:01:19] cnk: kitsuneyo: there used to be
[19:01:24] kitsuneyo: something that loads before anything else for each controller?
[19:01:28] GPrime: Hi guys, I can't seem to get radio buttons working with my form.. Formatting is good. But my boolean field is not being updated (true/false from the radio buttons)
[19:01:38] cnk: try adding something named for your controller into the app/views/layouts folder
[19:02:12] bf4: has joined #RubyOnRails
[19:02:30] kitsuneyo: what like monkeys.html.erb for a monkeys_controller?
[19:02:33] zendrix: has joined #RubyOnRails
[19:02:36] cnk: kitsuneyo: Not sure what you mean by 'loads before' a layout file named for the controller should end up as the layout for views inthat controller
[19:02:46] cnk: yes - that is what rails has done in the past
[19:02:55] cnk: see if it stil does
[19:03:02] kitsuneyo: ok i'll try it
[19:03:07] Pupeno: has joined #RubyOnRails
[19:03:11] cnk: otherwise, just add a line about what layout to use
[19:03:13] Pupeno: has joined #RubyOnRails
[19:03:57] cnk: at the top of monekys_controller.rb layout: "custom_file_for_monkeys" (or whatever you called the file)
[19:04:33] Voker57|2: has joined #RubyOnRails
[19:06:41] man_in_the_b0x_: has joined #RubyOnRails
[19:07:24] brain_shim: has joined #RubyOnRails
[19:08:58] Schalla: Q: Why is the automatic generated primary key randomized and not starting at 1?
[19:09:24] Schalla: Not an issue at all, just was curious for the reasoning
[19:09:33] oflannabhra: has joined #RubyOnRails
[19:10:00] yardenbar: has joined #RubyOnRails
[19:10:51] nzst: I typically see the primary keys start at 1
[19:10:55] gambl0re: has joined #RubyOnRails
[19:11:03] Schalla: "id": 298486374,
[19:11:03] Schalla: "title": "MyString",
[19:11:19] Schalla: Model is generated, and I loaded the fixture with db:fixture:load
[19:11:23] Schalla: Unsure if that might be the reason
[19:11:26] slava_: anyone? :D
[19:11:41] Schalla: (Have to admit that I am new to rails in general, so I might hav done some stupid mistake.)
[19:11:55] asheinfeld: has joined #RubyOnRails
[19:12:07] tubbo: Schalla: that is actually not random
[19:12:23] tubbo: Schalla: it's a numerical representation of the name of your fixture
[19:13:08] Schalla: Ah. So basically if I inserted it normally via AR it would start at 1, correct?
[19:14:10] Schalla: nzst: Valid.
[19:15:22] gambl0re: has joined #RubyOnRails
[19:16:19] Schalla: nzst: Yup, works. :) Thanks tubbo for the explanation !
[19:16:32] knikolov: has joined #RubyOnRails
[19:18:41] podman: has joined #RubyOnRails
[19:23:08] ksweez: has joined #RubyOnRails
[19:23:26] gambl0re: has joined #RubyOnRails
[19:23:29] cac: has joined #RubyOnRails
[19:23:29] guillaume-rb_: has joined #RubyOnRails
[19:23:42] k4nd4lf: has joined #RubyOnRails
[19:23:49] DoubleMalt: has joined #RubyOnRails
[19:26:29] blackmes1: has joined #RubyOnRails
[19:26:56] mikecmpbll: has joined #RubyOnRails
[19:27:22] kies^: has joined #RubyOnRails
[19:29:03] oflannabhra: has joined #RubyOnRails
[19:29:19] brain_shim: has joined #RubyOnRails
[19:29:23] Frem: has joined #RubyOnRails
[19:29:24] rikkipitt: has joined #RubyOnRails
[19:31:05] eoy: has joined #RubyOnRails
[19:31:40] rikkipitt: has joined #RubyOnRails
[19:32:42] bradleyprice: has joined #RubyOnRails
[19:33:44] atrius: has joined #RubyOnRails
[19:33:45] baweaver: has joined #RubyOnRails
[19:33:48] Schalla: I am currently dealing with creating a REST API in Rails. My current issue is that responding the object itself with render :json is not really a solution I am happy with, so I would prefer creating json view templates. When creating it I tried implementing <%= $users.to_json() %>, which printed it, but didnt encode it proper.
[19:34:01] Schalla: Is there a solution to this or is render :json really the rather recommended method?
[19:34:13] waseem_: Schalla: You should use jbuilder.
[19:34:34] fryguy: Schalla: ActiveModelSerializers, or optionall jbuilder
[19:34:39] fryguy: jbuilder is quite slow though
[19:34:45] waseem_: Schalla: http://railscasts.com/episodes/320-jbuilder
[19:35:05] jeanlinux: has joined #RubyOnRails
[19:35:44] Schalla: waseem_ & fryguy: hanks for your response. Is the performance incredible much slower or rather a thing one should worry later about?
[19:35:54] Schalla: Cannot estimate whats "slow" is in your opinion :p
[19:35:57] fryguy: Schalla: it's probably something you should worry about up front
[19:35:57] Senjai: fryguy: jbuilder is not slow
[19:36:07] Senjai: fryguy: It depends on what you're using to serialize your json
[19:36:16] Senjai: fryguy: If you use Oj, jbuilder is just fine
[19:36:20] Senjai: AMS is amazing too
[19:36:20] fryguy: Senjai: i was using oj
[19:36:39] fryguy: and activemodel serializer was more than an order of magnitude faster at rendering across a variety of different response types, shapes, and sizes
[19:36:47] cac: has joined #RubyOnRails
[19:36:47] apofis: has joined #RubyOnRails
[19:36:54] Senjai: I'm not saying AMS isn't faster
[19:36:59] Senjai: I'm saying jbuilder isn't slow
[19:37:02] fryguy: we had several templates that were taking 10s to low 100s of milliseconds to render
[19:37:17] baweaver: has joined #RubyOnRails
[19:37:19] Senjai: That's not slow
[19:37:31] nym: has joined #RubyOnRails
[19:37:35] fryguy: when I want to complete an entire response in < 100ms it's very slow
[19:37:49] Senjai: fryguy: When you want to complete an entire response in < 100ms dont use ruby ;)
[19:38:05] fryguy: Senjai: i haven't had much of a problem with it so far
[19:38:15] fryguy: in the giant app I work with we aren't there yet, but making progress
[19:38:24] fryguy: well, not GIANT, but quite large (1500+ routes)
[19:38:57] lsone_: has left #RubyOnRails: ()
[19:39:05] Schalla: So the serializer is pretty much executed before render json: is called, there for you can modify the record and thus the output
[19:39:07] Schalla: okay, understood.
[19:39:12] Schalla: jbuilder is a DSL,
[19:39:18] fryguy: not caring about performance, and thinking that several hundreds of milliseconds, or god forbid, whole seconds, is reasonable performance is something that you should address immediately
[19:39:39] flujan: has joined #RubyOnRails
[19:40:09] lsone: has joined #RubyOnRails
[19:40:10] bradleyprice: has joined #RubyOnRails
[19:40:25] flujan: Hello guys, I create a simple api. It will return a json. I added http_basic_authentication to it. curl is working as the browser. How can I consume this api from other ruby script?
[19:40:26] lsone: Senjai: You can easily get sub-100 responses in Ruby
[19:41:09] fryguy: flujan: Net::HTTP, or something like httparty, or faraday, there are tons of libraries and gems for making http requests, also check out ruby-toolbox for a bit of a popularity contest between them
[19:41:10] darrencauthon: has joined #RubyOnRails
[19:41:19] cac: has joined #RubyOnRails
[19:42:06] slava_: any ideas why globalize3 would get incorrect translation for text_area but the correct ones for other fields on the form.. and once I restart the server it gets the correct ones again.... a breaks again a while later?
[19:42:23] apofis: has joined #RubyOnRails
[19:45:27] bradleyp_: has joined #RubyOnRails
[19:45:33] toretore: has joined #RubyOnRails
[19:45:38] saadq: has joined #RubyOnRails
[19:48:25] yaymukund: has joined #RubyOnRails
[19:48:46] chouhoulis: has joined #RubyOnRails
[19:51:31] framling: has joined #RubyOnRails
[19:51:32] kitsuneyo: what's the deal with the views/application folder then? i don't even have that folder. what else can i put in there?
[19:52:07] kitsuneyo: i've been using views/layout, is /application a better place to put some files?
[19:53:11] fryguy: kitsuneyo: no
[19:54:30] gambl0re: has joined #RubyOnRails
[19:54:38] kitsuneyo: i'm using /application for my global _sidebar view
[19:54:48] kitsuneyo: nothing else good to put in there?
[19:56:34] benlieb: has joined #RubyOnRails
[19:57:38] rubyonrails685: has joined #RubyOnRails
[19:57:53] blackmes1: has joined #RubyOnRails
[19:59:01] djbkd: has joined #RubyOnRails
[19:59:35] cac: has joined #RubyOnRails
[20:00:23] HenriettaSalt: has joined #RubyOnRails
[20:00:35] gambl0re: has joined #RubyOnRails
[20:01:36] Pwnna: has left #RubyOnRails: ("Leaving")
[20:02:04] tubbo: has joined #RubyOnRails
[20:03:14] slava_: any ideas why globalize3 would get incorrect translation for text_area but the correct ones for other fields on the form.. and once I restart the server it gets the correct ones again.... a breaks again a while later?
[20:03:28] flujan: fryguy: http://pastie.org/10270528
[20:03:42] flujan: fryguy simple controller and a simple client. The cliente is not working.
[20:03:49] flujan: fryguy: any idea?
[20:03:55] fryguy: show some logs or something
[20:04:28] zendrix: has joined #RubyOnRails
[20:04:50] yaymukund: has joined #RubyOnRails
[20:06:10] rhizome: slava_: nope
[20:07:03] findaway: has joined #RubyOnRails
[20:08:56] danman: has joined #RubyOnRails
[20:08:58] flujan: fryguy: http://pastie.org/10270532
[20:09:14] snockerton: is there a way to switch rails console to use pry instead?
[20:09:35] fryguy: flujan: seems pretty obvious to me, you are getting a redirect
[20:09:39] fryguy: take a look at your server logs and see why
[20:11:39] snockerton: nvm, https://github.com/rweng/pry-rails
[20:12:07] xicreative: snockerton: look at pry-rails
[20:12:15] yaymukund: has joined #RubyOnRails
[20:12:25] xicreative: snockerton: lol beat me to it. nvm. :-P
[20:13:06] snockerton: yea at first I thought it was just pry you could invoke in rails like binding.pry
[20:13:34] snockerton: but then i read the readme, if you add it to your gemfile, rails console uses it by default
[20:14:00] fryguy: if you want rails-like binding pry, check out better_errors, which basically puts pry in your browser on errors
[20:14:05] bf4: has joined #RubyOnRails
[20:14:11] snockerton: displays hashes so they are actually readable
[20:14:52] flujan: fryguy: It is saying that my before_filter is redirecting my request??? But the controller api doesn???t have a before_filter???.
[20:15:09] fryguy: flujan: so find out where the before_filter is coming from
[20:15:28] flujan: http://pastie.org/10270543
[20:15:31] fryguy: flujan: first suspect is probably the basicauth, so try getting rid of that to eliminate variables
[20:15:32] __butch__: has joined #RubyOnRails
[20:15:49] DLSteve: has joined #RubyOnRails
[20:16:19] flujan: class ApiController < ApplicationController
[20:16:47] flujan: so I believe it inherits the before_filter from application_controller. Could this be the problem?
[20:16:47] mozzarella: has joined #RubyOnRails
[20:17:06] fryguy: could be, sure
[20:20:12] zendrix: has joined #RubyOnRails
[20:20:39] baweaver: has joined #RubyOnRails
[20:20:42] zendrix: has joined #RubyOnRails
[20:21:18] Papierkorb: has joined #RubyOnRails
[20:21:22] drPoggs: has joined #RubyOnRails
[20:21:25] dstarh: has joined #RubyOnRails
[20:21:25] elektronaut: has joined #RubyOnRails
[20:21:55] bklane: has joined #RubyOnRails
[20:22:20] yfeldblum: has joined #RubyOnRails
[20:24:03] nzst: has joined #RubyOnRails
[20:24:07] lethjakman: has joined #RubyOnRails
[20:24:20] momomomomo: has joined #RubyOnRails
[20:24:33] WillAmes: has joined #RubyOnRails
[20:25:06] renegadeandy: has joined #RubyOnRails
[20:25:56] workmad3: has joined #RubyOnRails
[20:26:00] renegadeandy: Hi everyone! I am trying my hand at a RSpec feature test, and im using factorygirl to create my user object. The problem is I think devise and its user confirmation mailers etc are getting in the way...can somebody advise what i am doing wrong here...or if im not doing anything wrong..how best to handle this: https://gist.github.com/renegadeandy/4bf93a4a5759679ea49f
[20:26:06] choke: has joined #RubyOnRails
[20:26:22] bradleyprice: has joined #RubyOnRails
[20:27:01] flujan: has left #RubyOnRails: ()
[20:27:27] Senjai: renegadeandy: You're going to need to define default url options
[20:27:31] Senjai: renegadeandy: in your test environment file
[20:27:37] Senjai: or in your spec helper
[20:28:02] eGGsha: has joined #RubyOnRails
[20:29:19] bklane: has joined #RubyOnRails
[20:30:28] renegadeandy: Senjai: like this : config.default_url_options[:host] = "localhost"
[20:30:59] Senjai: Something like that. And for the mailer too if that's a thing. I haven't had to set any of this up for a while
[20:31:15] Senjai: Generally, I always use path helpers, never url helpers anyway.
[20:31:17] fatephd: has joined #RubyOnRails
[20:32:13] darrencauthon: has joined #RubyOnRails
[20:32:29] renegadeandy: Senjai: config.action_mailer.default_url_options = { :host => 'localhost:3000' } this worked! But will in the test I need to 'validate' the user....or is there a way i can avoid doing that?
[20:32:31] bin_005: has joined #RubyOnRails
[20:32:36] fgo: has joined #RubyOnRails
[20:32:45] workmad3: has joined #RubyOnRails
[20:34:15] Senjai: renegadeandy: Dont include the port
[20:34:36] Senjai: localhost should be fine as the host
[20:34:50] Senjai: renegadeandy: You should have to validate the user
[20:34:55] Senjai: there should be a user signed in
[20:35:04] Senjai: You can stub warden with the user to avoid going through the sign in views
[20:35:17] Senjai: You can find more information on that in the devise wiki
[20:35:33] renegadeandy: Senjai: well....no, because the test creates a new user....and then devise requests it ot be confirmed
[20:35:37] renegadeandy: im wondering how to handle that in a test
[20:35:44] Senjai: To be confirmed?
[20:35:44] renegadeandy: because that sends an email....
[20:35:48] Senjai: Why are you testing devise
[20:35:51] Senjai: Dont test devise
[20:35:54] renegadeandy: i dont want to....
[20:35:55] Senjai: devise isn't part of your application
[20:35:58] zendrix: has joined #RubyOnRails
[20:36:02] Senjai: expect devise to send its mail when it should be
[20:36:09] Senjai: And assume that devise has tests around that
[20:36:17] Senjai: You can test your mailer directly with a unit test
[20:36:19] jenrzzz: has joined #RubyOnRails
[20:36:25] Senjai: but dont test what triggers it to be sent, if its being sent by devise
[20:36:46] renegadeandy: Yes....but in my test...I need to create a new user....and then the user will do things in the test to their account and in the site. BUT devise of course is saying...you need to CONFIRM the user by clicking the link in the email....but this is a test...so i don't have access to the email etc.
[20:36:47] Senjai: If you have to, you can do it more easily in a unit test
[20:36:52] kadoppe: has joined #RubyOnRails
[20:37:01] Senjai: No, you can override that when creating the user
[20:37:21] Senjai: renegadeandy: create :user, confirmed_at: DateTime.now
[20:37:29] x-light: has joined #RubyOnRails
[20:37:29] renegadeandy: Senjai: ive read thats a bit of a hack...
[20:37:31] Senjai: renegadeandy: user.skip_confirmation!
[20:37:44] Senjai: YOu can throw that in an after(:create) on the factory definition
[20:37:50] renegadeandy: Senjai: ok - ill do confirmed at , so at least it checks other validations
[20:38:08] Senjai: renegadeandy: either that or skip_confirmation!, at the factory level
[20:38:30] Senjai: http://stackoverflow.com/questions/7465467/devise-create-user-account-with-confirmed-without-sending-out-an-email
[20:38:58] Senjai: I would add this as a trait though
[20:39:06] Senjai: create :confirmed_user
[20:39:09] Senjai: instead of create :user
[20:39:22] rhizome: trait :confirmed
[20:39:23] Senjai: or create :user, traits: [:confirmed]
[20:39:28] Senjai: rhizome: Damnit rhizome
[20:39:45] Senjai: but I would still make another factory for that trait, because it'd be used sooo often
[20:40:02] rhizome: nah. create(:user,:confirmed)
[20:40:10] renegadeandy: Senjai: so this doesnt appear to work : https://gist.github.com/renegadeandy/2ba2c9a3a833d3ed7344
[20:40:18] rhizome: a couple more characters than :confirmed_user, but i like it better
[20:42:27] cac: has joined #RubyOnRails
[20:42:54] smathy: I often make the default :user a confirmed user ready to go, because I want to use that much more often than an unconfirmed user.
[20:43:22] renegadeandy: smathy: which is what I am trying to do! - but my after is not voiding the confirmation step it seems> https://gist.github.com/renegadeandy/2ba2c9a3a833d3ed7344
[20:43:52] Senjai: rhizome: Either or really. If you have several traits for example, its better to create another factory with those traits
[20:44:00] Senjai: renegadeandy: That wouldn't sorry.
[20:44:16] Senjai: renegadeandy: skip_confirmation! needs to be called before the record is saved
[20:44:27] Maletor: has joined #RubyOnRails
[20:44:42] Senjai: You can do hackery around the strategy to get that to work, but I would just pass in a trait :confirmed { confirmed_at DateTime.now }
[20:44:49] Senjai: add that to your factory definition
[20:46:26] hololeap: has joined #RubyOnRails
[20:46:31] smathy: renegadeandy, your original gist didn't have that skip_confirmation! - can you update your gist to show what error you're getting now.
[20:48:00] cac: has joined #RubyOnRails
[20:49:02] smathy: Senjai, that's not true, it just has to be called before that user tries to login.
[20:50:09] Senjai: smathy: Oh?
[20:50:13] Senjai: I dont have confirmable here locally
[20:50:16] Senjai: so I won't contest that
[20:52:30] stef1a: has joined #RubyOnRails
[20:53:12] smathy: Actually, that's the problem renegadeandy - you're using an `after(:create)` and yet you're not saving.
[20:53:26] Senjai: I wouldn't want a double save
[20:53:32] Senjai: I would just touch confirmed_at and be done with it
[20:53:46] smathy: You don't want to save?
[20:53:47] Senjai: or have it as a trait
[20:53:54] Senjai: Not if I just created the record
[20:53:55] smathy: Oh, sorry, reading backlog.
[20:53:59] Senjai: I dont want create :user, to hit the db twice
[20:54:09] smathy: Sure, but just make it a before(:create)
[20:54:16] Senjai: That's fine too
[20:54:21] Senjai: Again, I would just confirmed_at
[20:54:23] coderhs: has joined #RubyOnRails
[20:54:30] Senjai: but thats a preference thing
[20:54:49] smathy: Sure, which is ok here because it's such a well known implementation detail that it's unlikely to change.
[20:55:01] Senjai: smathy: Your solution is the most technically correct, yes.
[20:55:11] smathy: ...but generally speaking, it's better to use the public API so you're less likely for things to break if the underlying implementation is changed later.
[20:55:16] Glyphik: has joined #RubyOnRails
[20:55:19] mozzarella: has joined #RubyOnRails
[20:55:19] Senjai: Yes, I would agree
[20:55:39] smathy: Who knows where renegadeandy went ;)
[20:55:52] stef1a: i'm trying to pass a hash into a form select so that the options are shown as, say, "2015-2016", but the IDs passed to the controller are 2015. I have this code, but I get this output: https://gist.github.com/smlance/8ca9d4e496805d53f83f help?
[20:56:37] listrophy: has joined #RubyOnRails
[20:56:48] Senjai: stef1a: First of all, you should not be doing a get_years_from_hash
[20:57:29] Senjai: stef1a: FormattedYears.new(AcademicYear.all).to_h
[20:57:33] Senjai: would be an ideal interface
[20:57:49] momomomomo: has joined #RubyOnRails
[20:57:55] stef1a: Senjai: a new class?
[20:58:06] stef1a: seems overkill for just a hash
[20:58:15] Senjai: Formatting years into a hash is a totally isolated responsibility
[20:58:31] ivanskie: has joined #RubyOnRails
[20:58:39] Senjai: formatted_year(y) is a helper method or some method on the view context?
[20:58:47] Senjai: You should rarely ever need to reference the view context.
[20:59:06] renegadeandy: Senjai: smathy thank you - ill used confirmed at trait
[20:59:10] Senjai: Just use I18n, or make that a proper method in the application somewhere. Or include a formatting module
[20:59:12] stef1a: Senjai: it's a helper method
[20:59:24] Senjai: stef1a: Include said helper in controllers where you need to use it
[20:59:35] dnewkerk: has joined #RubyOnRails
[21:00:03] stef1a: Senjai: i appreciate the feedback, but making those changes won't resolve the error
[21:00:31] Senjai: Did you inspect the hash?
[21:00:36] Senjai: THrow a pry there
[21:00:39] stef1a: it's something subtle like this: http://stackoverflow.com/questions/21239675/undefined-method-empty-for-nilnilclass-when-adding-a-new-field-form
[21:00:43] Senjai: something is nil where it should be a collection
[21:00:44] zendrix: has joined #RubyOnRails
[21:00:49] Senjai: Throw a pry there
[21:00:58] jenrzzz: has joined #RubyOnRails
[21:01:02] Senjai: look at the output
[21:01:07] Senjai: Before the error
[21:01:09] Senjai: <% binding.pry %.
[21:01:12] Senjai: <% binding.pry %>
[21:01:20] stef1a: ah, gotcha
[21:01:29] Etriaph: has joined #RubyOnRails
[21:01:30] stef1a: i'd always done it in the rb code, never the erb...
[21:01:31] Senjai: inspect @academic_years_hash, and whatever formatted_year... returns
[21:01:34] bradleyp_: has joined #RubyOnRails
[21:01:37] Senjai: It's all just code mang
[21:01:56] Etriaph: G'day folks.
[21:02:05] stef1a: that it is
[21:02:20] anjen: has joined #RubyOnRails
[21:02:20] tvw: has joined #RubyOnRails
[21:03:36] stef1a: Senjai: well, the hash somehow becomes nil after i submit a POST. i wasn't aware of that before, and i'll give it a closer look. thanks! somehow i missed the memo about using binding.pry in erb
[21:03:54] stef1a: and thanks for the other advice as well!
[21:06:03] Lightsword: has joined #RubyOnRails
[21:07:17] renegadeandy: Senjai: using rspec what is the best way to run a db:seed before the tests run?
[21:07:58] Senjai: renegadeandy: Your tests should not need seed data. Use fixtures and configuration instead.
[21:08:01] Senjai: Or preloaded factories
[21:08:16] Senjai: Seed data is meant for the initial setup of a dev or production environment
[21:08:27] blackmes1: has joined #RubyOnRails
[21:08:53] darrencauthon: has joined #RubyOnRails
[21:09:07] bin_005: has joined #RubyOnRails
[21:09:35] renegadeandy: Senjai: It seems a bit silly to have to recode all the things ive already done in my seeds, in a factory!
[21:09:53] Senjai: Why do you need seeds
[21:09:56] renegadeandy: Senjai: literally all the search categories, sub categories, etc are all built in seeds....
[21:10:04] Senjai: Build them in fixtures instead
[21:10:11] Senjai: and have db:seed load the fixtures
[21:10:14] Senjai: if they're required
[21:10:25] Senjai: Like you shouldnt need all of your dev search categories
[21:10:28] Senjai: and sub categories
[21:10:39] Senjai: You should just bea able to create :category_with_subcategories etc
[21:11:00] renegadeandy: Im not sure of the benefit...seems to me like since ive done it this way, the quickest way to get this running would be to invoke the seed directly from a rspec helper before any tests run....
[21:11:16] jeanlinux: has joined #RubyOnRails
[21:11:22] Senjai: You can, but seeds are not the same as fixtures.
[21:11:24] renegadeandy: id be spending ages rejigging bits for semantic differences
[21:11:32] Senjai: Why do you need a complete set of categories?
[21:11:35] Senjai: You shouldn't require that
[21:11:46] Senjai: You shouldn't need all of your development data for tests
[21:11:55] renegadeandy: i suppose I don't but its just because itd be quicker
[21:11:58] Senjai: If you need to test going to a product page, create a product, then visit the link for that product
[21:12:03] renegadeandy: for me to get the test created
[21:12:21] Senjai: renegadeandy: Maybe now. But your tests will be slow as hell over time. And you'll run into scenarios where you expect your database to be clean, but it isnt
[21:12:24] Senjai: and that will cause LARGE problems
[21:12:26] Senjai: down the road
[21:12:27] hotpancakes: has joined #RubyOnRails
[21:12:41] renegadeandy: Senjai: yeah ok...so your suggesting using fixtures...which is not something ive come across
[21:12:51] Senjai: renegadeandy: I'm suggesting use neither
[21:12:55] Senjai: the best solution is a clean database
[21:13:03] Senjai: or one with a few fixtures, not a complete set of everything
[21:13:03] GPrime: radio buttons arent responding to boolean values, would any know of this issue?
[21:13:18] Senjai: GPrime: !code
[21:13:18] helpa: GPrime: 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.
[21:13:37] IanV0rn2341: has joined #RubyOnRails
[21:13:41] renegadeandy: Senjai: Ok so. at the moment there are no categories, or subcategories...so how do i create something which creates a subset of these before my tests run?
[21:13:41] GPrime: http://stackoverflow.com/questions/31193967/rails-application-radio-buttons-do-not-update-boolean-field
[21:13:51] codepete: has joined #RubyOnRails
[21:13:57] Senjai: renegadeandy: Do you need them every time you run tests?
[21:13:59] Senjai: or just features
[21:14:02] GPrime: I've already attempted the 2 answers, but they do not work
[21:14:08] Senjai: background { create :category_with_subcategories }
[21:14:16] Senjai: GPrime: !code
[21:14:16] helpa: GPrime: 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.
[21:14:39] renegadeandy: Senjai: it will be required for all tests...
[21:14:46] Senjai: renegadeandy: https://github.com/fnando/factory_girl-preload
[21:14:53] Senjai: renegadeandy: Should it be required is the question
[21:15:04] Senjai: And the answer is rarely yes
[21:15:23] stef1a: has joined #RubyOnRails
[21:15:33] Senjai: You can usually architect your application in a way that requires only a minimal set of database records to be present
[21:16:16] renegadeandy: Senjai: They are not all required...but if a user signs in....and the homepage has as search box partial which gets filled with categories....then I need to have SOME categories
[21:16:35] renegadeandy: Senjai: otherwise the test craps out!
[21:16:40] renegadeandy: which its doing at the moment
[21:16:41] Senjai: renegadeandy: As in fails?
[21:16:57] Senjai: renegadeandy: You can never render your page without any categories? That's a problem
[21:17:05] renegadeandy: undefined method `sub_categories' for nil:NilClass
[21:17:17] Aswebb_: has joined #RubyOnRails
[21:17:25] renegadeandy: Senjai: well it wouldnt ever really make any sense for that to be seen
[21:17:32] renegadeandy: its never going to be the case. ever.
[21:17:39] ur5us: has joined #RubyOnRails
[21:17:47] renegadeandy: so im trying to workout the best way to create 1 or 2 categories....before any tests are run.
[21:18:01] Senjai: renegadeandy: Don't render the partial if you have no categories
[21:18:15] Senjai: It wouldnt make sense to show that partial on prod either
[21:18:22] Senjai: renegadeandy: Do it with factories
[21:18:23] GPrime: https://gist.github.com/PQTran/262baf378a49761c5f04
[21:18:27] Senjai: renegadeandy: and factory girl preload
[21:18:42] weaksauce: renegadeandy Senjai is not saying that you don't need test data. Senjai is saying that you shouldn't need ALL of the data to run your tests. just a simple factory or fixture that you add for the relevant tests.
[21:18:47] renegadeandy: Senjai: Thats a good defensive approach. BUT it doesnt actually solve my question. How best to create things I need for my tests....are you suggesting the factorygirl preload?
[21:19:06] bronson: has joined #RubyOnRails
[21:19:07] Senjai: what weaksauce said
[21:19:23] Lightsword: has joined #RubyOnRails
[21:19:25] Senjai: renegadeandy: I use preload in lieu of fixtures, yes.
[21:19:31] Senjai: But fixtures are also appropriate
[21:19:45] renegadeandy: Senjai: Ok I get it. *im just tired and want a quick easy solution. Instead i am going to have slower more painful solution :( *
[21:20:06] renegadeandy: Senjai: That is actually better in the long run
[21:20:37] Senjai: renegadeandy: Honestly, avoid the quick fixes, and you'll avoid the month long refactors later on.
[21:20:44] Senjai: Focus on doing things the right way
[21:20:50] Senjai: it pays off, trust me
[21:20:53] Doddlin: has joined #RubyOnRails
[21:20:55] cac: has joined #RubyOnRails
[21:21:02] Zadrel: any way to tranform this ":data_fancybox_type" into this ":data-fancybox-type"?
[21:21:13] Senjai: GPrime: Would that not use the @comment
[21:21:17] renegadeandy: Zadrel: find and replace all?
[21:21:18] Senjai: GPrime: @comment's attribute?
[21:21:26] renegadeandy: Senjai: Ok - sound advise thank you
[21:21:33] renegadeandy: ill investigate preload
[21:21:36] Doddlin: Hi all! Can someone please help me, I???m trying to fire a jQuery-script as I want to use AJAX to fill a form with a server-response
[21:21:54] yaymukund: has joined #RubyOnRails
[21:22:01] Doddlin: I have the response as a JSON-string but I can???t for my life get the script in my .js to fire
[21:22:06] Zadrel: renegadeandy: sorry for not being clear, the "-" character breaks the symbol, so i cant render the right HTML option...
[21:22:28] darrencauthon: has joined #RubyOnRails
[21:22:39] Doddlin: should I use a $().click-function despite having the controller returning my JSON already?
[21:23:03] Zadrel: correcting=>any way to tranform this ":data_fancybox_type" into this ":data-fancybox-type"? the "-" character breaks the symbol, so i cant render the right HTML option...
[21:23:05] choke: has joined #RubyOnRails
[21:23:10] listrophy: Zadrel: `:"data-fancybox-type"`
[21:23:21] Zadrel: listrophy: thx i'll try that
[21:23:49] listrophy: Zadrel: np. quotes let you put pretty much anything into the name of a symbol... though that's not exactly encouraged :)
[21:25:10] choke: has joined #RubyOnRails
[21:25:12] listrophy: Zadrel: also, avoid using this strategy to interpolate symbol names. that's a potential security problem (mem overflow DoS)
[21:27:33] cochise: has joined #RubyOnRails
[21:28:07] GPrime: Senjai, Hi. Do you think you could explain a bit further what must be done with @comment? Thanks, I'm pretty new to rails
[21:28:10] stef1a: what's the equivalent of a before_action that's also called on every render?
[21:28:24] Zadrel: listrophy: i understand, but my rails 3 didn't recognized the backtraces and redered **="iframe"=""** instead of **data-fancybox-type=iframe**
[21:29:12] listrophy: backtraces?
[21:29:28] listrophy: sorry, you shouldn't have included the ` characters
[21:29:32] bradleyprice: has joined #RubyOnRails
[21:29:47] Zadrel: listrophy: dumb me, thx :P
[21:30:00] cac: has joined #RubyOnRails
[21:30:00] listrophy: eh, no worries!
[21:30:16] stef1a: backticks
[21:30:17] listrophy: ` == "backtick"
[21:31:30] Zadrel: listrophy: worked
[21:31:37] Zadrel: listrophy: and thx again
[21:31:38] alexhartley: has joined #RubyOnRails
[21:31:53] Zadrel: listrophy: don't know where i took "backtrace" from
[21:32:08] givanse: has joined #RubyOnRails
[21:32:08] listrophy: words are hard. ain't no thing
[21:32:47] yfeldblum: has joined #RubyOnRails
[21:33:01] gambl0re: has joined #RubyOnRails
[21:34:30] Exuma: has joined #RubyOnRails
[21:35:05] moeabdol: has joined #RubyOnRails
[21:35:11] MEATCHICKEN: If a post can have comments, would I "create" posts in a comments#create action or posts#create_comment
[21:35:17] MEATCHICKEN: This is for an api
[21:35:51] listrophy: create comments, you mean?
[21:36:31] listrophy: in my experience, that would be in a comments#create action
[21:38:01] listrophy: meatchicken: so, that would be '/posts/:post_id/comments' => comments#create. route would be: resources(:posts) { resources :comments }
[21:38:50] frishi: has joined #RubyOnRails
[21:38:51] erich: has joined #RubyOnRails
[21:39:26] MEATCHICKEN: listrophy, good idea thanks. Not going to nest it though
[21:39:31] baweaver: has joined #RubyOnRails
[21:39:36] MEATCHICKEN: as comments can have comments self-referentially
[21:41:28] blackmesa: has joined #RubyOnRails
[21:41:38] hotpancakes: has joined #RubyOnRails
[21:41:42] Scripore: has joined #RubyOnRails
[21:42:06] blackmesa: hi all. Id like to set 10 virtual attributes that I want to use in a form. Do I have to put 10x 'attr_accessors' in my model?
[21:42:11] hackeron: has joined #RubyOnRails
[21:42:22] listrophy: meatchicken: k. i'd still do comments#create. maybe require a parent_id and/or post_id param
[21:42:46] listrophy: blackmesa: you can string the names together with commas
[21:43:00] renegadeandy: Senjai: i am giving preload a whirl.....hitting my head off this : https://gist.github.com/renegadeandy/2df9334b62cecf43fda6
[21:43:04] listrophy: attr_accessor :foo, :bar, :baz
[21:43:57] s2013: has joined #RubyOnRails
[21:44:04] Doddlin: has left #RubyOnRails: ()
[21:44:10] radialneon: has joined #RubyOnRails
[21:44:29] blackmesa: listrophy: thx. so I guess I have to write them all out? I read about 'serialize' method. Would this help me in anyway? Because my virtual attribute would all be like :attr1, :attr2, :attr3 (numbering)
[21:44:41] Senjai: renegadeandy: Unfortunately I gotta get back to work :( Maybe someone else can help you for now?
[21:45:45] listrophy: blackmesa: no. serialize is for storing non-primitives in the DB. you could maybe do something like 1.upto(8) {|n| attr_accessor :"attr#{n}" }
[21:45:48] workmad3: has joined #RubyOnRails
[21:45:59] listrophy: i'm not sure I'd be thrilled with that solution. seems hacky, but it should work
[21:46:41] blackmesa: listrophy: will give it a try :) thx
[21:47:08] renegadeandy: Senjai: no problem, thanks for the help earlier
[21:47:23] gaussblurinc1: has joined #RubyOnRails
[21:47:25] renegadeandy: Can anybody help me with this factorygirl preload problem I am having : https://gist.github.com/renegadeandy/2df9334b62cecf43fda6
[21:48:15] arooni-mobile: has joined #RubyOnRails
[21:48:24] choke: has joined #RubyOnRails
[21:50:41] zorak8: has joined #RubyOnRails
[21:51:58] cac: has joined #RubyOnRails
[21:54:48] cajone: has joined #RubyOnRails
[21:54:52] lethjakman: has joined #RubyOnRails
[21:55:04] cajone: has left #RubyOnRails: ()
[21:55:10] lestrade: has joined #RubyOnRails
[21:56:09] moeabdol: has joined #RubyOnRails
[21:59:08] nothingmuch: has joined #RubyOnRails
[21:59:18] rhizome: that seems like a pretty useless idea overall
[21:59:53] radialneon: has joined #RubyOnRails
[22:00:12] DoctorMonocular: has joined #RubyOnRails
[22:00:36] choke: has joined #RubyOnRails
[22:00:43] wethu: has joined #RubyOnRails
[22:01:27] brain_shim: has joined #RubyOnRails
[22:01:58] Radar: good morning
[22:02:39] Skizu: has joined #RubyOnRails
[22:03:23] Skizu: Basically, I've a user, it has many accounts, I have transactions it has a user a source and a destination, source and destination are accounts, what kind of relationships do I need for this?
[22:03:44] s2013: has joined #RubyOnRails
[22:05:13] rhizome: not to mean, but are you saying you have a spec and maybe haven't used rails before?
[22:06:38] radialneon: has joined #RubyOnRails
[22:07:02] radialneon: has joined #RubyOnRails
[22:07:18] Skizu: rhizome: What I'm saying is I'm having trouble with this relation, I can't figure out the relation for the transaction
[22:07:43] giwrgosdi: has joined #RubyOnRails
[22:09:34] rubyonrailed: has joined #RubyOnRails
[22:09:58] rhizome: what have you tried?
[22:10:31] Radar: belongs_to :source, class_name: "Account" ?
[22:10:32] rubyonrailed: When i'm searching through this hash https://gist.github.com/anonymous/18f3d31bd2589e970d2e it is running every method. How can I just run the method that the `plan_type` is?
[22:11:03] Radar: rubyonrailed: use a case statement
[22:11:45] rubyonrailed: Radar: I was trying to avoid that, but it will work.
[22:11:59] radialneon: has joined #RubyOnRails
[22:12:26] radialneon: has joined #RubyOnRails
[22:12:36] Skizu: rhizome: I got the relation between the account and user, account belongs to the user, and for the transaction I have... well no idea
[22:12:44] yaymukund: has joined #RubyOnRails
[22:13:11] blackmesa: has joined #RubyOnRails
[22:13:38] eyck: has joined #RubyOnRails
[22:13:43] Skizu: A transaction belongs to the user, but needs to associate the 2 envelopes, this I don't know how to do
[22:14:07] joelbrewer: has joined #RubyOnRails
[22:14:25] Radar: Skizu: [08:10:29] <Radar> belongs_to :source, class_name: "Account" ?
[22:14:45] choke: has joined #RubyOnRails
[22:17:20] centrx: has joined #RubyOnRails
[22:18:06] zendrix: has joined #RubyOnRails
[22:18:45] hotpancakes: has joined #RubyOnRails
[22:18:47] Skizu: Radar: and on the Account I've got has_many :transactions ?
[22:19:07] Radar: Skizu: won't work because an account can have many transactions twice.
[22:19:30] hahuang65: has joined #RubyOnRails
[22:19:32] Radar: belongs_to :source_transactions, class_name: "Transaction", foreign_key: "source_id"
[22:19:40] Radar: Sorry, that should be a has_many
[22:19:42] gambl0re: has joined #RubyOnRails
[22:20:30] Skizu: What about destination an account could be a source of a destination
[22:24:57] cac: has joined #RubyOnRails
[22:25:45] choke: has joined #RubyOnRails
[22:26:23] man_in_the_b0x: has joined #RubyOnRails
[22:27:40] chintanparikh: has joined #RubyOnRails
[22:28:34] ght: Question: We have an old Rails 3.2 project with User and Profile modles and corresponding tables, and of course User has_one :profile, and Profile belongs_to :user. When this was first built years ago, the :dependent => :destroy directive wasn't set originally, so we have a couple orphaned Profiles.
[22:28:38] Skizu: Radar: has_many: :source_transactions, class_name: "Transaction", foreign_key: "source_id" doesn't work as Account isn't just a source it's also a destination
[22:28:59] ght: Is anyone aware of a quick way to determine if a given Profile is orphaned, as in, the corresponding user_id is invalid?
[22:29:25] Radar: Skizu: That will return all the transactions where the account is the source of the transaction. You'll need to define another association called destination_transactions which uses the destination_id as the foreign key
[22:30:16] rickmasta: has joined #RubyOnRails
[22:30:22] Denarii: ght: Profile.includes(:user).where(users: { id: nil }) should do it I think.
[22:30:30] Skizu: Radar: As I assumed, but to get all transactions for an account I'd have to ?
[22:30:58] Denarii: or, rather, will query for profiles where the user doesn't exist
[22:30:59] Radar: Skizu: Join the associations together, account.source_transactions + account.destination_transactions
[22:31:19] Radar: Skizu: Alternatively, you could have another method called transactions which ... I'll gist
[22:31:52] ght: Denarii: Perfect, thank you.
[22:31:54] Radar: Skizu: https://gist.github.com/radar/fa3a9d9084b14a8d85dd
[22:33:50] Kedric: has joined #RubyOnRails
[22:33:53] fgo: has joined #RubyOnRails
[22:34:15] Skizu: Radar: I could kiss you
[22:34:28] zorak8: has joined #RubyOnRails
[22:35:21] Travis-42: has joined #RubyOnRails
[22:37:22] euphoriaa: has joined #RubyOnRails
[22:37:24] pgatt: has joined #RubyOnRails
[22:38:36] mostlybadfly: has joined #RubyOnRails
[22:38:36] icehawk78: has joined #RubyOnRails
[22:38:41] nym: has joined #RubyOnRails
[22:38:46] phrozen77: has joined #RubyOnRails
[22:39:13] Travis-42: has left #RubyOnRails: ()
[22:39:33] darrencauthon: has joined #RubyOnRails
[22:40:12] blackmesa: has joined #RubyOnRails
[22:40:48] bartj3: has joined #RubyOnRails
[22:43:01] britter: has joined #RubyOnRails
[22:43:37] moeabdol: has joined #RubyOnRails
[22:43:44] eyck: has joined #RubyOnRails
[22:44:03] mc_-: has joined #RubyOnRails
[22:44:03] soahccc: has joined #RubyOnRails
[22:44:24] Haydos: has joined #RubyOnRails
[22:44:31] Obfuscate: has joined #RubyOnRails
[22:44:32] x3cion: has joined #RubyOnRails
[22:44:49] vedu: has joined #RubyOnRails
[22:45:08] drPoggs: has joined #RubyOnRails
[22:45:16] alxndr: has joined #RubyOnRails
[22:45:24] nym: has joined #RubyOnRails
[22:45:25] phrozen77: has joined #RubyOnRails
[22:45:38] it_tard: has joined #RubyOnRails
[22:45:40] EiNSTeiN_: has joined #RubyOnRails
[22:45:42] camilasan: has joined #RubyOnRails
[22:46:16] bf4: has joined #RubyOnRails
[22:47:05] alexhartley: has joined #RubyOnRails
[22:48:53] arBmind1: has joined #RubyOnRails
[22:50:59] beauby: has joined #RubyOnRails
[22:55:26] Anakat: has joined #RubyOnRails
[22:57:58] Anakat_: has joined #RubyOnRails
[22:58:06] fwaokda: is there a better way to handle validation errors than setting up checks in a "before_validation" callback?
[22:58:09] blackmesa: has joined #RubyOnRails
[22:59:14] jfarmer: has joined #RubyOnRails
[23:01:01] DoctorMonocular: fwaokda: probably, but what do you mean?
[23:03:06] ewitchin: has joined #RubyOnRails
[23:04:31] fwaokda: DoctorMonocular, well if for instance I set up a validation that the first_name attribute cannot be all caps. I would like to have a way to correct the string when importing data
[23:04:40] yaymukund: has joined #RubyOnRails
[23:05:59] blackhuey: has joined #RubyOnRails
[23:06:29] fwaokda: DoctorMonocular, so if it is all caps instead of just logging the error, I can call a function for that first_name attribute failing and run a ".titleize" on it to correct it. Or whatever other logic i need to run on the all caps string to correct it
[23:08:24] asheinfeld: has joined #RubyOnRails
[23:09:16] Denarii: has joined #RubyOnRails
[23:10:16] asheinfeld: has joined #RubyOnRails
[23:10:37] lethjakman: has joined #RubyOnRails
[23:11:10] smathy: fwaokda, you should probably just run the conversion on everything as part of your import script.
[23:11:45] smathy: fwaokda, if you really want to be more precise then call `.valid?` on the model before trying to save, and then interrogate `.errors` to see what fields need to be pre-processed.
[23:12:46] brain_shim: has joined #RubyOnRails
[23:12:56] cannap: has joined #RubyOnRails
[23:13:04] cannap: has left #RubyOnRails: ("Leaving")
[23:13:21] cajone: has joined #RubyOnRails
[23:14:08] Scriptonaut: I'm ugrading my app from 3.2 to 4.2, and in my features/step_definitions/rake_steps I'm getting: uninitialized constant Rails (NameError)
[23:14:23] DoctorMonocular: fwaokda: I highly recommend that if you want to do some initial data manipulation according to some logic, you should use a service object for that
[23:14:26] Scriptonaut: do you have to manually include something in step definitions or in the rails_helper for rails 4 that you dont' in rails 3?
[23:15:10] DoctorMonocular: basically you'd make a class that accepts the unsaved model in the constructor, then the .save() method of that class would check the model for the various things you're looking for, THEN try to save with validations on
[23:15:37] cajone: has left #RubyOnRails: ()
[23:15:43] DoctorMonocular: please don't go into cvallback hell trying to make the model do more than it's intended to do
[23:15:50] DoctorMonocular: you'll thank yourself later
[23:20:05] Pharaoh2: has joined #RubyOnRails
[23:20:55] fwaokda: DoctorMonocular, what if I just handle it in the new() method for the class/model? or is that a bad idea? My thinking is I could call the super.new then work to see if I need to correct anything?
[23:22:57] Maletor: So Rails 4.2 removes class level respond_to. Are we just supposed to duplicate the logic that returns errors if save failed across our whole API?
[23:23:06] jensel: has joined #RubyOnRails
[23:23:35] w09x: has joined #RubyOnRails
[23:24:35] jordanstorz: has joined #RubyOnRails
[23:25:19] twilling: has joined #RubyOnRails
[23:25:21] workmad3: has joined #RubyOnRails
[23:26:39] Quacko: has joined #RubyOnRails
[23:29:48] hololeap: has joined #RubyOnRails
[23:30:29] ecksit: has joined #RubyOnRails
[23:31:25] [H]unt3r: has joined #RubyOnRails
[23:34:47] fgo: has joined #RubyOnRails
[23:36:15] bricker: has joined #RubyOnRails
[23:37:43] alexhartley: has joined #RubyOnRails
[23:38:51] moeabdol: has joined #RubyOnRails
[23:39:09] Maletor: Does that make sense? With DHH removing responders that would bring a lot of duplication code back to controllers.
[23:39:43] asheinfeld: has joined #RubyOnRails
[23:40:05] shyshy: has joined #RubyOnRails
[23:41:34] bradleyp_: has joined #RubyOnRails
[23:42:34] bawNg: has joined #RubyOnRails
[23:43:01] jfarmer: maletor Hadn't heard about that change, but there's a gem you can install to induce the "old" behavior.
[23:43:08] DoctorMonocular: has joined #RubyOnRails
[23:43:27] Maletor: jfarmer: I don't want a band aid for once. I'd rather fix this the right way.
[23:43:49] rickmasta: has joined #RubyOnRails
[23:43:49] Maletor: there's a reason we don't use error_messages_for
[23:43:58] Maletor: or any of the other numerous things that have been deprecated
[23:44:18] Maletor: and i agree that responders convolute the controller
[23:44:32] jfarmer: maletor What are you looking for, here?
[23:44:47] jfarmer: I mean, by asking about it on this channel?
[23:45:00] zendrix: has joined #RubyOnRails
[23:45:39] jfarmer: Discussion? An answer to a specific question? Commiseration? :D
[23:46:56] smathy: maletor, it's been gemified.
[23:47:18] smathy: maletor, https://github.com/plataformatec/responders
[23:47:40] jfarmer: (mentioned above FWIW)
[23:47:52] quazimodo: has joined #RubyOnRails
[23:48:08] smathy: Oh, sorry, I just read that you didn't want a gem. I'm not sure why.
[23:48:43] brain_shim: has joined #RubyOnRails
[23:49:05] charliesome: has joined #RubyOnRails
[23:49:08] m3_del: has joined #RubyOnRails
[23:50:05] l0oky: has joined #RubyOnRails
[23:50:30] l0oky: Is there a best practice on subscription management?
[23:50:38] smathy: maletor, all you should take from the code being moved out into a gem is that the Rails team view it as something which isn't used by enough people in enough situations for it to warrant staying as a core dependency.
[23:50:47] smathy: maletor, doesn't mean not to use it.
[23:51:00] smathy: l0oky, what is "subscription management"?
[23:51:26] Maletor: smathy: except that dhh explicitly lays out that he does not like it
[23:51:31] Maletor: so that assumption does not work
[23:51:47] l0oky: smathy: Well umm recurring bills..
[23:51:57] jfarmer: The Rails core team isn't a monolithic bloc
[23:52:35] jordanstorz: has joined #RubyOnRails
[23:52:38] smathy: maletor, you think that if DHH doesn't like something then you shouldn't use ut?
[23:52:47] Maletor: of course not
[23:52:48] ivanskie: so I think I'm doing something cool. but at the same time i think i'm doing it wrong.
[23:52:52] Maletor: i understand how to think
[23:53:29] smathy: maletor, so why did you mention that DHH doesn't like it? Why do you think that's relevant to the discussion?
[23:53:31] lethjakman: has joined #RubyOnRails
[23:53:38] Maletor: read what he said
[23:53:44] jfarmer: maletor I don't understand what conversation you're trying to have.
[23:53:50] Maletor: ya, nvm then
[23:54:10] jfarmer: Are you just looking for someone to go, "Yeah! It doesn't make sense to me, either!"?
[23:54:11] ivanskie: i have an admin style layout. using Foundation tabs.. im trying to do vertical tabs within vertical tabs. so once main menu clicked Products. it renders sub-vertical tabs with each product name. and within content, now i'm trying to render 'show'.. but i think i'm doing it wrong. how do you render show of product from under @products.each do |p| ?
[23:54:17] l0oky: smathy: I need to manage all my users subscriptions.. hence subscription management isn't really hard to figure our
[23:54:20] jfarmer: Alrighty then, never-minded.
[23:55:10] l0oky: I was kindly asking are there any best practices on user subscription ( recurring payments ) ?
[23:55:39] smathy: maletor, I don't have to. You began by asking: "Are we supposed to duplicate the logic ...?" and when I told you what moving something into a gem meant you countered by saying that DHH says he doesn't like the pattern. I'm not sure how that's anything other than you basing your "supposed to" on what DHH likes and doesn't like.
[23:55:51] ivanskie: https://gist.github.com/i5okie/573409c31bcad707d706
[23:56:06] Maletor: sorry for the confusion
[23:56:08] smathy: maletor, if you want to know what DHH thinks you should do in your controller, then you should ask him.
[23:56:23] smathy: maletor, I know that I'm still using the responders gem/pattern.
[23:57:07] smathy: l0oky, yeah, just that "subscription" could mean one of many different things.
[23:57:39] smathy: l0oky, so are you really asking about a user subscribing to something, or are you asking about recurring billing? And if the latter, what specifically because that's a big frog.
[23:58:00] Aswebb_: has joined #RubyOnRails
[23:59:01] l0oky: smathy: I make SubscriptionPlans and users pay for it. Easier said then done.