« Back to channel list

#RubyOnRails - 05 February 2016

« Back 1 day Forward 1 day »
[00:00:10] shnooti: Denarii: what makes my app "smaller"?
[00:00:34] mwlang: I am stumped. A pattern I???ve successfully implemented 5 or 6 time in this app suddenly is giving me grief. https://gist.github.com/mwlang/88efeefb688a43317300 The gist pares it down to one working example and the last one I just added (which is the broken one).
[00:01:26] mwlang: Anybody see anything obvious with why I can???t call the route in the spec? https://gist.github.com/mwlang/88efeefb688a43317300#file-sender_controller_spec-rb-L29 It works manually calling it and all the other routes very similarly defined in routes.rb work just fine.
[00:01:47] Deck`: has joined #RubyOnRails
[00:03:00] B1n4r10: has joined #RubyOnRails
[00:04:57] StaticVoid: has joined #RubyOnRails
[00:06:34] kies^: has joined #RubyOnRails
[00:06:57] visudo: has joined #RubyOnRails
[00:15:49] peterevjan: has joined #RubyOnRails
[00:17:20] pawnbox: has joined #RubyOnRails
[00:22:47] kirillzh: has joined #RubyOnRails
[00:23:55] celly: has joined #RubyOnRails
[00:25:38] lost_soul_: has joined #RubyOnRails
[00:25:54] ravster`: has joined #RubyOnRails
[00:26:38] peterevjan: has joined #RubyOnRails
[00:26:39] sbarg1: has joined #RubyOnRails
[00:26:45] guacamole: has joined #RubyOnRails
[00:26:55] lost_soul_: has joined #RubyOnRails
[00:30:23] lost_soul_: I'm trying to pass html from select_year to search params but I'm not having any luck. Can anyone point me in the right direction? http://pastie.org/10709348
[00:31:49] lost_soul_: I haven't been able to turn up a solid hint with google :\
[00:32:03] Rodya_: has joined #RubyOnRails
[00:32:28] fryguy: lost_soul_: the select tag needs to go inside of the form
[00:33:15] baweaver: has joined #RubyOnRails
[00:33:33] lost_soul_: Yeah, I know. It's not working when I include it in the form.
[00:33:50] lost_soul_: It returns a syntax error
[00:33:57] fryguy: so show the syntax error
[00:34:20] lost_soul_: http://pastie.org/10709350
[00:35:10] fryguy: what are :search and params[:search] for
[00:35:14] fryguy: they aren't part of anything
[00:35:25] harly_: has joined #RubyOnRails
[00:35:45] dexter-tzu: has joined #RubyOnRails
[00:35:57] hahuang65: has joined #RubyOnRails
[00:36:29] lost_soul_: Yes, you're right.
[00:36:47] arthurix_: has joined #RubyOnRails
[00:37:59] lilvim_: has joined #RubyOnRails
[00:38:03] peterevjan: has joined #RubyOnRails
[00:38:59] kiez0rd: has joined #RubyOnRails
[00:39:04] Kilobyte22: has joined #RubyOnRails
[00:39:21] SteenJobs: has joined #RubyOnRails
[00:39:33] colleenm_: has joined #RubyOnRails
[00:41:07] colleenm_: has joined #RubyOnRails
[00:41:07] gregf__: has joined #RubyOnRails
[00:42:49] Rodya_: has joined #RubyOnRails
[00:44:04] many: has joined #RubyOnRails
[00:44:54] Demerzel: mwlang: looks like your routes might not be referring to the right action in the spec: send_cases vs. probably vine_cases
[00:47:07] Demerzel: mwlang: or at the least you need to update the failing spec to refer to vine_cases instead of send_cases
[00:47:11] Demerzel: I left you a note on the gist
[00:47:28] pawnbox: has joined #RubyOnRails
[00:47:54] mwlang: Demerzel: you nailed it!
[00:48:25] Demerzel: mwlang: sweet!
[00:48:32] mwlang: talk about 2 hours down the drain and it was just a momentarily lapse in naming the sucker.
[00:48:51] Demerzel: second set of eyes comes in handy at times like these :-)
[00:49:08] mwlang: indeed they do.
[00:49:10] Demerzel: usually best when still attached to a brain though :-/
[00:49:41] mwlang: well, I can finally put this thing to bed and 11 minutes before happy hour, too.
[00:51:02] rhizome: sites that just republish SO bug me
[00:52:23] DLSteve: has joined #RubyOnRails
[00:55:12] johnflux: has joined #RubyOnRails
[00:55:12] johnflux: has joined #RubyOnRails
[00:57:23] rhizome: yeah, people take their data dumps and wrap it with another design
[01:00:09] xardion: has joined #RubyOnRails
[01:02:34] Deck`: has joined #RubyOnRails
[01:06:58] Coldblackice: has joined #RubyOnRails
[01:08:01] Demerzel: yeah that always sucks
[01:08:16] Demerzel: if they're providing a service the original app isn't that's a different story
[01:08:20] moeabdol2: has joined #RubyOnRails
[01:08:46] Demerzel: but reskinning the original app is just annoying
[01:09:20] whelinto: has joined #RubyOnRails
[01:09:57] ur5us: has joined #RubyOnRails
[01:10:04] ur5us: has joined #RubyOnRails
[01:11:51] hardtail: has joined #RubyOnRails
[01:12:07] whelinto: When should one run something in a background worker? Is making a few external API write calls a good candidate?
[01:13:10] rrawlins: has joined #RubyOnRails
[01:15:20] paradisaeidae: has joined #RubyOnRails
[01:15:23] Demerzel: whelinto: any time you're doing something that you don't want the user to wait for is a good time to stick it in a background worker
[01:15:43] Demerzel: those api calls should be good candidates unless you expect to return the result of those calls to the user immediately
[01:16:05] moeabdol3: has joined #RubyOnRails
[01:17:10] pawnbox: has joined #RubyOnRails
[01:18:13] whelinto: ok thanks for the help
[01:18:36] whelinto: it's not super important they know the call failed as long as it happens eventually
[01:18:59] Demerzel: to the background with it then!
[01:20:41] sevenseacat: has joined #RubyOnRails
[01:21:17] croberts: has joined #RubyOnRails
[01:21:28] baak: has joined #RubyOnRails
[01:22:20] blackmesa: has joined #RubyOnRails
[01:26:07] sleungcy: has joined #RubyOnRails
[01:30:02] tego101: has joined #RubyOnRails
[01:33:59] macsteps: has joined #RubyOnRails
[01:35:48] jottr: has joined #RubyOnRails
[01:39:12] Pazician: has joined #RubyOnRails
[01:42:49] K_r3aPeR: has joined #RubyOnRails
[01:44:16] Sawbones: has joined #RubyOnRails
[01:44:59] Sadin: has joined #RubyOnRails
[01:51:16] superlou: has joined #RubyOnRails
[01:51:31] peterevjan: has joined #RubyOnRails
[01:53:37] moeabdol4: has joined #RubyOnRails
[01:53:53] Synthead: in github_webhook (https://github.com/ssaunier/github_webhook#configuration), it wants me to use "resource :github_webhooks ...". I am writing a dynamic app that will eventually be able to take a variety of URLs that I always want to run using GithubWebhooksController. How can I do this?
[01:54:08] safety_cut: has joined #RubyOnRails
[01:54:43] Synthead: As an example, by following the documentation, the webhooks are available at http://localhost:3000/github_webhooks. I want to be able to do /a, /b, /c, etc. and have them still use the GithubWebhooksController
[01:58:28] peterevjan: has joined #RubyOnRails
[01:58:59] SteenJobs: has joined #RubyOnRails
[01:59:55] duderonomy: has joined #RubyOnRails
[02:01:27] lexiMon: has joined #RubyOnRails
[02:02:05] corioliss: has joined #RubyOnRails
[02:03:16] Graphettion: has joined #RubyOnRails
[02:03:20] Deck`: has joined #RubyOnRails
[02:05:29] lessless: has joined #RubyOnRails
[02:14:07] daivyk: has joined #RubyOnRails
[02:14:58] dcunit3d: has joined #RubyOnRails
[02:16:49] Eswar: has joined #RubyOnRails
[02:17:07] jtong: has joined #RubyOnRails
[02:21:55] rhizome: Synthead: ok, and?
[02:22:10] Synthead: rhizome: I got it figured out
[02:22:22] Synthead: I added path: ":some_var" to the resource
[02:22:28] Felix444: has joined #RubyOnRails
[02:23:39] Thib: has joined #RubyOnRails
[02:24:45] Thib: has joined #RubyOnRails
[02:25:58] lexileo: has joined #RubyOnRails
[02:26:09] tego101: has joined #RubyOnRails
[02:26:11] Thib: has joined #RubyOnRails
[02:26:50] ravster`: has joined #RubyOnRails
[02:27:37] RegulationD: has joined #RubyOnRails
[02:28:03] underplank: has joined #RubyOnRails
[02:30:53] lexiMon: has joined #RubyOnRails
[02:33:15] underplank: Hi all im using guard to run rspec tests, and database_cleaner to remove test data. I???ve registered a config.before(:each) on rspec to run DatabaseCleaner.clean. But if I put a breakpoint there, after the first run through the clean command doesnt get run.
[02:35:06] neshmi: has joined #RubyOnRails
[02:35:10] sevenseacat: sounds right - it runs before each spec, not after run throughs
[02:35:47] underplank: nvm??? I think I need to include the spec_helper.rb in every test file.
[02:36:22] sevenseacat: you should be including rails_helper, not spec_helper
[02:36:30] sevenseacat: rails_helper loads spec_helper
[02:37:17] pawnbox: has joined #RubyOnRails
[02:38:48] creature: has joined #RubyOnRails
[02:38:48] creature: has joined #RubyOnRails
[02:42:36] wethu: has joined #RubyOnRails
[02:44:25] jottr: has joined #RubyOnRails
[02:45:16] Rodya_: has joined #RubyOnRails
[02:54:42] lilvim_: has left #RubyOnRails: ()
[02:56:50] Cervajz: has joined #RubyOnRails
[02:56:53] lilvim: has joined #RubyOnRails
[03:02:05] Cervajz: has joined #RubyOnRails
[03:02:21] markelite: has joined #RubyOnRails
[03:02:37] Cervajz_: has joined #RubyOnRails
[03:03:23] Cervajz__: has joined #RubyOnRails
[03:04:25] Deck`: has joined #RubyOnRails
[03:09:36] Felix444: has joined #RubyOnRails
[03:14:02] rrawlins: has joined #RubyOnRails
[03:14:30] northfurr: has joined #RubyOnRails
[03:15:11] ftj: has joined #RubyOnRails
[03:16:44] n00bDev: has joined #RubyOnRails
[03:16:57] hnanon: has joined #RubyOnRails
[03:17:28] n00bDev: anyone getting a ssl certificate error when trying to do a bundle install?
[03:17:40] n00bDev: its complaining about https://rails-assets.org
[03:18:27] sevenseacat: was never a fan of rails-assets
[03:18:49] gavinhughes: has joined #RubyOnRails
[03:23:05] Sadin: has joined #RubyOnRails
[03:23:33] pwnd_nsfw: n00bdev, what os?
[03:23:59] pwnd_nsfw: Can't help ya there
[03:24:07] n00bDev: its never happend before..
[03:24:24] TravisTheNavi: has joined #RubyOnRails
[03:26:47] one_zero: has joined #RubyOnRails
[03:26:55] Cervajz: has joined #RubyOnRails
[03:26:57] pawnbox: has joined #RubyOnRails
[03:27:54] hnanon: Why is the subscription being saved when a Stripe error occurs: https://gist.github.com/anonymous/5d36727eff7bef0df945
[03:28:25] hnanon: And how can I capture any errors and display them in the view?
[03:28:39] B1n4r10: has joined #RubyOnRails
[03:28:47] sevenseacat: because you;re saving it before you contact stripe
[03:29:22] hnanon: Can you show me where?
[03:29:32] sevenseacat: thats a lot of convoluted code
[03:30:06] hnanon: I know...it works fine, though, when there are no Stripe errors.
[03:30:13] sevenseacat: https://gist.github.com/anonymous/5d36727eff7bef0df945#file-sub_controller-rb-L13
[03:30:22] sevenseacat: save will clear all existing errors and re-run validations
[03:30:38] sevenseacat: so https://gist.github.com/anonymous/5d36727eff7bef0df945#file-sub-rb-L52 is removed
[03:30:44] hnanon: Ah, I didn't know that.
[03:30:53] hnanon: So I shouldn't call save in the controller?
[03:31:02] hnanon: (In that instance).
[03:31:26] sevenseacat: no, you should put validations on your stripe-returned data
[03:32:46] hnanon: I don't understand. Stripe isn't returning any data except for the error (when there's an error).
[03:33:49] sevenseacat: right, but when it works, you're saving a lot of stripe's data to your model
[03:34:15] sevenseacat: so if that data isnt present, then your have problem and shouldn't save, no?
[03:34:16] Cervajz: has joined #RubyOnRails
[03:34:20] sevenseacat: *you have a problem
[03:34:33] hnanon: That's right.
[03:35:02] seaworthy: has joined #RubyOnRails
[03:35:45] hnanon: So, for example, if a validate the presence of card_name, and it's not there, it will fail validations and not save.
[03:35:53] hnanon: *if I validate...
[03:36:03] seaworthy: has left #RubyOnRails: ()
[03:36:19] hnanon: Ok, let me try that. Thank you.
[03:37:27] TravisTheNavi: Do you think it is important for a beginner to learn Ruby before diving into Rails? My goal is to gain enough skill to be hireable as a junior developer.
[03:37:42] sevenseacat: if you're a junior developer, then yes.
[03:37:49] pwnd_nsfw: It's beneficial to know ruby, absolutely
[03:38:43] n00bDev: when im i do bundle install, its complaining about the rake gem having URI:InvalidURIError
[03:38:47] n00bDev: any ideas..??
[03:39:02] Cervajz_: has joined #RubyOnRails
[03:39:15] visudo: has joined #RubyOnRails
[03:40:04] Pazician: has joined #RubyOnRails
[03:40:26] pwnd_nsfw: n00bdev, when you enable/disable a gem, that shows up?
[03:40:29] pwnd_nsfw: or is that always now?
[03:40:58] Cervajz__: has joined #RubyOnRails
[03:40:59] n00bDev: no i just did bundle install
[03:41:08] n00bDev: and its railing to install the rake gem
[03:41:11] pwnd_nsfw: You do bundle install for the lulz?
[03:41:41] pwnd_nsfw: care to share the output?
[03:41:43] Rodya_: has joined #RubyOnRails
[03:41:50] sevenseacat: yeah I've heard of that happening just now on Slack
[03:41:56] sevenseacat: seems Rubygems is having a bad day
[03:42:15] n00bDev: arent you supposed to bundle install after pulling a repo?
[03:42:24] pawnbox: has joined #RubyOnRails
[03:42:58] pwnd_nsfw: n00bdev, certainly
[03:42:59] sevenseacat: n00bdev: we've told the rubygems maintainers, so hopefully a fix will come around soon :) looks like a problem with fastly, the rubygems cdn
[03:43:06] pwnd_nsfw: but pulling a repo isn't for the lulz either
[03:43:38] pwnd_nsfw: They have a pug on their home screen
[03:43:44] konsolebox: has joined #RubyOnRails
[03:43:48] n00bDev: ok so its nothing on my end then
[03:44:34] n00bDev: pwnd_nsfw here you go https://gist.github.com/gwong89/4320ae5418eded447f50
[03:45:57] Eswar: has joined #RubyOnRails
[03:47:42] sankaber: has joined #RubyOnRails
[03:48:47] ss_much: has joined #RubyOnRails
[03:55:10] emachnic: has joined #RubyOnRails
[03:56:02] User458764: has joined #RubyOnRails
[03:57:27] hfp_work: has joined #RubyOnRails
[03:58:43] johnflux: has joined #RubyOnRails
[03:58:59] RegulationD: has joined #RubyOnRails
[03:59:32] c0defeed_away: has joined #RubyOnRails
[04:00:01] ellisTAA: has joined #RubyOnRails
[04:00:38] ellisTAA: i???m trying to use the paperclip gem and on my form i???m getting an error ???input undefined method??? https://gist.github.com/ellismarte/73aa97c0caa682fa037a#file-form-rb-L11
[04:00:52] bronson: has joined #RubyOnRails
[04:00:59] FCser: has joined #RubyOnRails
[04:04:00] seaworthy: has joined #RubyOnRails
[04:04:30] seaworthy: hey, guys, i need help with writting an algorithm i am not sure if ror can already do what i need to do
[04:04:32] seaworthy: https://bpaste.net/show/f95ab71223fa
[04:05:23] Deck`: has joined #RubyOnRails
[04:06:18] seaworthy: i have a random amount, and the database has n credit records, i need to close them until there is no more balance and create credit for the remainder if i have to. anyone done that before?
[04:06:41] chouhoulis: has joined #RubyOnRails
[04:09:13] tomoyuki28jp: has joined #RubyOnRails
[04:10:38] tomoyuki28jp: How do you guys monitor rails error except 404 not found? I use newrelic, but it does not detect errors occur inside rake task run by cron.
[04:11:07] Rodya_: has joined #RubyOnRails
[04:14:46] treaki_: has joined #RubyOnRails
[04:15:13] tomoyuki28jp: Ah, it seems NR can monitor rake task too. https://blog.newrelic.com/2012/05/30/using-new-relic-to-monitor-ruby-background-tasks/
[04:16:27] northfurr: has joined #RubyOnRails
[04:17:17] safety_cut: has joined #RubyOnRails
[04:18:44] safety_c_: has joined #RubyOnRails
[04:19:43] braincrash: has joined #RubyOnRails
[04:20:07] ellisTAA: has joined #RubyOnRails
[04:22:37] pawnbox: has joined #RubyOnRails
[04:22:43] DmitryBochkarev: has joined #RubyOnRails
[04:27:48] ravster`: has joined #RubyOnRails
[04:28:15] vedu: Hello everyone. I am having a tough time deciding between Amazon's Elastic Beanstalk and Capistrano for deployment
[04:28:28] vedu: Any thoughts on this?
[04:29:37] sevenseacat: i didnt think it was an either/or thing
[04:31:34] kp666: has joined #RubyOnRails
[04:34:47] NBarnes: has joined #RubyOnRails
[04:35:18] hnanon: sevenseacat: Ok, it's performing as you explained it would. However, when there is a Stripe error and the card_name (for example) validation fails, the error returned is "Card name can't be blank." The user has not idea what this means. Is there a way to group a set of validations to output a single error message like "Your card details are not valid."?
[04:36:25] sevenseacat: no. you might need to restructure your code to not try and save if the stripe call failed
[04:36:25] codezomb: has joined #RubyOnRails
[04:38:45] hnanon: Maybe look for something in their response and if it's not there, don't save, otherwise save?
[04:39:26] rakm: has joined #RubyOnRails
[04:39:44] seaworthy: has left #RubyOnRails: ()
[04:39:53] arup_r: has joined #RubyOnRails
[04:40:51] kirillzh: has joined #RubyOnRails
[04:42:17] Rodya_: has joined #RubyOnRails
[04:44:33] arup_r: I have a DB column season which has "strings", now I want to change type to integer using migration like change_column :garments, :season, 'integer USING CAST(season AS integer)', null: false . This throws error like https://gist.github.com/aruprakshit/1d6173883d49a9d81cbc
[04:44:45] arup_r: any idea how can I get rid of this ?
[04:45:07] fryguy: well, you can't store the string "Summer" as an integer
[04:45:19] jottr: has joined #RubyOnRails
[04:45:22] arup_r: reason of chaging the string to integer is I will add Enum feature..
[04:45:38] arup_r: I don't need to store, I am trying to cast it.
[04:46:10] arup_r: Casting is possible. but for me it is throwing error. http://stackoverflow.com/a/22394425/2767755
[04:46:35] fryguy: casting doesn't do what you think it does
[04:46:55] fryguy: something needs to be in that row for that column once the migration is complete, what value do you want to be there
[04:47:10] pawnbox: has joined #RubyOnRails
[04:47:53] arup_r: intergers between 0
[04:47:58] arup_r: s/between/""
[04:48:13] arup_r: it has now all seasons as strings.
[04:48:22] fryguy: ok, so write a function that does that
[04:48:30] DmitryBochkarev: has joined #RubyOnRails
[04:49:19] fryguy: or capture the exception and change the behavior
[04:49:23] fryguy: in postgres
[04:49:41] duncannz: has joined #RubyOnRails
[04:49:49] emachnic: has joined #RubyOnRails
[04:50:04] hnanon: If I call .present? will it still be present if the value has not yet been persisted to the db?
[04:50:36] baweaver: has joined #RubyOnRails
[04:51:01] sevenseacat: easy to test and find out, given we have no idea what you want to call .present? on
[04:51:51] mdel: has joined #RubyOnRails
[04:51:54] hnanon: Just saw this: http://api.rubyonrails.org/classes/ActiveRecord/Persistence.html#method-i-persisted-3F
[04:52:12] hnanon: Looks like values must be persisted to be considered present.
[04:52:40] hnanon: I want to see, for example if the @subscription.stripe_customer_id.present? before calling save.
[04:53:11] hnanon: But since it's not saved, it will always return false.
[04:53:18] ellisTAA: has joined #RubyOnRails
[04:53:32] hnanon: present? will always return false, I should say.
[04:56:46] Eswar: has joined #RubyOnRails
[05:02:57] northfurr: mother of god
[05:05:33] Nuck: Is there a best place to cram application metadata? I'm just thinking I'd like to share some things used across this entire app, like the company address and copyright string
[05:08:02] bob14: has joined #RubyOnRails
[05:08:38] bob14: has joined #RubyOnRails
[05:15:00] rrawlins: has joined #RubyOnRails
[05:17:56] Oog: has joined #RubyOnRails
[05:19:45] visudo: has joined #RubyOnRails
[05:20:37] 7JTAAE5CB: has joined #RubyOnRails
[05:20:37] 18VAAA8VJ: has joined #RubyOnRails
[05:21:23] kiez0rd: has joined #RubyOnRails
[05:28:55] smathy: has joined #RubyOnRails
[05:30:49] ur5us: has joined #RubyOnRails
[05:31:38] nodejunkie: has joined #RubyOnRails
[05:31:40] Oog: i have a v3.js manifest that requires blah.js. application.js manifest does stub v3.js. i want application.js to also require blah.js - is this possible?
[05:33:31] safety_cut: has joined #RubyOnRails
[05:37:13] fedexo: has joined #RubyOnRails
[05:37:48] seaworthy: has joined #RubyOnRails
[05:38:32] seaworthy: hello i have this array https://bpaste.net/show/cb59ef67f3f2 how do i select the animal by a number
[05:38:46] smathy: Oog, yes, perfectly possible.
[05:39:01] Oog: how? i read stub cant be overridde
[05:39:09] bronson: has joined #RubyOnRails
[05:39:17] arup_r: seaworthy: ANIMAL.select { |a| a.last == 2 }
[05:39:22] smathy: Oog, oh wait, what? What do you mean by stub?
[05:39:25] Oog: in application.js i tried require blah after stub v3.js but it wouldnt includ eit
[05:39:37] yfeldblum: has joined #RubyOnRails
[05:39:50] Oog: https://github.com/rails/sprockets#sprockets-directives the stub directive
[05:40:00] rvanlieshout: has joined #RubyOnRails
[05:40:35] smathy: seaworthy, in that structure: ANIMAL[number-1].first
[05:41:05] seaworthy: arup_r: didnt work
[05:41:06] Pazician: has joined #RubyOnRails
[05:41:09] seaworthy: smathy: trying now
[05:41:18] tego101: has joined #RubyOnRails
[05:41:36] arup_r: seaworthy: whhy didn't work..? dunno
[05:41:49] SteenJobs: has joined #RubyOnRails
[05:42:01] rvanlieshout: hi folks. sup?
[05:42:04] arup_r: ok, I thought you want to match with the inner array number, not the array index
[05:42:05] smathy: Oog, oh sorry, I didn't know what you meant. Not sure.
[05:42:50] seaworthy: inner array number
[05:42:54] seaworthy: not the index
[05:43:19] seaworthy: your line gives me an empty array back
[05:43:57] rvanlieshout: what do you want, seaworthy?
[05:43:59] rvanlieshout: and what do you have
[05:44:02] rvanlieshout: i've just joined
[05:44:13] smathy: seaworthy, then you did something wrong because it returns: [["Cat", 2]] for me.
[05:45:42] seaworthy: rvanlieshout: i have this array https://bpaste.net/show/cb59ef67f3f2 how do i select the animal by a number from the inside array
[05:45:50] arup_r: seaworthy: I can't believe you,, https://gist.github.com/aruprakshit/16822a158c3af73a2ffe :D
[05:46:18] seaworthy: i know whats wrong
[05:46:23] rvanlieshout: Hash[ANIMAL.map(&:reverse)]
[05:46:24] arup_r: cool, then
[05:46:30] seaworthy: the number is comming from the database
[05:46:34] seaworthy: and it was blank
[05:46:38] rvanlieshout: seaworthy: how did you create that array?
[05:46:50] rvanlieshout: that Hash[ANIMAL.map(&:reverse)] will convert it to {1=>"Dog", 2=>"Cat", 3=>"Horse"}
[05:46:52] seaworthy: just a contant variable
[05:47:04] Deck`: has joined #RubyOnRails
[05:47:14] krzkrz: has joined #RubyOnRails
[05:47:14] arup_r: rvanlieshout: you can do this filter in the DB only i think instead of loading it Ruby array and then filering.
[05:47:41] arup_r: it is to seaworthy :)
[05:47:42] rvanlieshout: arup_r: i agree on that. one should filter in the db
[05:47:54] arup_r: but that comment was to OP, not you..
[05:48:18] arup_r: I typed your name wrongly. sorry
[05:48:19] djbkd: has joined #RubyOnRails
[05:48:22] baweaver: If it was DB based, just Model.select(:number, :name).to_h or Model.where(...).index_by(&:number)
[05:48:48] arup_r: seaworthy: look at baweaver's suggestion
[05:49:06] arup_r: what is `index_by` ?
[05:49:07] seaworthy: its not db based
[05:49:10] baweaver: index_by is a Rails method, but it works on Enumerables instead of DB
[05:49:10] seaworthy: its a constant
[05:49:17] rvanlieshout: did you try that Hash-thing, seaworthy?
[05:49:38] sevenseacat: so much confusion
[05:49:39] arup_r: beingjohnm: TIL `index_by`.
[05:50:31] baweaver: index_by: collection.uniq(&:field).map { |c| [c.field, c] }.to_h
[05:50:34] arup_r: baweaver: how it differs from Ruby group_by ?
[05:50:46] mices: i need to respond_to in my controller with a modification of the dom instead of a redirect, how do i do that
[05:50:56] baweaver: they're similar, but index_by only returns the first unique one
[05:51:06] rvanlieshout: mices: you can't
[05:51:12] rvanlieshout: mices: there is a gap between client and server
[05:51:25] rvanlieshout: you could respond with something that you parse at the client side though
[05:51:26] helpa: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[05:51:31] arup_r: ok. I will try it in console
[05:51:44] mices: rvanlieshout: ajax?
[05:52:20] baweaver: AJAX is used to fetch data
[05:52:23] mices: that's what i wanna do
[05:52:30] rvanlieshout: ajax is used to fetch anything async
[05:52:36] baweaver: transforming the DOM is a frontend concern
[05:53:08] mices: the controller can render to any <div> using ajax
[05:53:10] arup_r: seaworthy: welcome.
[05:53:14] baweaver: normally via jQuery or vanilla JS dom handlers
[05:53:28] baweaver: mices: no, you're conflating things
[05:53:55] baweaver: AJAX asks server for data. AJAX has new data now. Javascript decides what to do with it
[05:54:22] baweaver: saying the controller renders to it is confusing things
[05:54:30] baweaver: AJAX renders to it
[05:54:57] mices: here's what i'm trying to do, someone clicks like, then like turns to unlike without the whole page being rendered again
[05:55:16] rvanlieshout: thats a js thing
[05:55:22] Devalo: has joined #RubyOnRails
[05:55:32] ur5us: has joined #RubyOnRails
[05:55:32] baweaver: mices: you got the answer already.
[05:55:35] arup_r: has left #RubyOnRails: ()
[05:55:49] mices: i'm looking at the socify app
[05:56:33] mices: here's his controller https://github.com/sudharti/socify/blob/master/app/controllers/likes_controller.rb
[05:56:39] dionysus69: has joined #RubyOnRails
[05:57:02] mices: nothing but respond_to js at the top
[05:57:10] mices: so how's that supposed to work?
[05:58:31] rvanlieshout: i think you need to read about the whole concept of having an action performd async when pressing a button
[05:58:39] rvanlieshout: and doing something with the response
[05:58:54] lemur: has joined #RubyOnRails
[05:59:14] mices: seemingly i would just need a respond_to statement in the controller action
[05:59:20] kinduff: has joined #RubyOnRails
[05:59:31] rvanlieshout: how the controller should respond is one of your last steps
[05:59:36] mices: what's the link to that?
[05:59:38] rvanlieshout: not really relevant atm
[06:00:08] Thouren: has joined #RubyOnRails
[06:00:24] baweaver: mices: what have you looked at to find out?
[06:00:53] baweaver: people aren't always going to give links to tutorials or otherwise, you're going to have to be self-sufficient on some of that.
[06:00:57] mices: i'm looking at my book where they render a users cart in the sidebar instead of a new page
[06:01:46] mices: under the heading adding a dash of ajax
[06:01:48] rvanlieshout: get to a state where you have that buttion trigger an ajax request and handling the response
[06:02:28] tjbiddle: has joined #RubyOnRails
[06:03:14] mices: lmg the rest for myself
[06:04:53] arup_r: has joined #RubyOnRails
[06:04:57] rafaelfranca: has joined #RubyOnRails
[06:05:20] atmosx: has joined #RubyOnRails
[06:05:40] dev-MR: has joined #RubyOnRails
[06:06:18] baweaver: dev-MR: use gist to post the full stack trace
[06:06:19] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[06:06:47] ellisTAA: has joined #RubyOnRails
[06:10:47] Pulp: has joined #RubyOnRails
[06:11:46] ensyde: has joined #RubyOnRails
[06:11:53] safety_cut: has joined #RubyOnRails
[06:13:19] arup_r: seems gist.github.com is down :P otherwise why so late..hmmm
[06:15:30] rvanlieshout: http://www.downforeveryoneorjustme.com/gist.github.com
[06:15:51] smathy: ACTION too
[06:19:01] stardiviner: has joined #RubyOnRails
[06:19:26] jtong: has joined #RubyOnRails
[06:23:11] Jasaka: has joined #RubyOnRails
[06:23:40] rhizome: gah, i hate being stupid
[06:24:10] rvanlieshout: that happens often?
[06:25:30] tvw: has joined #RubyOnRails
[06:27:55] Rodya_: has joined #RubyOnRails
[06:28:47] ravster`: has joined #RubyOnRails
[06:29:33] ensyde: has joined #RubyOnRails
[06:31:42] Nuck: GitHub ops are getting put through their paces I guess
[06:31:45] rhizome: constantly!
[06:32:53] RTG`: has joined #RubyOnRails
[06:33:46] neshmi: has joined #RubyOnRails
[06:35:06] workmad3: has joined #RubyOnRails
[06:35:14] sevenseacat: davidcelis: stop breaking things
[06:35:33] arup_r: is he a GitHub dev ?
[06:36:21] rhizome: gonna make a gem to make single-letter url segments easier
[06:36:37] sandstrom: has joined #RubyOnRails
[06:37:07] SteenJobs: has joined #RubyOnRails
[06:37:20] arup_r: has left #RubyOnRails: ()
[06:38:00] Nuck: I see lotsa smart faces around here, so maybe one of you can advise me on where to put metadata about the Rails app: company address, copyright, git commit shortcode, etc.?
[06:38:05] emachnic: has joined #RubyOnRails
[06:38:26] rvanlieshout: nuck: for what purpose?
[06:38:37] stardiviner: has joined #RubyOnRails
[06:39:32] Nuck: rvanlieshout: All the various places you'd display company address and copyright (Terms of Service, emails, footer, etc.) and git commit shortcode because I want to make sure it's the commit from boot time
[06:39:45] sevenseacat: nuck: in the application layout?
[06:40:02] Nuck: sevenseacat: But it's not specific to a single layout
[06:40:07] workmad3: has joined #RubyOnRails
[06:40:16] sevenseacat: fine, in a partial that you include all layouts?
[06:40:20] sevenseacat: *in all layouts
[06:40:46] aganov: has joined #RubyOnRails
[06:41:07] Nuck: Hmm. That seems like overkill, but I guess it would solve my problem
[06:41:20] rvanlieshout: overkill to share a partial?
[06:41:25] sevenseacat: I don't really know what your problem is tbh
[06:41:31] rvanlieshout: to use partials in the exact whay they are designed to be used?
[06:42:18] Rodya_: has joined #RubyOnRails
[06:42:22] Nuck: Well I was hoping it would be something less coupled to the HTML, since it needs to also be rendered into plaintext emails
[06:42:33] rvanlieshout: you didn't tell that
[06:42:38] adac: has joined #RubyOnRails
[06:42:41] rvanlieshout: should we have guessed that?
[06:42:50] sevenseacat: apparently so
[06:42:56] Nuck: mmm sorry I'm a bit distracted
[06:43:10] sevenseacat: I also don't know why you would want to put a git commit shortcode in a plaintext email
[06:43:16] Nuck: Well that would be
[06:43:18] sevenseacat: in the footer of an app, maybe
[06:43:24] Nuck: *wouldn't
[06:43:30] Nuck: That would be absurd, that goes in the footer
[06:43:35] baweaver: Then just put it in a YML file or a constant and render it later
[06:43:37] Nuck: But I don't want to shell out to git at runtime
[06:43:45] sevenseacat: nuck: sounds like you need to clarify your requirements before you ask for advice on how to do it
[06:44:24] rvanlieshout: what's wrong with shelling git runtime? file operations don't really take long
[06:44:35] rvanlieshout: unless you host them at some provider with crappy io performance
[06:44:35] sevenseacat: at the moment it sounds like 'i want to put content in my app'
[06:44:43] jahbrewski: has joined #RubyOnRails
[06:44:47] KazW: has joined #RubyOnRails
[06:45:00] baweaver: YAML file, every upload changes the git version, done.
[06:45:03] Nuck: rvanlieshout: It's possible mid-deploy for the version on disk and in RAM to be different
[06:45:09] KazW: has joined #RubyOnRails
[06:45:26] sevenseacat: now we're splitting hairs
[06:45:30] Nuck: While the web servers are performing a rolling restart
[06:45:31] baweaver: nuck: and you think that'll have any real effect?
[06:45:38] workmad3_: has joined #RubyOnRails
[06:45:46] rvanlieshout: and could be indeed. but i don't think anybody cares
[06:45:54] Nuck: baweaver: It has for me, actually, since our deploys fail every so often
[06:46:07] sevenseacat: you should probably fix that first.
[06:46:09] Nuck: It's nice to know what commit the server booted up with
[06:46:13] Nuck: Yeah, probably wise
[06:46:18] baweaver: now we've gone from info to deploy concerns
[06:46:34] baweaver: are you aware of load balancing and proxying?
[06:46:58] Nuck: I actually inherited the ops nightmare where it doesn't deploy consistently
[06:47:04] Cervajz: has joined #RubyOnRails
[06:47:16] Yeomra: has joined #RubyOnRails
[06:47:16] baweaver: first goal should be fixing that if at all possible
[06:47:17] Nuck: Fixing it is in progress :P
[06:47:23] jottr: has joined #RubyOnRails
[06:47:32] baweaver: failing that, put a proxy server in front of it which distributes load
[06:47:35] Nuck: And by fixing it, I mean replacing the buggy shell script with a buggy docker script
[06:47:41] baweaver: in AWS that'd be an ELB
[06:47:55] Nuck: Switching to an ELB+ECS setup
[06:48:02] rvanlieshout: if it's on aws you surely have a poorly io performance
[06:48:12] baweaver: run tests on that to see if the build succeeded
[06:48:34] baweaver: a sanity check that runs on boot, reports back, and if it passed you can put it behind an ELB with no issues
[06:49:05] gavinhughes: has joined #RubyOnRails
[06:49:10] Deck`: has joined #RubyOnRails
[06:49:11] Nuck: I'm aware of how to deploy, thanks. I've taken all the sysadmin courses my school has to offer and currently run enough servers to kill a horse
[06:49:17] baweaver: there are health checks which can be leveraged
[06:49:28] arup_r: has joined #RubyOnRails
[06:49:28] Nuck: Don't ask how servers kill horses, it's a long story
[06:49:31] baweaver: my stick is bigger
[06:50:09] Cervajz_: has joined #RubyOnRails
[06:50:12] baweaver: please don't ask for help and then start posturing about not needing it...
[06:50:21] morfin: has joined #RubyOnRails
[06:50:23] sevenseacat: well it seems like we've covered the original question, so
[06:50:30] helpa: http://youtu.be/kfVsfOSbJY0
[06:50:37] workmad3: has joined #RubyOnRails
[06:50:41] sevenseacat: morfin: afternoon
[06:50:47] morfin: how can i partially validate model?
[06:50:48] Nuck: I don't need help with deployment, I needed help with figuring out how to best structure my app and got a lot of salty responses to that
[06:50:54] rvanlieshout: morfin: based on what?
[06:50:59] sevenseacat: nuck: thats not what you asked at all...
[06:51:40] Nuck: sevenseacat: I'll admit I had some terrible phrasing and was generalizing over like 3 separate problems
[06:51:54] karim: has joined #RubyOnRails
[06:52:15] karim: has left #RubyOnRails: ()
[06:52:16] Nuck: Now I realize a partial is probably the easiest answer to my question
[06:52:32] Nuck: I hadn't thought about it because honestly I hadn't thought much of tiny static partials until now
[06:52:45] mickey_mouse: has joined #RubyOnRails
[06:52:51] morfin: basically i have form with step1, step2 and step3, i have model for Order and i want validate step1 fields, step2 fields and step3 fields separately(but step3 if i choose field citizenship value "No" does not exist)
[06:53:16] Nuck: Since we got deployment advice, how about legal advice: can I just render the current year into the copyright field? :D
[06:53:56] baweaver: 8ball has spoken
[06:54:03] sevenseacat: you can. whether thats legal or not is a completely different question.
[06:54:15] baweaver: that'd be better for lawyer folk
[06:54:23] Nuck: Honestly, 8ball still makes more sense than most lawyers
[06:54:38] tego101: has joined #RubyOnRails
[06:54:38] baweaver: we provide pretty bad legal advice with no disclaimers, so...
[06:55:06] baweaver: morfin: sounds like you want to validate things on the frontend as they're doing it
[06:55:09] Nuck: "Wow look at how my toes look through this gun's scope..."
[06:55:13] baweaver: then validate one on the back end
[06:55:28] morfin: validating only on frontend side sounds bad hmm
[06:55:39] sevenseacat: you can look into conditional validations
[06:55:53] sevenseacat: with an extra field storing what step of the process they're on
[06:56:00] sevenseacat: thats typically how I've done it in the past
[06:56:08] baweaver: validations are more powerful than the callbacks
[06:56:35] baweaver: !validations
[06:56:35] helpa: The Active Record Validations Guide - http://guides.rubyonrails.org/active_record_validations.html - Written by Jaime Iniesta
[06:56:58] baweaver: See 5 and 6
[06:57:27] baweaver: as per the gun bit, you're perfectly safe. If you can see your foot it has no bullet lined up.
[06:57:42] SteenJobs: has joined #RubyOnRails
[06:57:53] baweaver: but now I'm being pedantic
[06:57:58] roshanavand: has joined #RubyOnRails
[06:58:45] morfin: frontend validation used only for fancy messages etc
[06:59:25] Deck`: has joined #RubyOnRails
[06:59:26] baweaver: you're a bit behind on the messages
[06:59:39] jahbrewski: has joined #RubyOnRails
[07:00:01] morfin: i checked out your link
[07:00:05] baweaver: If you reread you'll see I said frontend for validating or rather making sure data is in one format for steps, and then validating on the backend
[07:00:24] rvanlieshout: i would go with sevenseacat's suggestion
[07:02:08] rvanlieshout: with_options would be usefull for it
[07:04:22] kirillzh: has joined #RubyOnRails
[07:05:28] solars: has joined #RubyOnRails
[07:06:18] rubyonrails966: has joined #RubyOnRails
[07:07:42] arup_r: some people I saw, use cloud9 for development in Rails instead of using local dev machine. What benefits are buying with this approach ?
[07:07:57] arup_r: are they*
[07:08:20] sevenseacat: ease of setup
[07:09:02] sevenseacat: I have to learn about cloud9 before rubyconf au next week, we're using it for railsgirls :/
[07:10:38] baweaver: you kids and your fancy web editors. In my day we used Vim and KSH and by god we liked it
[07:11:12] arup_r: someone asked me did you use cloud9? I answered I used AWS and linode to deploy app. Then the way he smiled at me, I felt like "I answered something stupid"
[07:11:31] JohnBat26: has joined #RubyOnRails
[07:11:50] baweaver: Eh, so it goes some times. You can't possibly know every term
[07:11:58] sevenseacat: yes, because you answered a totally different question that they asked :P
[07:12:01] baweaver: you also want to ask upfront when you don't know
[07:12:10] baweaver: otherwise you do look the fool
[07:12:33] techsethi: has joined #RubyOnRails
[07:12:43] arup_r: yes, because I never knew we can develop code also on cloud.. I am so backdated.. .. :/
[07:12:53] arup_r: baweaver: you are true..
[07:14:03] qejk: has joined #RubyOnRails
[07:15:47] rrawlins: has joined #RubyOnRails
[07:16:05] scepticulous: has joined #RubyOnRails
[07:16:24] MateuszRybin: has joined #RubyOnRails
[07:18:40] redasus: has joined #RubyOnRails
[07:20:22] arup_r: has left #RubyOnRails: ()
[07:20:31] Honeycomb: has joined #RubyOnRails
[07:21:20] emilkarl: has joined #RubyOnRails
[07:26:07] gavinhughes: has joined #RubyOnRails
[07:26:17] Pazician: has joined #RubyOnRails
[07:26:25] arup_r: has joined #RubyOnRails
[07:26:43] rakm: has joined #RubyOnRails
[07:27:26] konsolebox: has joined #RubyOnRails
[07:29:24] worknick: has joined #RubyOnRails
[07:29:40] worknick: is there any way I can give access to designer for css and html without giving access to the actual rails code.
[07:29:41] jahbrewski: has joined #RubyOnRails
[07:31:03] vedu: worknick: I seriously doubt it
[07:31:08] baweaver: The best you can do is get them to mock things up
[07:31:14] baweaver: deliver a template
[07:31:18] vedu: If he doesn't have the full thing he wont be able to run it
[07:31:26] sevenseacat: not if you want them to make anything meaningful with your css and html
[07:31:31] baweaver: and have your engineers put the data / live elements in
[07:32:46] vedu: I tried baweaver 's technique once. The code was vanilla HTML and not erb. Big pain. Definitely not a scalable thing to do
[07:33:20] emachnic: has joined #RubyOnRails
[07:33:49] baweaver: that's.... kinda the point
[07:34:09] baweaver: You have a designer knock out a few HTML templates and component designs
[07:34:20] baweaver: that doesn't mean there's not work to do in integrating them later.
[07:34:59] baweaver: hire them on as consultants and get an NDA signed if that's the issue
[07:38:38] wethu: has joined #RubyOnRails
[07:39:32] defsdoor: has joined #RubyOnRails
[07:40:28] lubekpl: has joined #RubyOnRails
[07:41:42] Yeomra: has joined #RubyOnRails
[07:44:21] scepticulous: I am having trouble, that Kernel.const_defined(some-const) sometimes returns false in an rails environment. Is there anything known about this
[07:44:41] jahbrewski: has joined #RubyOnRails
[07:44:48] scepticulous: or should I not use const_defined?(name) to check before I constantize a dynamically created constant name ?
[07:47:47] pawnbox: has joined #RubyOnRails
[07:48:28] arup_r: shouldn't it Object.const_defined?
[07:50:36] wethu: has joined #RubyOnRails
[07:51:47] arup_r: but, I understand your question. So once rails server is booted, i think all code will be loaded. and it wouldn't happen, that sometime a constant miss/hit
[07:52:49] roshanavand: has joined #RubyOnRails
[07:54:11] AlexJakeGreen: has joined #RubyOnRails
[07:56:17] Deck`: has joined #RubyOnRails
[07:56:21] moei: has joined #RubyOnRails
[07:57:29] artto: has joined #RubyOnRails
[07:57:40] SanguineAnomaly: has joined #RubyOnRails
[07:58:53] Zggb: has joined #RubyOnRails
[07:59:24] jas02: has joined #RubyOnRails
[08:01:41] Palsson: has joined #RubyOnRails
[08:04:13] sandstrom: has joined #RubyOnRails
[08:05:20] ziyadb: has joined #RubyOnRails
[08:05:45] srinidhi: has joined #RubyOnRails
[08:12:06] mhoungbo: has joined #RubyOnRails
[08:13:04] comrad: has joined #RubyOnRails
[08:13:11] darutoko: has joined #RubyOnRails
[08:13:28] matthewd: scepticulous: safe_constantize
[08:15:11] arup_r: matthewd: +1 :)
[08:15:46] arup_r: http://apidock.com/rails/ActiveSupport/Inflector/safe_constantize
[08:16:46] arBmind: has joined #RubyOnRails
[08:17:05] mdw: has joined #RubyOnRails
[08:17:08] pawnbox: has joined #RubyOnRails
[08:17:59] adac: has joined #RubyOnRails
[08:21:34] arup_r: has left #RubyOnRails: ()
[08:23:27] AxonetBE: has joined #RubyOnRails
[08:27:53] redasus: has joined #RubyOnRails
[08:28:51] zpe: has joined #RubyOnRails
[08:29:38] jahbrewski: has joined #RubyOnRails
[08:29:42] ravster`: has joined #RubyOnRails
[08:30:46] blackmesa: has joined #RubyOnRails
[08:32:06] avril14th: has joined #RubyOnRails
[08:34:46] Palsson: has joined #RubyOnRails
[08:35:12] User458764: has joined #RubyOnRails
[08:37:51] atmosx: has joined #RubyOnRails
[08:37:52] blackmesa: has joined #RubyOnRails
[08:40:48] bronson: has joined #RubyOnRails
[08:47:04] Honeycomb: has joined #RubyOnRails
[08:47:21] mark2: has joined #RubyOnRails
[08:48:16] jottr: has joined #RubyOnRails
[08:54:59] FooBarWidget: hi guys. are there any passenger users here, or anybody who is interested in looking at passenger? I'd like to know what you think about the Passenger Library: https://www.phusionpassenger.com/library
[08:55:30] rrawlins: has joined #RubyOnRails
[08:56:38] nocontrol: has joined #RubyOnRails
[08:57:47] Bloomer: has joined #RubyOnRails
[08:59:39] jahbrewski: has joined #RubyOnRails
[09:00:26] Prasun: has joined #RubyOnRails
[09:01:36] jsrn: has joined #RubyOnRails
[09:02:35] smathy: I preferred the old docs FooBarWidget
[09:03:05] solars: hi, are there any helpers to output the time a method call took? just want to add it to the logs
[09:03:16] moeabdol: has joined #RubyOnRails
[09:03:37] FooBarWidget: smathy: how can we improve the new ones?
[09:04:30] FooBarWidget: and what kind of issues do you have with the new ones?
[09:04:35] smathy: FooBarWidget, make it more like the old one ;)
[09:04:43] smathy: FooBarWidget, lots of clicks to get to what I'm looking for.
[09:04:47] DoubleMalt: has joined #RubyOnRails
[09:04:50] FooBarWidget: going back to the layout is not an option. all the information just doesn't fit
[09:05:01] FooBarWidget: going back to the *old layout
[09:05:12] FooBarWidget: but is muscle memory your only concern?
[09:05:21] FooBarWidget: like, you can actually find everything you are looking for if you try?
[09:05:36] mdw: has joined #RubyOnRails
[09:08:34] smathy: FooBarWidget, I don't know what your analytics tell you about which section is most popular, but 99% of the time I want the reference page.
[09:09:19] FooBarWidget: that's why there is a 'reference' quicklink in the navbar. doesn't that help?
[09:13:00] smathy: FooBarWidget, I hadn't noticed it until you mentioned it.
[09:13:24] smathy: FooBarWidget, also, riddle me this, I use the search and search for a partial string of an nginx setting, "passenger_env" and the first search result is the Apache page!
[09:13:47] smathy: That sort of stuff is confusing and weird.
[09:13:54] gregf_: has joined #RubyOnRails
[09:14:09] FooBarWidget: yeah, I'd like to solve that some day. it's not easy to customize the search engine that granularly :(
[09:14:13] smathy: It's not that I can't find everything, it's the friction of finding it is higher.
[09:14:26] smathy: When it was all on one page my Command+F found everything I wanted on the nginx page.
[09:14:54] smathy: Maybe you need to get your docs into devdocs or something.
[09:15:02] FooBarWidget: what is devdocs?
[09:15:11] FooBarWidget: http://devdocs.io/ ?
[09:15:18] smathy: I'd like to be able to just turn off everything other than nginx - I'm never EVER interested in anything else.
[09:15:20] smathy: Yes, that.
[09:15:33] emachnic: has joined #RubyOnRails
[09:16:34] smathy: When I think about it, that's the thing that irritates me the most. I just find myself in the Apache section way too often.
[09:16:39] FooBarWidget: for starters, how about I put a big 'Reference' button next to the 'Get started' button on the front page? do you think it would have been more obvious for you?
[09:16:42] smathy: ...or dodging Apache results when I don't even want to think about it.
[09:17:01] neanderslob: has joined #RubyOnRails
[09:18:42] dexter-tzu: has joined #RubyOnRails
[09:19:18] marr: has joined #RubyOnRails
[09:19:28] smathy: FooBarWidget, like the size of the Quickstart and Basics? Yes, that's where I'd expect to see a button to the reference docs. It doesn't even make sense to me that you have both Quickstart and Basics so prominent, especially when the Get Started link in the banner is already the Quickstart.
[09:20:39] FooBarWidget: I actually mean this: http://imgur.com/F9hIWyi
[09:20:53] neshmi_: has joined #RubyOnRails
[09:21:14] kirillzh: has joined #RubyOnRails
[09:21:15] smathy: FooBarWidget, yep, even better.
[09:21:17] msyvich: has joined #RubyOnRails
[09:21:46] smathy: FooBarWidget, while you're at it, add a link from here too: https://www.phusionpassenger.com/documentation_and_support
[09:21:53] jgt4: has joined #RubyOnRails
[09:23:25] smathy: My usual click-party is from the https://www.phusionpassenger.com/ page, to that /documentation_and_support page, then Cmd+F Reference, no link :sadpanda:, read, read, read way more than I should have to, OMG ok, I'll try the Passenger Library link, then read more, read, try Quickstart, nope - not what I was after, OMG my brain's going to explode if I don't see reference docs soon.
[09:24:35] smathy: That's the point I go back to google, and I google passenger_ruby, go to the old docs, and click on one of the links there to take me directly into the reference section of the new docs.
[09:25:11] quazimodo: has joined #RubyOnRails
[09:27:51] eGGsha: has joined #RubyOnRails
[09:28:24] futilegames: has joined #RubyOnRails
[09:28:27] FooBarWidget: smathy: deployed
[09:29:34] smathy: Thanks for asking.
[09:29:39] jahbrewski: has joined #RubyOnRails
[09:30:11] FooBarWidget: the search engine thing won't be as easy to fix. that will take a while
[09:31:35] smathy: This is mostly good now because I can just Cmd+F on the reference page which is the majority of my use case.
[09:31:55] smathy: Ie. it's rare that I'd need the search now.
[09:37:10] akshat: has joined #RubyOnRails
[09:40:32] techsethi: has joined #RubyOnRails
[09:40:48] futilegames: has joined #RubyOnRails
[09:42:13] User458764: has joined #RubyOnRails
[09:42:20] msyvich: has joined #RubyOnRails
[09:45:09] jahbrewski: has joined #RubyOnRails
[09:46:43] roshanavand: has joined #RubyOnRails
[09:47:09] jxs_: has joined #RubyOnRails
[09:56:35] worknick: has joined #RubyOnRails
[09:57:06] worknick: can i make <div class="col-***"> to adjust its width according to the text length inside it?
[09:57:12] worknick: in bootstrap.
[09:57:21] FooMunki: has joined #RubyOnRails
[09:57:56] ddv: worknick: #bootstrap
[09:58:03] blackhuey: has joined #RubyOnRails
[09:58:06] ElFerna: has joined #RubyOnRails
[09:58:53] worknick: no such channel.
[09:59:39] worknick: works with ##
[09:59:40] jahbrewski: has joined #RubyOnRails
[10:01:28] rodfersou: has joined #RubyOnRails
[10:02:08] zpe_: has joined #RubyOnRails
[10:02:48] kapowaz__: has left #RubyOnRails: ()
[10:04:40] redasus: has joined #RubyOnRails
[10:09:36] ramfjord: has joined #RubyOnRails
[10:11:50] thomasfuston: has joined #RubyOnRails
[10:12:11] thomasfuston: has left #RubyOnRails: ("ERC (IRC client for Emacs 24.5.1)")
[10:13:47] Pumukel: has joined #RubyOnRails
[10:15:42] BradenBraden: has joined #RubyOnRails
[10:17:05] moeabdol1: has joined #RubyOnRails
[10:17:58] mdw: has joined #RubyOnRails
[10:18:03] chouhoulis: has joined #RubyOnRails
[10:26:44] arup_r: has joined #RubyOnRails
[10:27:54] sevenseacat: that would kinda defeat the purpose of using a grid
[10:28:32] kerunaru: has joined #RubyOnRails
[10:29:39] jahbrewski: has joined #RubyOnRails
[10:29:40] ldnunes: has joined #RubyOnRails
[10:30:11] ravster`: has joined #RubyOnRails
[10:30:13] railsn00b: has joined #RubyOnRails
[10:30:17] triangles: has joined #RubyOnRails
[10:31:14] triangles: has joined #RubyOnRails
[10:32:08] triangles: has joined #RubyOnRails
[10:33:00] triangles: has joined #RubyOnRails
[10:34:00] triangles: has joined #RubyOnRails
[10:35:25] triangles: has joined #RubyOnRails
[10:36:15] triangles: has joined #RubyOnRails
[10:36:41] bob_f: What do I have to set in order for the `number_to_currency` helper to use a specific locale ? I've tried setting `I18n.locale` and `Application.config.i18n.default_locale` in my test but neither seem to be affecting it.
[10:36:52] bob_f: The only way I can make it work is by explicitly passing a :locale parameter.
[10:37:20] triangles: has joined #RubyOnRails
[10:37:24] Cohedrin: has joined #RubyOnRails
[10:38:09] triangles: has joined #RubyOnRails
[10:38:48] arup_r: Where you kept the setting `Application.config.i18n.default_locale` ?
[10:39:01] triangles: has joined #RubyOnRails
[10:39:16] bob_f: arup_r: application.rb is where it's set initially.
[10:39:48] triangles: has joined #RubyOnRails
[10:40:00] bob_f: arup_r: If I set it to something else in application.rb then I get the correct test result. But I want to be able to stub it.
[10:41:02] baweaver: has joined #RubyOnRails
[10:41:14] arup_r: Are you changing the value of it, in between test ? Sorry, I am trying to understand you..
[10:42:31] bob_f: arup_r: My test does, this: `I18n.locale = :'en-GB'` and later on, my tested code executes `number_to_currency(...)`
[10:43:03] bob_f: But I don't get back an en-GB-formatted value. If I pass `locale: :'en-GB'` explicitly to `number_to_currency` then I get the correct result.
[10:43:12] arup_r: bob_f: show your test please
[10:43:28] bob_f: I18n.locale = :'en-GB'
[10:43:29] bob_f: expect(page).to have_content '??123,456,789'
[10:43:34] bob_f: It's not very long. :)
[10:43:36] illbyte_: has joined #RubyOnRails
[10:44:43] illbyte_: has joined #RubyOnRails
[10:45:08] jahbrewski: has joined #RubyOnRails
[10:45:10] Haydos: has joined #RubyOnRails
[10:45:19] arup_r: bob_f: As I was thinking. Here goes the reasoning http://stackoverflow.com/a/6656001/2767755 and it makes sense.
[10:45:58] roshanavand: has joined #RubyOnRails
[10:46:42] arup_r: You should test without passing the local value, your result is coming as expected or not. If it comes, well good. Now if you want to override the default, just pass the it as local: '' .. and check you are able to override or not. This is a standard way to think.
[10:47:20] dede: has joined #RubyOnRails
[10:48:44] workmad3: bob_f: that looks like a capybara test... and it also looks like you're setting `I18n.locale` after rendering the page
[10:49:02] jottr: has joined #RubyOnRails
[10:49:47] bob_f: workmad3: Yes, definitely a mistake.
[10:49:56] bob_f: But I've moved it to before that, and still the same output.
[10:50:39] workmad3: bob_f: next thought - it's a capybara test, is it by any chance using something like capybara-webkit or phantomjs to execute JS on this test?
[10:50:56] bob_f: Yes, capybara-webkit.
[10:51:03] bob_f: But no JS in these specs.
[10:51:16] arup_r: bob_f: why you are not liking explicitness ? It seems reasonable why it is not working
[10:51:22] illbyte_: has left #RubyOnRails: ()
[10:51:42] workmad3: bob_f: because `I18n.locale` is a thread-local variable... and capybara-webkit runs the server in a separate thread, meaning changes to `I18n.locale` in your test thread won't change it in your server
[10:51:52] bob_f: workmad3: Aha, got it.
[10:51:55] bob_f: Thanks a lot.
[10:52:16] bob_f: I'll just pass it in explicitly, it's no big deal really.
[10:52:21] workmad3: bob_f: you'll want to basically pass a locale as part of your request (as arup_r was suggesting) and have a controller action that sets/resets `I18n.locale` in a before action
[10:52:29] workmad3: so you're hitting the same flow as a user :)
[10:52:34] arup_r: yes.. same as browser.
[10:52:41] bob_f: Right, all makes sense. Thanks a lot !
[10:52:43] arooni: has joined #RubyOnRails
[10:53:02] arup_r: bob_f: sweet. :)
[10:53:27] akshat: has joined #RubyOnRails
[10:54:53] johnnyrose: has joined #RubyOnRails
[10:56:10] johnnyrose: Hi, my rspec feature tests suddenly got really slow after upgrading from 4.2.4 to 4.2.5, has anyone experienced any issues?
[10:56:32] msyvich: has joined #RubyOnRails
[10:57:15] johnnyrose: using phantomjs 2, ruby 2.2.3 running on Semaphore-CI
[10:59:43] jahbrewski: has joined #RubyOnRails
[11:00:12] ql6wlld: has joined #RubyOnRails
[11:02:58] Yeomra: has joined #RubyOnRails
[11:03:59] dionysus69: has joined #RubyOnRails
[11:03:59] lacrymology: has joined #RubyOnRails
[11:04:25] mdw: has joined #RubyOnRails
[11:04:49] Sylario: has joined #RubyOnRails
[11:05:34] dcunit3d: any idea on the part of your specs slowing down?
[11:06:53] User458764: has joined #RubyOnRails
[11:07:20] dcunit3d: if you time the tests, is it across the board, or in one part of your application? is it in test setup?
[11:08:45] workmad3_: has joined #RubyOnRails
[11:09:57] ramfjord_: has joined #RubyOnRails
[11:10:31] n00bDev: has joined #RubyOnRails
[11:11:32] johnnyrose: dcunit3d: across the board, all feature specs. I've tried with RubyProf, testing process time, but the times are very inconsistent. Not sure what to take from the data I get
[11:12:17] user083_: has joined #RubyOnRails
[11:13:10] zacts: has joined #RubyOnRails
[11:13:20] funnel: has joined #RubyOnRails
[11:13:49] rarruda: has joined #RubyOnRails
[11:14:02] guacamole: has joined #RubyOnRails
[11:16:39] noah256: has joined #RubyOnRails
[11:16:53] w0rd-driven: has joined #RubyOnRails
[11:17:06] bahar: has joined #RubyOnRails
[11:17:14] ur5us: has joined #RubyOnRails
[11:17:27] xMopxShell: has joined #RubyOnRails
[11:18:14] Nuck: has joined #RubyOnRails
[11:18:46] chouhoulis: has joined #RubyOnRails
[11:19:01] loglaunch: has joined #RubyOnRails
[11:19:06] matthewd: has joined #RubyOnRails
[11:19:22] lacrymology: has joined #RubyOnRails
[11:20:20] Ergo: has joined #RubyOnRails
[11:20:56] mhoungbo: has joined #RubyOnRails
[11:21:24] Marquel: has joined #RubyOnRails
[11:23:02] c355E3B: has joined #RubyOnRails
[11:24:47] hightower3: has joined #RubyOnRails
[11:25:08] bob_f: arup_r: workmad3_: Turns out this app already has a locale controller for switching, so the work is already done for me. Doingggg.
[11:25:42] arup_r: bob_f: cool
[11:27:03] jgt4: has joined #RubyOnRails
[11:27:28] johnnyrose: dcunit3d: got any suggestions on how to proceed? use RubyProf and try to isolate? How can I compare then the runs vary so much?
[11:28:31] solars: hi, does anyone know if bullet works for tests as well?
[11:29:40] jahbrewski: has joined #RubyOnRails
[11:30:06] bob_f: arup_r: `visit /locale/en-GB` before I visit the actual page, everything works. Hooray. Thanks again.
[11:30:12] arup_r: solars: why so. You can use it in dev, and fix the issue if encountered.
[11:30:44] msyvich: has joined #RubyOnRails
[11:31:15] arup_r: if it is fixed there, test will be ok too. Your code wouldn't behave differently in both environment, if the code really related to the code you wrote.
[11:31:39] arup_r: bob_f: cool, I fall asleep at my desk. no idea why.. :p
[11:32:46] solars: arup_r, the app is more or less an api, so most things are covered with tests not frontends
[11:33:07] redasus: has joined #RubyOnRails
[11:33:09] arup_r: you didn't get me.
[11:34:13] arup_r: solars: you can, https://github.com/flyerhzm/bullet#run-in-tests ,. have fun :)
[11:34:54] solars: arup_r, I just found that :)
[11:35:31] codedmart: has joined #RubyOnRails
[11:38:41] solars: hm I'm getting a N+1 query problem warning with a relation that has dependent => destroy
[11:40:33] arup_r: usse .includes(). solars :)
[11:40:50] hamed_r: has joined #RubyOnRails
[11:41:34] jottr: has joined #RubyOnRails
[11:41:55] solars: I thought that when using Fo.destroy_all with fo has_many bar, dependent => destroy, it's included automatically
[11:43:08] djinni`: has joined #RubyOnRails
[11:43:23] arup_r: I think bullet shows the exact query from where it get the N + 1 probelm.
[11:43:45] arup_r: dunno how dependent: :destory is involved here.. may be other can say. not me :)
[11:43:59] solars: I'll try to find out
[11:44:03] solars: no problem though anyway
[11:44:30] mikecmpbll: has joined #RubyOnRails
[11:44:42] AzaToth: has joined #RubyOnRails
[11:47:27] FooMunki: has joined #RubyOnRails
[11:49:35] cookiez: has joined #RubyOnRails
[11:50:24] akshat_: has joined #RubyOnRails
[11:50:54] quazimodo: has joined #RubyOnRails
[11:53:14] tjbiddle: has joined #RubyOnRails
[11:56:28] ElFerna: has joined #RubyOnRails
[11:58:36] bauruine: has joined #RubyOnRails
[11:59:37] jahbrewski: has joined #RubyOnRails
[12:07:37] msyvich: When I set ENV['GEM_PATH'] in environment/*.rb, this appears to be cached somewhere, not just in an environment variable
[12:07:46] msyvich: but `gem environment` doesn't reflect it's value
[12:07:49] msyvich: Where is this cached?
[12:10:19] kerunaru: has joined #RubyOnRails
[12:10:24] crdpink: has joined #RubyOnRails
[12:11:11] sandstrom: has joined #RubyOnRails
[12:11:12] n00bDev: has joined #RubyOnRails
[12:13:07] neshmi_: has joined #RubyOnRails
[12:16:14] workmad3: has joined #RubyOnRails
[12:16:17] arup_r: has left #RubyOnRails: ()
[12:16:37] marr: has joined #RubyOnRails
[12:19:36] chouhoulis: has joined #RubyOnRails
[12:19:44] eyck: has joined #RubyOnRails
[12:22:06] jtong: has joined #RubyOnRails
[12:25:28] earfin: has joined #RubyOnRails
[12:28:06] blackmesa: has joined #RubyOnRails
[12:28:55] crdpink2: has joined #RubyOnRails
[12:29:40] jahbrewski: has joined #RubyOnRails
[12:30:37] arup_r: has joined #RubyOnRails
[12:30:44] multiscan: has joined #RubyOnRails
[12:31:11] ravster`: has joined #RubyOnRails
[12:31:43] earfin: has joined #RubyOnRails
[12:33:00] bronson: has joined #RubyOnRails
[12:33:44] daivyk: has joined #RubyOnRails
[12:33:51] askhat: has joined #RubyOnRails
[12:35:18] bruce_lee: has joined #RubyOnRails
[12:35:46] bruce_lee: has joined #RubyOnRails
[12:37:01] adre: has joined #RubyOnRails
[12:39:49] _3by8: has joined #RubyOnRails
[12:40:29] _3by8: I'm attempting to deploy to DigitalOcean but any time I run bundle, it ends abruptly with the message "Killed". anyone have any idea what's happening?
[12:40:29] arup_r: has left #RubyOnRails: ()
[12:40:35] berserk_ren: has joined #RubyOnRails
[12:41:52] rrawlins: has joined #RubyOnRails
[12:42:15] baweaver: has joined #RubyOnRails
[12:43:31] Kollosus: has joined #RubyOnRails
[12:43:57] Kollosus: has left #RubyOnRails: ()
[12:44:23] hnanon: has joined #RubyOnRails
[12:45:11] Jasaka: has joined #RubyOnRails
[12:46:39] adre: has joined #RubyOnRails
[12:46:50] ddv: _3by8: check the logs?
[12:47:01] ddv: probably OOM what rvanlieshout suggests
[12:47:03] Kollosus: has joined #RubyOnRails
[12:47:30] bahar: has joined #RubyOnRails
[12:47:40] _3by8: ddv: yeah that seems likely, just read something on Google about DigitalOcean droplets not being preconfigured to have a swap.
[12:47:46] hnanon: Why am I getting a "user not authorized" error here for the order show action? I'm using Pundit: https://gist.github.com/anonymous/086dfbe892e391ea1378
[12:48:24] msyvich: has joined #RubyOnRails
[12:50:29] universa1: hnanon: there is no show action?
[12:53:15] pawnbox: has joined #RubyOnRails
[12:53:36] arup_r: has joined #RubyOnRails
[12:53:37] rvanlieshout: because check logs
[12:53:44] rvanlieshout: and have pundit log when auth fails
[12:54:04] Moeh: has joined #RubyOnRails
[12:55:57] msyvich: has joined #RubyOnRails
[12:59:42] jahbrewski: has joined #RubyOnRails
[13:00:11] hnanon: universa1: I meant the index action.
[13:01:00] roshanavand: has joined #RubyOnRails
[13:01:59] krzkrz: has joined #RubyOnRails
[13:02:06] roshanavand: has joined #RubyOnRails
[13:03:25] gavinhughes: has joined #RubyOnRails
[13:03:46] qejk: has joined #RubyOnRails
[13:05:07] gambl0re: has joined #RubyOnRails
[13:07:12] Nucky: has joined #RubyOnRails
[13:07:44] hightower3: has joined #RubyOnRails
[13:08:00] Nucky: Is there a Front-end framework that meshes comfortably with Rails?
[13:08:26] Ergo^: has joined #RubyOnRails
[13:08:49] gavinhug_: has joined #RubyOnRails
[13:10:31] _3by8: Nucky: Bootstrap is pretty nice. There's a gem and everything.
[13:11:56] n00bDev: has joined #RubyOnRails
[13:14:33] ElFerna: has joined #RubyOnRails
[13:17:10] Nucky: _3by8: Sorry, I mean along the lines of Angular, React, etc.
[13:17:44] _3by8: Nucky: oh, got it. JavaScript framework.
[13:17:45] rrawlins: has joined #RubyOnRails
[13:17:58] techsethi: has joined #RubyOnRails
[13:18:05] _3by8: Nucky: yeah, nope. I don't know.
[13:18:53] _3by8: Actually though I've read that the JSON functionality built into Rails works nicely with Angular.
[13:20:20] chouhoulis: has joined #RubyOnRails
[13:20:42] ddv: Nucky: bootstrap, semantic-ui, foundation whatever you want
[13:21:38] jgpawletko: has joined #RubyOnRails
[13:21:49] ddv: Nucky: angular-rails, react_on_rails etc
[13:22:10] mooru: has joined #RubyOnRails
[13:22:29] emachnic: has joined #RubyOnRails
[13:23:55] gavinhughes: has joined #RubyOnRails
[13:25:57] Nucky: ddv: Thanks I will give those a look.
[13:28:00] akshat: has joined #RubyOnRails
[13:29:03] emachnic_: has joined #RubyOnRails
[13:29:39] jahbrewski: has joined #RubyOnRails
[13:31:08] msyvich: has joined #RubyOnRails
[13:31:52] sonOfRa: has joined #RubyOnRails
[13:37:43] blackmesa: has joined #RubyOnRails
[13:39:03] prashant29: has joined #RubyOnRails
[13:41:49] mdw: has joined #RubyOnRails
[13:43:32] Alek: has joined #RubyOnRails
[13:50:53] Megamos: has joined #RubyOnRails
[13:54:34] lessless: has joined #RubyOnRails
[13:55:59] jgt4: has joined #RubyOnRails
[13:57:07] arup_r: pragmatism: 581 people are here.. so yes, we are :)
[13:57:23] arup_r: sorry.. wrong name..
[13:59:31] ql6wlld: has joined #RubyOnRails
[13:59:38] jahbrewski: has joined #RubyOnRails
[14:01:25] B1n4r10: has joined #RubyOnRails
[14:02:22] User458764: has joined #RubyOnRails
[14:02:31] n1lo: has joined #RubyOnRails
[14:02:34] Wobni: has left #RubyOnRails: ()
[14:02:59] w0bni: has joined #RubyOnRails
[14:03:23] w0bni: I am using as_json to avoid returning modified/created, and to include some other models
[14:04:22] w0bni: model a includes model_b
[14:04:35] w0bni: however, when getting model_b through model_a, it seems that model_b's as_json is ignored
[14:04:45] w0bni: Is that something I can fix?
[14:06:14] mingsheng: has joined #RubyOnRails
[14:06:26] quazimodo: has joined #RubyOnRails
[14:06:59] w0bni: aha, apparently been an issue since 09
[14:07:29] VeryBewitching: has joined #RubyOnRails
[14:07:34] mooru: has joined #RubyOnRails
[14:07:49] VeryBewitching: Good morning folks.
[14:09:05] lexileo: has joined #RubyOnRails
[14:09:50] arup_r: evening here ..
[14:10:42] bob_f: It's afternoon here really. :(
[14:12:21] avm: has joined #RubyOnRails
[14:12:46] n00bDev: has joined #RubyOnRails
[14:13:01] fox_mulder_cp: 2 hours for friday's party
[14:13:09] helpa: http://youtu.be/kfVsfOSbJY0
[14:13:31] sheepman: if your model action code is a one or two liner, it seems a bit pointless putting it in there and not the controller. But I assume its just best practice for it to live in the model?
[14:13:51] rvanlieshout: sheepman: the amount of lines shouldn't be a reason for where to put code
[14:14:04] ravster`: has joined #RubyOnRails
[14:14:10] rvanlieshout: there is a clear line between the models and controllers world
[14:14:25] sheepman: rvanlieshout: just seems silly to have one line in the controller to call one line in the model
[14:14:28] sheepman: but i understand
[14:14:34] rvanlieshout: what's the line?
[14:14:58] sheepman: in my case its to update the users ip they have visited the site from
[14:14:59] jahbrewski: has joined #RubyOnRails
[14:15:12] sheepman: *last visited the site from i should of said
[14:15:40] rvanlieshout: that should go in the controller for sure
[14:16:03] sheepman: really? because? Maybe i should just do some reading...
[14:16:16] rvanlieshout: a model doesn't know anything about the request context
[14:16:23] sheepman: ah ok good point
[14:16:41] sheepman: I was going to have a model action like "update_last_ip"
[14:17:08] fox_mulder_cp: some days ago i ask about rails classes - i has a some primary classes, and want to extend it by external properties, which a common of main classes, such as have_backup, paid_until, admin_blocked. how to make this? make a new class with this nproperties and add it as has_one in main classes?
[14:17:22] fox_mulder_cp: or just add this properties to all main classes?
[14:17:27] arup_r: fox_mulder_cp: you got your internet connection back ? :)
[14:17:35] rvanlieshout: fox_mulder_cp: you include them
[14:17:45] rvanlieshout: you might want to read about concerns
[14:17:55] fox_mulder_cp: but first way - is easy extendable...
[14:18:09] pwnd_nsfw: AMS, I don't understand the difference between serializer and each_serializer except that each_serializer is the only one working for me currently lol
[14:18:19] fox_mulder_cp: rvanlieshout: concern - may be used for data_base preferred properties?
[14:18:51] fox_mulder_cp: i think about concern only for dynamic functions, without database model...
[14:18:53] rvanlieshout: concerns are used to include sets of code
[14:18:53] aegis3121: has joined #RubyOnRails
[14:20:12] fox_mulder_cp: rvanlieshout: but as i see, best way for me make new model for common_properties and add it as has_one to main models
[14:20:37] rvanlieshout: that all depends on what you're trying to do
[14:20:41] rvanlieshout: in generic there is no 'best way'
[14:20:43] fox_mulder_cp: duck-duck method relly works, thanks )
[14:21:16] fox_mulder_cp: or speak-with-duck
[14:21:24] chouhoulis: has joined #RubyOnRails
[14:22:32] fwaokda: I'm trying to create a form where I can add records in bulk, but I'm not exactly sure how to do it. I think mainly because I currently have my object as a nested resource. I've tried to outline the structure at the following link if someone thinks they could take a look at it? https://gist.github.com/daveomcd/d5e351a35668e0d29c26
[14:26:33] techsethi: has joined #RubyOnRails
[14:26:59] redasus: has joined #RubyOnRails
[14:29:23] fahrradflucht: has joined #RubyOnRails
[14:29:42] jahbrewski: has joined #RubyOnRails
[14:31:36] drbayer: has joined #RubyOnRails
[14:31:52] ravster`: has joined #RubyOnRails
[14:33:06] bmalum: has joined #RubyOnRails
[14:34:02] celly: has joined #RubyOnRails
[14:34:07] User458764: has joined #RubyOnRails
[14:34:19] jett1: has joined #RubyOnRails
[14:34:41] Demerzel: has joined #RubyOnRails
[14:35:33] devdazed: has joined #RubyOnRails
[14:35:50] krzkrz: has joined #RubyOnRails
[14:39:18] pwnd_nsfw: https://gist.github.com/daveomcd/d5e351a35668e0d29c26#file-form_i_would_like_to_use-html-erb-L14
[14:39:21] pwnd_nsfw: oh god what is that
[14:39:45] jsrn_: has joined #RubyOnRails
[14:40:05] jett1: has left #RubyOnRails: ()
[14:40:07] pwnd_nsfw: I also don't see a form?
[14:41:04] SwiftFoxt: has joined #RubyOnRails
[14:41:20] Demerzel: I think he wants to add a form there
[14:42:44] macsteps: has joined #RubyOnRails
[14:42:52] polishdub: has joined #RubyOnRails
[14:43:08] nerium: has joined #RubyOnRails
[14:44:12] flujan: has joined #RubyOnRails
[14:44:21] fwaokda: yes sorry, im wanting to add a form
[14:44:21] flujan: Hello. I have Gemfile and just executed bundle update. So it installed rails to me. How can I update the Gemfile to use rails instead of 4.2.1? Do I need to change it manually or bundle can do that? Thanks.
[14:44:46] fwaokda: pwnd_nsfw, i just kinda threw that together to illustrate it but guess it was poorly done
[14:45:06] Demerzel: flujan: you'll have to change that manually in your Gemfile near the top where it says rails version
[14:45:08] SwiftFoxt: has left #RubyOnRails: ()
[14:45:09] jahbrewski: has joined #RubyOnRails
[14:45:27] flujan: Demerzel: ok, thanks for the tip.
[14:45:28] Demerzel: i don't think there are any changes to the app structure going from 4.2.1 to
[14:46:33] Demerzel: fwaokda: this will be a mess of nested fields_for
[14:46:38] fwaokda: pwnd_nsfw, im thinking perhaps my main issue/confusion is I currently have "workout" as a nested resource of "player" and perhaps it should be it's own
[14:46:43] SwiftFox: has joined #RubyOnRails
[14:47:04] DoubleMalt: has joined #RubyOnRails
[14:47:51] fwaokda: Demerzel, is there a better way of doing it? Currently I can add the measurables on a player by player basis, but this is hopefully going to allow a user to see a form for all players attending a specific game to input all on one page
[14:48:05] Demerzel: fwaokda: one possibility is to not use many small remote forms and just use things like change triggers to do the saving
[14:48:45] fwaokda: Demerzel, not sure i follow
[14:49:02] fwaokda: is a change trigger similar to a callback?
[14:49:32] flujan: Demerzel: thanks.
[14:50:16] Demerzel: for each player measurables you want to store, setup a small form for that player and workout combination and submit that on change (javascript trigger)
[14:50:36] flujan: Demerzel: I have a script inside my rails app that only uses Savon and Active Record. Is there a way to puts the version of ActiveRecord the script is loading? I have many versions of rails installed??? So I just need to figure out which one I am really using.
[14:51:32] jtong: has joined #RubyOnRails
[14:52:44] Demerzel: flujan: inside your script you can use: puts ActiveRecord.gem_version
[14:53:03] mices: should i be able to align an image_tag and a button_tag vertically
[14:53:09] mices: i mean horizontally
[14:53:29] flujan: Demerzel: Thank you very much. :)
[14:53:31] mices: they're coming out on top of each other i went them side by side
[14:53:48] Demerzel: mices: sounds like a CSS issue
[14:54:15] mices: Demerzel: somewhat yes, but it's somewhat rails because i'm using the helpers
[14:54:30] soahccc: flujan: in other cases you can also resort to this method :) $LOADED_FEATURES.grep(/activerecord/i).first
[14:54:54] adavia: has joined #RubyOnRails
[14:55:13] pwnd_nsfw: it has nothing to do with rails mices
[14:55:22] flujan: soahccc: thank you. :)
[14:55:33] pwnd_nsfw: unless you're using class attribute incorrectly
[14:55:36] pwnd_nsfw: it has nothing to do with rails
[14:55:49] ravster`: has left #RubyOnRails: ()
[14:56:08] ravster`: has joined #RubyOnRails
[14:56:23] Demerzel: fwaokda: left a comment on your gist describing one approach
[14:56:32] Demerzel: lots of form_for calls inside a loop
[14:56:57] Demerzel: either put submit buttons for all of them or use JS change events on the various fields to submit the forms as needed
[14:57:18] Yeomra: has joined #RubyOnRails
[14:57:37] Demerzel: mices: in the helpers you're supposed to add style: '' and class: '' attributes to give you the ability to style anything as you'd like
[14:57:58] Demerzel: you'll need css in place before you do class of course but you can also do inline css in the style attribute
[14:58:07] Demerzel: all that is likely beyond the scope of rails
[14:58:31] mices: i might have done that instead of manuall resizing a button image icon in gimp
[14:58:46] fwaokda: Demerzel, thanks taking a peek now
[14:59:21] mices: but now the issue is to remove the line break that i dunno what causes it, there's no div tags between the two
[14:59:38] mices: so what style is that? no line break
[14:59:40] jahbrewski: has joined #RubyOnRails
[14:59:46] techsethi: has joined #RubyOnRails
[15:00:06] Demerzel: mices: no idea :-) I usually rely on a designer to fix that kind of stuff for me
[15:00:09] mices: wouldn't be particular to the button anyway
[15:00:29] Demerzel: i'd recommend you view the source of your page and see if #css can help
[15:00:57] Demerzel: those helpers are just generating the tags and not adding any styling unless you specify it
[15:01:12] pwnd_nsfw: mices, you should ask #css to write your code
[15:01:39] Demerzel: ACTION keeps a straight face, 10 points to Demerzel!
[15:02:15] arup_r: ACTION lacks css skills too :(
[15:03:12] Demerzel: I can only do extremely basic css
[15:03:27] Demerzel: not proud of it but i've too much to learn elsewhere to worry about that yet
[15:04:35] pwnd_nsfw: I know how to use bootstrap out of the box :p
[15:05:32] Demerzel: i should've said that :-/
[15:08:43] ramortegui: has joined #RubyOnRails
[15:09:34] msyvich: has joined #RubyOnRails
[15:09:48] macsteps: has joined #RubyOnRails
[15:09:55] macsteps: has joined #RubyOnRails
[15:10:42] Sheperson: has joined #RubyOnRails
[15:12:28] jds: has joined #RubyOnRails
[15:12:37] techsethi: has joined #RubyOnRails
[15:12:45] Sheperson: Is it possible to specify a locale for all calls to `get` and `post` in RSpec?
[15:13:00] Sheperson: so that get :index would be the same as get :index, locale: ???en???
[15:13:04] Macaveli: has joined #RubyOnRails
[15:13:08] qejk: has joined #RubyOnRails
[15:14:04] chrisarcand: sheperson: You could define a helper method https://www.relishapp.com/rspec/rspec-core/docs/helper-methods/define-helper-methods-in-a-module
[15:14:06] moresilenter: has joined #RubyOnRails
[15:14:42] Rodya_: has joined #RubyOnRails
[15:14:45] n00bDev: has joined #RubyOnRails
[15:15:34] moresilenter: hi! is there any Rails-y way for me to get a list of every class currently polymorphically associated to my record?
[15:15:58] sheepman: moresilenter: in rails console you have tab complete if that helps?
[15:16:03] moresilenter: without just selecting unique down the <association>_type column? manually
[15:16:10] mdw: has joined #RubyOnRails
[15:16:26] Sheperson: chrisarcand: Can you explain a little more?
[15:16:29] moresilenter: hmmm, this is for something I'm trying to automate in my server
[15:16:42] moresilenter: it's a little complicated
[15:16:56] dEPy: has joined #RubyOnRails
[15:17:05] moresilenter: basically I'm following this https://gist.github.com/runemadsen/1242485
[15:17:35] sheepman: can't think of a way sorry but maybe someone else can
[15:17:38] moresilenter: but I have no way ahead of time to know that what classes will exist, as compared to the example case where he knows Video and Picture will exist
[15:18:12] moresilenter: np, thanks for trying! yeah it seems tricky
[15:18:36] chrisarcand: sheperson: This answer should assist you: http://stackoverflow.com/questions/8447944/how-can-you-universally-override-the-get-and-post-methods-in-rspec
[15:19:55] mary5030: has joined #RubyOnRails
[15:23:43] lorn: has joined #RubyOnRails
[15:23:44] mary5030: has joined #RubyOnRails
[15:24:14] emachnic: has joined #RubyOnRails
[15:25:28] sandstrom: has joined #RubyOnRails
[15:25:40] mooru: has joined #RubyOnRails
[15:26:33] uris: has joined #RubyOnRails
[15:26:35] emachnic: has joined #RubyOnRails
[15:27:41] NBarnes: has joined #RubyOnRails
[15:27:59] scepticulous: has joined #RubyOnRails
[15:29:42] jahbrewski: has joined #RubyOnRails
[15:29:52] Sadin: has joined #RubyOnRails
[15:30:22] brycesenz: has joined #RubyOnRails
[15:31:32] stannard: has joined #RubyOnRails
[15:31:49] techsethi: has joined #RubyOnRails
[15:32:28] Demerzel: moresilenter: I don't think you can figure out what types exist in a polymorphic field unless you either restrict them to specific types or use a mechanism similar to a manual counter cache and update the list of used types in a field somewhere
[15:33:35] FooMunki: has joined #RubyOnRails
[15:33:54] herpless: has joined #RubyOnRails
[15:35:00] B1n4r10: has joined #RubyOnRails
[15:35:05] jjwright: has joined #RubyOnRails
[15:36:48] safetypin: has joined #RubyOnRails
[15:37:16] kies^: has joined #RubyOnRails
[15:37:22] dionysus69: has joined #RubyOnRails
[15:38:33] Radar: GOOD AFTERNOON
[15:41:13] lost_soul: has joined #RubyOnRails
[15:42:18] lost_soul__: has joined #RubyOnRails
[15:42:54] moresilenter: Demerzel: that's a great idea!! thanks
[15:43:01] gregf_: has left #RubyOnRails: ()
[15:43:02] lost_soul: has joined #RubyOnRails
[15:43:12] moresilenter: I'll just have them register with a listener whenever they boot up
[15:43:40] Demerzel: that works :-)
[15:44:04] ravster`: has left #RubyOnRails: ()
[15:44:45] gregf___: has joined #RubyOnRails
[15:44:58] brycesenz: Hi all. Does anyone have experience using rspec's "order" command? I'd like for my specs to run in a specific order, but I'm unsure how to make that happen and the documentation I've found doesn't seem to give any indication of how to explicitly specify an order.
[15:45:02] ravster: has joined #RubyOnRails
[15:45:36] rrawlins: has joined #RubyOnRails
[15:45:44] lost_soul: has joined #RubyOnRails
[15:45:45] drbayer: has joined #RubyOnRails
[15:45:47] Demerzel: brycesenz: i don't know that you can specify an order using that command. I think the only thing you can do is specify it to execute in random order
[15:46:06] Demerzel: brycesenz: in the absence of the order directive, though, specs are executed in the order in which they appear in your files
[15:46:48] brycesenz: Demerzel - that's the conclusion I was coming to. Do you know of any other means of specifying an order?
[15:47:04] lost_soul__: has joined #RubyOnRails
[15:47:35] Radar: brycesenz: specify the tests to the command line as "rspec file_spec.rb:1 file_spec.rb:3
[15:47:38] msyvich: has joined #RubyOnRails
[15:47:48] Radar: brycesenz: Why are your tests order dependent though? Seems bad.
[15:49:00] Demerzel: Agreed, order-dependence signals a problem with testing
[15:49:17] Demerzel: either the code isn't fully testable or the tests are improper
[15:50:36] effektz: has joined #RubyOnRails
[15:51:11] Medicated: has joined #RubyOnRails
[15:51:46] Deck`: has joined #RubyOnRails
[15:52:36] Radar: aaaand silence :) Don't keep me waiting1
[15:52:51] Demerzel: i think he d/ced
[15:53:18] Demerzel: for the logs, though, there's always the --seed argument you can give to rspec to run a specific seed
[15:53:32] Demerzel: i.e. a specific random order
[15:53:35] Radar: which'll make it run in the _same_ order each time, but I think he wants to define a particular order.
[15:53:51] antgel: has joined #RubyOnRails
[15:53:55] Demerzel: i think doing it by how you list the specs is probably best
[15:54:05] Demerzel: line numbers like you suggested is awesome but brittle
[15:54:31] Demerzel: might be able to use test descriptions tho right?
[15:54:36] Radar: http://stackoverflow.com/questions/26281052/how-to-run-minitestunit-tests-in-ordered-sequence
[15:54:39] jgt4: has joined #RubyOnRails
[15:55:10] Demerzel: that's awesome
[15:56:16] FooMunki: has joined #RubyOnRails
[15:56:24] _3by8: So I'm about to deploy my very first app and I was wondering... let's say--no, let's pretend--that I deleted a couple of migrations for whatever reason. Is there some sort of function that'll write the schema file to the database?
[15:57:21] Radar: _3by8: rake db:schema:load
[15:57:39] Radar: o/ VeryBewitching
[15:57:58] _3by8: is it bad that i read that as "heil radar"?
[15:58:08] Demerzel: _3by8: surely you're asking this for a friend :-)
[15:58:12] VeryBewitching: Radar: Enjoying MTWR so far
[15:58:30] Radar: VeryBewitching: great :)
[15:58:34] _3by8: Demerzel: well actually I was trying to cover for him because he's the one who deleted my migrations. Last time I let him play Fallout 4.
[15:59:00] Demerzel: there there, we get it :-)
[15:59:12] _3by8: dude what?
[15:59:25] mdw: has joined #RubyOnRails
[15:59:26] _3by8: dude he thought he was a hacker
[15:59:38] jahbrewski: has joined #RubyOnRails
[15:59:39] _3by8: he got on fallout and he tried to hack it with ruby
[15:59:45] Devalo: has joined #RubyOnRails
[15:59:59] _3by8: he made this hack that gave him infinite caps and also delete my migrations
[16:00:08] Demerzel: I do need to play Fallout 4 soonish
[16:00:17] solars: hi, I've got a factory like this to test ancestry: https://gist.github.com/solars/48d84f7a2c488b330b98 the parent never gets persisted, although the child gets a reference - why is that?
[16:00:19] Demerzel: that's an awesome hack
[16:00:42] Demerzel: reminds me of the time I formatted a friend's HDD thinking I was using a parameter that only did a dry run
[16:00:54] _3by8: no it's not, think about it: you're essentially taking 2 people out of the workforce. the guy who loses his job and the guy who is set for life in fallout 4
[16:00:56] Demerzel: turns out that parameter was changed in the version of windows he was running
[16:01:58] Frem: has joined #RubyOnRails
[16:02:09] _3by8: i didn't think there was a "dry run" option for formatting your hard drive
[16:02:15] _3by8: how does that work exactly? lol
[16:02:36] _3by8: does windows give it some chunk of virtual space that it may operate on over and over again?
[16:02:45] gingray: has joined #RubyOnRails
[16:03:05] _3by8: Radar: o/
[16:03:15] Brando753: has joined #RubyOnRails
[16:03:16] Radar: hi again :)
[16:03:26] waka_: has joined #RubyOnRails
[16:04:37] Pazician: has joined #RubyOnRails
[16:04:46] havenn: has joined #RubyOnRails
[16:04:46] havenn: has joined #RubyOnRails
[16:05:17] User458764: has joined #RubyOnRails
[16:05:26] duderon__: has joined #RubyOnRails
[16:05:50] Radar: I can be bad but I am not that bad.
[16:05:57] griffindy: has joined #RubyOnRails
[16:06:16] shaman42_: has joined #RubyOnRails
[16:06:21] techsethi: has joined #RubyOnRails
[16:06:28] drupald_: has joined #RubyOnRails
[16:07:00] bakingbread: has joined #RubyOnRails
[16:07:57] Kunzler: has joined #RubyOnRails
[16:08:10] shamanime: has joined #RubyOnRails
[16:08:41] Dreamer3_: has joined #RubyOnRails
[16:08:51] _3by8: Radar: sometimes bad is good
[16:09:00] Radar: _3by8: Not that kind of bad.
[16:09:02] _3by8: take obama for example
[16:09:03] Radar: That bad was very bad.
[16:09:23] MarqueI: has joined #RubyOnRails
[16:09:27] helpa: ¯\(°_o)/¯
[16:09:41] _3by8: well yes, in the obvious interest of any potential survivors in this very room we should condemn anyone like the nazis
[16:09:48] a1fa_: has joined #RubyOnRails
[16:09:54] guacamol1: has joined #RubyOnRails
[16:10:08] _3by8: but let's talk about obama
[16:10:20] pipework: Let's offtopic that in #ruby-offtopic
[16:10:25] pipework: or ##politics
[16:10:34] _3by8: president or ayatollah khomeini in disguise?
[16:10:41] yogeshrt: has joined #RubyOnRails
[16:10:46] _3by8: hey guys let's uh
[16:10:46] Demerzel: #politics is thattaway ----->
[16:10:48] _3by8: let's not
[16:11:01] _3by8: this is ruby on rails so let's just talk right here
[16:11:04] _3by8: doesn't have to be about politics
[16:11:06] greenhat|: has joined #RubyOnRails
[16:11:07] _3by8: it doesn't have to be about anything
[16:11:10] _3by8: it can just be talk
[16:11:13] _3by8: between guys
[16:11:15] _3by8: who like rails
[16:12:04] M-shine: has joined #RubyOnRails
[16:12:09] tego101: has joined #RubyOnRails
[16:12:18] _3by8: of course this is obviously an invitation to elicit the most salacious secrets imagineable
[16:12:23] _3by8: yes, let your inner donald trump flow
[16:12:43] urkle-: has joined #RubyOnRails
[16:12:50] _3by8: i sense teeth grinding
[16:12:59] _3by8: to a halt
[16:13:20] _3by8: nobody f***ing likes me
[16:13:35] _3by8: no wonder i think so much about suicide
[16:13:42] _3by8: not even a joke ^
[16:14:10] Demerzel: suicide is fine if you happen to be a process
[16:14:14] Demerzel: just not a good idea for people
[16:14:33] Marquel: has joined #RubyOnRails
[16:14:42] jahbrewski: has joined #RubyOnRails
[16:14:43] ElFerna: has joined #RubyOnRails
[16:14:59] _3by8: my mind is split, i literally have schizophrenia
[16:15:32] n00bDev: has joined #RubyOnRails
[16:15:45] lacrymology: has joined #RubyOnRails
[16:15:46] _3by8: #CasualRails
[16:15:53] Rodya_: has joined #RubyOnRails
[16:16:29] rubyonrailed: has joined #RubyOnRails
[16:17:34] badeball: has joined #RubyOnRails
[16:17:40] masscrx: has joined #RubyOnRails
[16:17:48] scrooloose: has joined #RubyOnRails
[16:18:33] dmz: has joined #RubyOnRails
[16:18:47] Demerzel: i forget now
[16:19:02] Demerzel: there's a way to take a hash with string keys and convert it into a hash with symbol keys right?
[16:19:34] ldnunes: has joined #RubyOnRails
[16:20:23] Demerzel: HashWithIndifferentAccess it seems
[16:20:25] Cervajz: has joined #RubyOnRails
[16:20:35] Demerzel: might be the best way to do it
[16:21:09] _3by8: I always wondered what that was for, I've seen it a couple of times on StackOverflow but never had any interest in figuring it out. So it just doesn't care if you give it a string or a symbol as a key?
[16:22:06] sandstrom: has joined #RubyOnRails
[16:22:14] _3by8: Oh, I see.
[16:22:21] _3by8: Thanks Stack Overflow.
[16:22:34] _3by8: I mean Google, you deserve a little bit of the credit.
[16:22:41] moresilenter: has left #RubyOnRails: ()
[16:22:47] _3by8: But Stack Overflow da real MVP.
[16:22:47] bigtin1978: has joined #RubyOnRails
[16:23:12] flujan: has joined #RubyOnRails
[16:23:33] _3by8: Demerzel: you like being mysterious don't you?
[16:24:03] Demerzel: sorry was in a different workspace :-)
[16:24:15] Rodya_: has joined #RubyOnRails
[16:24:16] _3by8: Okay, carry on.
[16:24:23] _3by8: Oh, that's called a tab.
[16:24:25] Demerzel: how do I edit messages here?
[16:24:43] vedu: Hello. I am trying to do a CROS request to my rails API but I am getting a parse error. full code and error: https://gist.github.com/vedant1811/fd8b121f29b4387100df
[16:24:47] Demerzel: it's only a tab if you reddit in a browser in an existing workspace like a n00b
[16:24:48] disgrntld: has joined #RubyOnRails
[16:24:55] Demerzel: i reddit on a dedicated browser full screened
[16:25:00] Demerzel: so i don't have to be distracted
[16:25:03] Demerzel: by anything
[16:25:05] Demerzel: including work
[16:25:14] vedu: Demerzel: hey! I fixed my chruby problem
[16:25:23] Demerzel: vedu: awesome! what was it?
[16:25:31] vedu: I started a new server and switched to RVM :D
[16:25:45] Demerzel: resounding endorsement of chruby that
[16:25:46] crystal77: has joined #RubyOnRails
[16:25:57] Demerzel: but whatever works :-)
[16:26:00] bigtin1978: has left #RubyOnRails: ()
[16:26:01] macsteps: has joined #RubyOnRails
[16:26:10] vedu: For some reason rvm sources bashrc and chruby doesn't. pty: true or not
[16:26:11] chouhoulis: has joined #RubyOnRails
[16:26:21] afx_: has joined #RubyOnRails
[16:26:42] Demerzel: vedu: i suspect it was a matter of tweaking it a bit to make chruby work as well
[16:27:03] ElFerna: has joined #RubyOnRails
[16:27:11] Demerzel: the sourcing of .bashrc is a function of bash so probably not related to chruby
[16:27:17] Demerzel: unless capistrano-chruby does something weird
[16:28:14] vedu: Demerzel: I think rvm changes the scripts as needed. It is loaded everytime. chruby doesn't touch the scripts and leaves it up to us
[16:28:24] rafaelfranca: has joined #RubyOnRails
[16:30:04] vedu: Hello. I am trying to do a CROS request to my rails API but I am getting a parse error. full code and error: https://gist.github.com/vedant1811/fd8b121f29b4387100df
[16:30:13] jahbrewski: has joined #RubyOnRails
[16:33:37] arup_r: has left #RubyOnRails: ()
[16:33:41] drbayer: has joined #RubyOnRails
[16:34:05] msyvich: has joined #RubyOnRails
[16:34:25] reckoner: has joined #RubyOnRails
[16:34:39] reckoner: using Thread.new in production. is this an awful idea?
[16:34:44] reckoner: will it consume resources?
[16:34:54] bronson: has joined #RubyOnRails
[16:35:49] jottr: has joined #RubyOnRails
[16:35:49] pwnd_nsfw: will it blend?
[16:35:58] Ropeney: has joined #RubyOnRails
[16:36:19] pipework: reckoner: u trollin bro?
[16:36:21] pwnd_nsfw: reckoner, Object.new will consume resources even....
[16:36:34] reckoner: always be trolling
[16:36:48] reckoner: but i'm actually kinda serious. i know Rails is "thread safe"
[16:37:07] reckoner: but that's not the whole story right.
[16:37:08] matthewd: reckoner: If you want a considered recommendation, you probably need to describe the problem you're trying to solve
[16:37:09] pipework: reckoner: If you don't fuck up the threading, you can thread, yeah.
[16:37:19] ElFerna: has joined #RubyOnRails
[16:37:40] safetypin: has joined #RubyOnRails
[16:38:25] reckoner: let me put up an example
[16:38:39] hardtail: has joined #RubyOnRails
[16:40:46] safetypin: has joined #RubyOnRails
[16:42:15] lacrymology: has joined #RubyOnRails
[16:42:56] Cervajz: has joined #RubyOnRails
[16:44:56] macsteps: has joined #RubyOnRails
[16:45:03] baweaver: has joined #RubyOnRails
[16:45:51] FLeiXiuS: has joined #RubyOnRails
[16:45:51] FLeiXiuS: has joined #RubyOnRails
[16:46:47] ramfjord: has joined #RubyOnRails
[16:47:38] [Butch]: has joined #RubyOnRails
[16:47:58] User458764: has joined #RubyOnRails
[16:48:44] stannard: has joined #RubyOnRails
[16:48:59] Hans267: has joined #RubyOnRails
[16:49:25] RegulationD: has joined #RubyOnRails
[16:49:41] reckoner: this is the issue i'm looking into. https://github.com/geekq/workflow/issues/149
[16:49:51] reckoner: posted on this github ticket.
[16:50:18] mustmodify: has joined #RubyOnRails
[16:50:42] mustmodify: is it bad form to show a 404 to a user who would not be authorized to view a resource if it were available?
[16:51:17] CornishPasty: Some say that's good security, mustmodify
[16:51:22] Radar: mustmodify: no, GitHub does it.
[16:51:24] Radar: mustmodify: https://github.com/github/github
[16:51:28] Radar: ^ actual repo iirc
[16:51:40] Radar: https://github.com/marketplacer/marketplacer actual actual private repo
[16:52:04] mustmodify: No that's the opposite issue.
[16:52:11] mustmodify: Like that repo probably exists.
[16:52:32] Deck`: has joined #RubyOnRails
[16:52:35] mustmodify: Well I guess that kind of answers that question, though.
[16:52:36] ElFerna: has joined #RubyOnRails
[16:52:43] mustmodify: it also does that for github/invalid
[16:53:41] stannard: has joined #RubyOnRails
[16:54:06] a1fa_: has left #RubyOnRails: ()
[16:54:20] matthewd: reckoner: That sounds like it's just using a thread to swallow an exception :/
[16:54:21] a1fa_: has joined #RubyOnRails
[16:55:02] reckoner: i'm looking into this still and trying to figure out the real issue is
[16:55:04] Macaveli: has joined #RubyOnRails
[16:55:10] reckoner: i fully agree btw
[16:55:11] a1fa: has joined #RubyOnRails
[16:55:34] a1fa: form_for(@model), it works on #edit, but on #new, it submits the form back to #new instead of #create
[16:55:50] Radar: a1fa: !rule0
[16:55:50] helpa: a1fa: Show rather than tell. Explaining your problem with code, stacktraces or errors is always preferred to explaining it with just text. Show us what's happening, rather than telling us. Put the code on https://gist.github.com and then give us the HTTP link to the Gist.
[16:55:57] Radar: a1fa: Show us the controller actions please
[16:55:59] matthewd: reckoner: If you just want to ignore an exception, a `rescue nil` would be more honest
[16:56:54] reckoner: that's true
[16:56:58] a1fa: Radar: def new; @model = Model.new; end
[16:57:12] Radar: a1fa: You have a model literally called model?
[16:57:23] Radar: a1fa: Real code that I could use to reproduce the issue in a new app kthx
[16:57:31] reckoner: alright. i'll post back and update in a bit. hoping more coffee helps solve this problem.
[16:57:47] a1fa: Radar: k
[16:58:25] Spami: has joined #RubyOnRails
[16:58:26] kirillzh: has joined #RubyOnRails
[17:01:24] safety_cut: has joined #RubyOnRails
[17:02:01] corioliss: has joined #RubyOnRails
[17:02:16] a1fa: Radar: found the problem
[17:02:23] Radar: a1fa: what's up?
[17:02:33] a1fa: Radar: im using a span as a button to submit the form
[17:02:44] Radar: a1fa: weird
[17:03:29] a1fa: onclick="$(&#39;#edit_new_blackout&#39;).submit()"
[17:03:38] a1fa: the form is called new_blackout
[17:03:40] Cervajz: has joined #RubyOnRails
[17:04:26] Honeycomb: has joined #RubyOnRails
[17:04:57] Radar: Yeah seems bad.
[17:04:58] a1fa: :onclick => "$('#edit_#{dom_id(@blackout)}').submit()"
[17:05:01] Radar: Why are you doing that?
[17:05:06] a1fa: and here is the code that generates the button
[17:05:09] Radar: Is a submit button too normal for you?
[17:05:15] Radar: i.e. not hipster enough?
[17:05:33] Radar: I know all you cool kids like to huff the latest JS framework
[17:05:36] a1fa: Radar: it was not matching the UI, so i changed it
[17:05:47] stardiviner: has joined #RubyOnRails
[17:05:50] a1fa: for some reason couldnt get css to apply to f.submit
[17:05:52] aep: has joined #RubyOnRails
[17:06:00] Radar: input[type=submit] {
[17:06:06] Demerzel: has joined #RubyOnRails
[17:06:10] Radar: I would recommend trying to use a submit button again
[17:06:29] macsteps: has joined #RubyOnRails
[17:06:31] a1fa: i also put a nice save icon inside the span
[17:07:22] Radar: You can do that with CSS.
[17:07:33] a1fa: it's so cute :X
[17:07:40] Radar: a &:before or whatever it's called
[17:07:44] a1fa: Radar: i did use css, inside of span :X
[17:07:48] rogue_koder: has joined #RubyOnRails
[17:08:12] Demerzel: man i almost miss table-layout days
[17:08:25] Demerzel: i could understand that
[17:08:31] ElFerna: has joined #RubyOnRails
[17:08:34] Radar: Demerzel: btn btn-primary btn-xlarge btn-metoo
[17:08:53] Demerzel: away, foul creature!
[17:09:00] a1fa: Radar: can you pass that to f.submit, class:?
[17:09:07] a1fa: ACTION googles form_for
[17:09:13] Radar: a1fa: !try
[17:09:13] helpa: a1fa: Why don't you try it and find out for yourself?
[17:09:29] a1fa: i did, i remember i couldnt get it to work
[17:09:42] Demerzel: nice. 7 more characters than "yes" but so much more satisfying
[17:09:47] safetypin: has joined #RubyOnRails
[17:09:49] Radar: f.submit class: 'do-or-do-not-there-is-no-try'
[17:10:06] _3by8: you always were the strongest
[17:10:37] a1fa: Radar: i did that
[17:11:03] Radar: a1fa: and then
[17:12:03] sonofdirt: has joined #RubyOnRails
[17:12:07] a1fa: and it didnt work right
[17:12:42] antgel_: has joined #RubyOnRails
[17:13:32] Pazician: has joined #RubyOnRails
[17:13:40] Demerzel: def submit(value=nil, options={})
[17:14:22] Demerzel: a1fa: try f.submit 'Save', class: 'btn btn-large btn-annoying'
[17:14:40] a1fa: i liked my spans better, it matched the rest of the UI without having to go into CSS and create new btn class that would match the rest of the ui
[17:14:49] a1fa: since the person before me used <spans> for all his buttons
[17:14:55] a1fa: Demerzel: that works
[17:14:57] Yeomra: has joined #RubyOnRails
[17:15:20] Demerzel: irc needs emoji support
[17:15:43] Radar: a1fa: but then you have JS crap littered throughout your codebase if you go with spans
[17:15:52] Demerzel: does that show up?
[17:16:27] Demerzel: I see your :+1: as just text Radar
[17:16:40] Radar: Demerzel: S??.
[17:16:55] Demerzel: do you see my emoji?
[17:17:05] Demerzel: it might only be visible on macs
[17:17:36] redasus: has joined #RubyOnRails
[17:17:38] hobodave: has joined #RubyOnRails
[17:17:38] Radar: Mac masterrace.
[17:17:54] Demerzel: you know it
[17:18:14] a1fa: https://gist.github.com/anonymous/aee41b3cc4d327c3d7b5
[17:18:41] Radar: Mother of god.
[17:18:51] Radar: You can totally do that with CSS.
[17:19:01] jottr: has joined #RubyOnRails
[17:20:06] Cervajz: has joined #RubyOnRails
[17:20:17] DonOtreply: has joined #RubyOnRails
[17:22:33] arup_r: has joined #RubyOnRails
[17:24:25] MrPunkin: has joined #RubyOnRails
[17:24:54] a1fa: Radar: fiiiineeee :) i'll spend a few minutes and work on the css
[17:25:04] a1fa: Radar: i took the lazy way out, and it ended up breaking
[17:25:16] Radar: that's usually the way
[17:25:43] MrPunkin: Is there an easy way I can pass a variable through from an ActionMailer method to be available in the message object of a mail interceptor???s delivering_email method? I know I can attach an email header, but any other way to simply set a @ignore_blacklist variable or something?
[17:26:13] a1fa: Radar: i learn the hardway
[17:26:21] Radar: a1fa: We all do.
[17:26:29] a1fa: so far, the worst thing is, learning rails from somebody elses bad code
[17:26:37] a1fa: it just makes you even worse at it
[17:26:48] mustmodify: OMG When I try to test sending an unescaped ampersand my test suite cleans it up for me!!!!!! ARGHHHH!!!!!
[17:27:04] a1fa: so far, i rewrote 300 lines of code i wrote 6 months ago
[17:27:15] a1fa: shaking my head.. "why int he hell did i do it this way"
[17:28:37] shmilan: has joined #RubyOnRails
[17:31:12] sleungcy: has joined #RubyOnRails
[17:34:03] PedramT: has joined #RubyOnRails
[17:34:55] shmilan: has joined #RubyOnRails
[17:35:34] kirillzh: has joined #RubyOnRails
[17:36:48] Ropeney: has joined #RubyOnRails
[17:40:46] Demerzel: *shudder* just saw the onclick
[17:41:26] mhoungbo: has joined #RubyOnRails
[17:41:48] Demerzel: There's also button_tag type: :submit i think that's recognized by browsers as a submit button but allows pretty pictures inside the button
[17:44:01] SwiftFox: has joined #RubyOnRails
[17:44:12] rubyonrailed: has joined #RubyOnRails
[17:44:38] fwaokda: If I do, "workout.measurables.build(measurable_type_id: type.id, workout_id: workout.id)" the build method doesn't add an id and save, but how can I still access those for my form prior to saving?
[17:45:11] a1fa: Demerzel: i'll try that too :P
[17:47:05] tbuehlmann: fwaokda, I don't understand. is the problem that calling #build doesn't save the new measurable?
[17:47:32] Deck`: has joined #RubyOnRails
[17:48:36] fwaokda: tbuehlmann, kind of.. I don't want to save it yet, I'm just trying to pre-populate attributes for the record(s) for the form I'm building.
[17:49:29] tbuehlmann: I still don't understand. what are you expecting and what do you get?
[17:51:54] KensoDev: has joined #RubyOnRails
[17:52:10] kies^: has joined #RubyOnRails
[17:52:25] fwaokda: tbuehlmann, So I have a Workout object and the object has a "has_many" association with my Measurable object. Currently the workout.measurables = nil. I want to build a form for the user where they can fill out several measurable values for the different kinds to associated with the workout. Since a measurable can be one of many different types (ex: "height", "weight" etc) I don't want the form to have all the different kinds
[17:52:25] fwaokda: just ones ive selected
[17:52:27] arup_r: fwaokda: those are accessor methods for your object, and assign values to them with build. That is why you have access..
[17:52:39] arup_r: and all those are in memory value
[17:53:13] mustmodify: if I want to handle a REXML parse error, which happens in ActiveSupport, am I correct in thinking I can't do rescue_from... that I need to add to add rack middleware?
[17:53:28] rakm: has joined #RubyOnRails
[17:53:57] fwaokda: tbuehlmann, i can't currently use "workout.measurables.build(...)" because I have a constraint for my "value" on measurable that it can't be null. But there's not value to put there as the person hasn't filled out the form yet
[17:54:43] fwaokda: excuse my last statement. I meant "workout.measurables.create(...)", "workout.measurables.build(...)" will not work because those records aren't saved...
[17:55:02] tbuehlmann: so you want to populate the form, why isn't #build working for your then?
[17:58:14] fwaokda: oops I think it is now that I've looked at something else. Originally I didn't think it was because workout.measurables.count return zero. but i think that's because the records haven't been saved yet right?
[17:58:25] dm_24: has joined #RubyOnRails
[18:00:05] crystal77: has joined #RubyOnRails
[18:00:08] sleungcy: has joined #RubyOnRails
[18:00:09] dm_24: is there a built in way with devise/omniauth to clear permissions set at the provider on account deletion? Like if a person signs up with google, and allows access to sheets/drive... When they delete their account is there a way my site can tell google revoke the drive/sheets access, without the user having to go to the google app permissions page and manually removing them
[18:00:16] tbuehlmann: #count will return the number of objects in your database. #size will return that number plus not-saved in-memory associations
[18:00:38] pipework: I love reading instance method names like actual hashtags in conversation.
[18:00:42] ElFerna: has joined #RubyOnRails
[18:00:43] tbuehlmann: so when you have a fresh object and build two associated objects, you get a size of 2
[18:01:04] fwaokda: ok thanks! sorry for the confusion and ignorance
[18:02:02] tbuehlmann: good we sorted that out :)
[18:02:33] djbkd: has joined #RubyOnRails
[18:04:17] Pazician: has joined #RubyOnRails
[18:04:39] Devalo: has joined #RubyOnRails
[18:05:20] jottr: has joined #RubyOnRails
[18:05:33] vedu: I am getting a Parse Error while trying to handle a pre-flighted CROS request. https://gist.github.com/vedant1811/fd8b121f29b4387100df
[18:05:35] podman: has joined #RubyOnRails
[18:05:51] kirillzh: has joined #RubyOnRails
[18:05:51] vedu: The OPTIONS part of the request goes fine but then POST one fails
[18:05:59] vedu: Any ideas?
[18:06:34] PedramT: has joined #RubyOnRails
[18:07:46] maxz: has joined #RubyOnRails
[18:08:01] EdwardIII: hrm, when using simple_form_form, how the heck do you get options into a collection?
[18:08:39] EdwardIII: it says you can say 'collection: 1..100', but what if you want to say collection: ['Mr', 'Mrs']?
[18:09:35] kirillzh: has joined #RubyOnRails
[18:10:02] kirillzh: has joined #RubyOnRails
[18:10:18] aarkerio: has joined #RubyOnRails
[18:10:39] worknick: has joined #RubyOnRails
[18:11:13] EdwardIII: eh, seems to work if i pass it as a method instead. that'll do
[18:11:14] tubbo: EdwardIII: you could do that
[18:11:31] worknick: i am using devise and i created a custom user_controller. added custom methods and then their route as resources :users, :only => [:show,:addfriend,:removefriend], but in my rake routes only user#show is listed. not the others.
[18:11:44] reckoner: has left #RubyOnRails: ()
[18:11:44] shmilan: has joined #RubyOnRails
[18:11:54] tubbo: EdwardIII: if you type (1..100).to_a in irb you'll see it can resolve to an array
[18:12:27] Oliphaunte: has joined #RubyOnRails
[18:12:28] aep: has joined #RubyOnRails
[18:12:39] tubbo: worknick: the :only/:except options on `resources` are only meant for the routes that the resources block gives you by default.
[18:12:40] EdwardIII: tubbo: what the heck, i thought i got a syntax error when i tried that. must've had some other gibberish in there
[18:13:12] tubbo: worknick: so if you want to add more routes, first you have to choose if theyre a 'member' or 'collection' route, then add them accordingly like e.g. member { post :add_friend } (matching your action name of course)
[18:13:16] tubbo: worknick: !routing for more
[18:13:16] helpa: worknick: http://guides.rubyonrails.org/routing.html - Rails Routing From the Outside In - Rails Guide - by Mike Gunderloy
[18:14:16] worknick: added as member.
[18:14:38] PedramT: has joined #RubyOnRails
[18:15:06] tubbo: worknick: though, restfully, you might want to consider nested resources
[18:15:22] tubbo: so that POST /users/1/friends adds a friend, and DELETE /users/1/friends/1 removes one
[18:16:08] mustmodify: has left #RubyOnRails: ()
[18:16:47] worknick: tubbo: ok. will fix it later.
[18:17:21] szulak_: has joined #RubyOnRails
[18:20:11] RegulationD: has joined #RubyOnRails
[18:20:48] diegoviola: has joined #RubyOnRails
[18:20:48] roshanavand: has joined #RubyOnRails
[18:21:57] polishdub: has joined #RubyOnRails
[18:22:10] shmilan: has joined #RubyOnRails
[18:22:46] ramfjord: has joined #RubyOnRails
[18:23:32] smathy: has joined #RubyOnRails
[18:24:17] DonOtreply: has joined #RubyOnRails
[18:25:33] tetraktys: has joined #RubyOnRails
[18:26:57] neshmi_: has joined #RubyOnRails
[18:26:59] sandstrom: has joined #RubyOnRails
[18:27:34] PedramT: has joined #RubyOnRails
[18:27:46] Cervajz: has joined #RubyOnRails
[18:28:04] chouhoulis: has joined #RubyOnRails
[18:28:37] Aherin: has joined #RubyOnRails
[18:29:32] shmilan: has joined #RubyOnRails
[18:30:22] neshmi: has joined #RubyOnRails
[18:32:32] nfk: has joined #RubyOnRails
[18:35:13] PedramT_: has joined #RubyOnRails
[18:36:05] shmilan: has joined #RubyOnRails
[18:37:09] hobodave: has joined #RubyOnRails
[18:38:02] n00bDev: has joined #RubyOnRails
[18:41:07] Timberwo|f: has joined #RubyOnRails
[18:42:22] tetraktys: has joined #RubyOnRails
[18:42:22] Coldblackice: has joined #RubyOnRails
[18:42:39] bronson: has joined #RubyOnRails
[18:42:49] celly: has joined #RubyOnRails
[18:44:07] shmilan: has joined #RubyOnRails
[18:44:48] flashpoint9: has joined #RubyOnRails
[18:46:58] guacamol1: has joined #RubyOnRails
[18:48:10] baweaver: has joined #RubyOnRails
[18:49:27] safety_cut: has joined #RubyOnRails
[18:50:06] macsteps: has joined #RubyOnRails
[18:50:59] arBmind: has joined #RubyOnRails
[18:52:32] kr1shnak: has joined #RubyOnRails
[18:56:28] KensoDev: has joined #RubyOnRails
[18:58:56] KensoDev: has joined #RubyOnRails
[18:59:45] TravisTheNavi: has joined #RubyOnRails
[19:00:22] emachnic: has joined #RubyOnRails
[19:02:15] hobodave_: has joined #RubyOnRails
[19:06:03] sbarg: has joined #RubyOnRails
[19:06:20] sbarg: has left #RubyOnRails: ()
[19:10:18] nerium: has joined #RubyOnRails
[19:13:13] baweaver: has joined #RubyOnRails
[19:13:49] cobragoat: has joined #RubyOnRails
[19:14:06] rubyonrailed: Why am I getting this error "he action 'commands' could not be found for DashboardController" for my commands path, but not my sign_in path? https://gist.github.com/JasonMannon/0e6d92920df0bff539d0
[19:15:20] fryguy: rubyonrailed: where is the commands action defined?
[19:16:37] rubyonrailed: fryguy: NVM, my template was spelled incorrectly :0
[19:16:41] szulak_: has left #RubyOnRails: ("Leaving")
[19:17:05] ivan1325: has joined #RubyOnRails
[19:17:09] jgt4: has joined #RubyOnRails
[19:20:08] theunraveler: has joined #RubyOnRails
[19:20:23] mickey_mouse_2: has joined #RubyOnRails
[19:22:34] peeja: has joined #RubyOnRails
[19:25:52] n00bDev: has joined #RubyOnRails
[19:25:56] DmitryBochkarev: has joined #RubyOnRails
[19:27:44] powersurge: has joined #RubyOnRails
[19:28:06] shmilan: has joined #RubyOnRails
[19:28:47] blackmesa: has joined #RubyOnRails
[19:29:16] drbayer: has joined #RubyOnRails
[19:31:18] fedexo: has joined #RubyOnRails
[19:32:45] stannard: has joined #RubyOnRails
[19:33:55] emachnic: has joined #RubyOnRails
[19:35:41] webdestroya: has joined #RubyOnRails
[19:37:30] treehug88: has joined #RubyOnRails
[19:37:52] kirillzh: has joined #RubyOnRails
[19:39:02] arup_r: has joined #RubyOnRails
[19:39:09] mhoungbo: has joined #RubyOnRails
[19:39:14] draig: has joined #RubyOnRails
[19:39:42] Guest8906: has joined #RubyOnRails
[19:39:59] srinidhi: has joined #RubyOnRails
[19:42:17] robbyoconnor: has joined #RubyOnRails
[19:43:28] rafaelfranca: has joined #RubyOnRails
[19:49:14] Rodya_: has joined #RubyOnRails
[19:49:23] flappynerd: has joined #RubyOnRails
[19:50:11] griffindy: has joined #RubyOnRails
[19:51:21] Conflict: has joined #RubyOnRails
[19:51:31] ss_much: has joined #RubyOnRails
[19:52:50] kr1shnak: Hi. I am kinda stumped about a model/routing issue. I have a User model (from Devise), where users can have a role of either a manager or an employee. I have created a new Employees scaffold controller, which I want to use to handle the employees of a particular manager. In my routes.rb file I have added: 'resources :employees'. I am now getting error messages in my view on the url_helper calls. The url_helpers in the view
[19:52:50] kr1shnak: are methods like: edit_client_path(client), but the actual class of the client object will be User. Is there a way to specify that the client url_helper methods can take a User object? Or am I just going about this the wrong way?
[19:53:11] Conflict: rails new testapp
[19:53:11] Conflict: /usr/lib/ruby/2.3.0/rubygems/dependency.rb:319:in `to_specs': Could not find 'activesupport' (= 4.2.5) - did find: [activesupport-] (Gem::LoadError)
[19:53:18] Conflict: anyone know why this is happening?
[19:53:59] ariedler: has joined #RubyOnRails
[19:54:16] Deck`: has joined #RubyOnRails
[19:54:17] stannard: has joined #RubyOnRails
[19:55:05] danielpicard: has joined #RubyOnRails
[19:55:13] rhizome: has joined #RubyOnRails
[19:55:54] chouhoul_: has joined #RubyOnRails
[19:56:02] ariedler: occasionally I am seeing this odd error in production where the HTTP Headers are included in the RAW_POST_DATA using
[19:56:16] ariedler: I should also note the room topic is out of data for latest releases :)
[19:59:36] arup_r: kr1shnak: what is the actual error can you show in a gist, with the rake routes output and the view
[19:59:56] kr1shnak: sure, hang on
[20:00:06] shmilan: has joined #RubyOnRails
[20:02:38] rubyonrailed: Is this spot ok to put my google analytics script? Or should I make a JS file for it? https://gist.github.com/JasonMannon/47f66e6f0f4aa21232ca
[20:02:53] drbayer: has joined #RubyOnRails
[20:05:13] shmilan: has joined #RubyOnRails
[20:05:16] emachnic: has joined #RubyOnRails
[20:05:47] rrawlins: has joined #RubyOnRails
[20:06:19] danielpicard: hey folks, I was hoping someone could lead me in the right direction for a rails app I'm learning to build. I would put something on stackoverflow but I don't even know how to ask the question correctly and I'm sure I'd get skewered there.
[20:06:59] kirillzh: Would you guys recommend Swagger or API blueprint for Rails 5 API?
[20:07:30] celly: has joined #RubyOnRails
[20:08:39] Conflict: jesus why is rails always such a pain to install...
[20:08:56] ariedler: Conflict: care to give details
[20:10:17] Conflict: i was getting this when trying to do a "rails new testapp"
[20:10:23] ramfjord: has joined #RubyOnRails
[20:10:28] Conflict: /usr/lib/ruby/2.3.0/rubygems/dependency.rb:319:in `to_specs': Could not find 'activesupport' (= 4.2.5) - did find: [activesupport-] (Gem::LoadError)
[20:10:40] Conflict: but i just did a gem update and now it's working....
[20:11:23] Oliphaunte: has joined #RubyOnRails
[20:11:53] Conflict: but now i'm getting: Your user account isn't allowed to install to the system Rubygems.
[20:11:53] Conflict: You can cancel this installation and run: bundle install --path vendor/bundle
[20:11:53] Conflict: to install the gems into ./vendor/bundle/, or you can enter your password
[20:11:53] Conflict: and install the bundled gems to Rubygems using sudo.
[20:12:06] Conflict: oops, sorry for spam
[20:12:08] Conflict: suggestions?
[20:12:18] ariedler: I assume your a developer ?
[20:12:29] blackmesa: has joined #RubyOnRails
[20:12:42] kr1shnak: arup_r: ok here is the gist - https://gist.github.com/Krishna/7fd4007d5a5a2ecf2614
[20:12:49] Conflict: yes, but new to rails
[20:13:18] matthewd: Conflict: That message seems pretty detailed
[20:13:30] ariedler: Conflict: I would recommend using something like rbenv (or rvm, whatever floats your boat) for ruby installations so your gems don't pollute your system namespace
[20:14:26] rrawlins: has joined #RubyOnRails
[20:15:10] Conflict: this is where i'm a little confused because the arch wiki suggested using pacman/AUR to install/maintain ruby gems and rails itself
[20:16:11] matthewd: Well, I'm normally a great defender of OS packaging mechanisms
[20:16:21] macsteps: has joined #RubyOnRails
[20:16:27] f3ttX]: has joined #RubyOnRails
[20:16:53] matthewd: But if you're going to do that, "jesus why is rails always such a pain to install..." should probably be directed to the relevant packagers
[20:17:17] crystal77: has joined #RubyOnRails
[20:17:53] kr1shnak: arup_r - updated the gist with the offending controller and action code
[20:17:57] ariedler: Conflict: alternatively do the later of 'bundle install --path vendor/bundle' if you don't want to got the rbenv or rvm route
[20:18:08] arup_r: kr1shnak: checking
[20:18:09] konsolebox: has joined #RubyOnRails
[20:18:35] Conflict: well, rails install went off without a hitch, the problem was in executing 'rails new' and it not liking a gem
[20:18:56] momomomomo: has joined #RubyOnRails
[20:20:58] FernandoBasso: has joined #RubyOnRails
[20:21:00] emachnic: has joined #RubyOnRails
[20:22:14] duncannz: has joined #RubyOnRails
[20:23:02] arup_r: kr1shnak: Your issue is, <td><%= link_to 'Show', employee %></td>. You asked Rails to do find the path for you, and it does by checking the what class's of object it. rather mention explicitly like: <td><%= link_to 'Show', employee_path(employee) %></td>
[20:23:45] kr1shnak: and will employee_path be ok if I pass it in a User object?
[20:24:14] smathy: kr1shnak, will `Employee.find(that_user.id)` work?
[20:24:21] baweaver: has joined #RubyOnRails
[20:24:34] kr1shnak: smathy: no, there isnt an Employee class
[20:24:53] kr1shnak: I was trying to avoid inheritance and just use roles assigned to a single User class
[20:24:58] yfeldblum: has joined #RubyOnRails
[20:25:09] Conflict: can i leave my current system install of ruby alone and install rvm and it will intelligently manage the gems and which version of ruby it should use?
[20:25:21] arup_r: smathy: his table is `User`
[20:25:35] smathy: kr1shnak, oh sorry, arup_r was already guiding you. I was scrolled back.
[20:25:40] arup_r: and he has a role in the same table set for employee and manager that's it
[20:26:07] arup_r: kr1shnak: did you get what I said? Otherwise ask me back.
[20:26:08] kr1shnak: arup_r: that worked, although I now have an issued with the destroy path
[20:26:11] matthewd: Conflict: If you're working with system packages for gems, you probably shouldn't be doing a bundle install at all (which rails new does by default)
[20:26:18] smathy: Conflict, for varying definitions of "intelligently" - yes.
[20:26:26] kr1shnak: link_to 'Destroy', client, method: :delete, data: { confirm: 'Are you sure?' }
[20:26:50] arup_r: kr1shnak: If you understood my first explanation, you should fix it by yourself
[20:26:59] kr1shnak: cool ok, let me give it a try
[20:27:04] kr1shnak: thanks for your help!
[20:27:22] ur5us: has joined #RubyOnRails
[20:27:28] arup_r: kr1shnak: don't copy paste, first understand and then go ahead. :)
[20:27:35] pipework: ariedler: I thought it used url_for
[20:28:13] ariedler: Conflict: although its recommended not to have both installs, rbenv will do that; I am not sure about rvm
[20:28:25] chipotle: has joined #RubyOnRails
[20:28:29] arup_r: pipework: he using a user object, and he has no route for it, rather employee route.. which is the problem
[20:28:40] flappynerd: how should I structure my REST routes?
[20:28:55] arup_r: kr1shnak: you can use your old style, but then change the route resources: :users
[20:29:39] kr1shnak: hmm. Ideally in the end I want two resources (or at least two controllers): one for employees and one for managers
[20:29:44] pipework: arup_r: Will the object not reliably be an employee? Can't they just `user.becomes(Employee)` or something?
[20:29:49] kr1shnak: with the underlying model ending up being User
[20:29:53] pipework: Or just employee_path or whatever.
[20:29:58] kr1shnak: is that a bad idea?
[20:30:12] rhizome: why do you want separate controllers?
[20:30:40] arup_r: pipework: becomes works if you have STI, I don't think his set up like that. Let me double check
[20:30:47] kr1shnak: I dont have STI
[20:30:53] arup_r: pipework: he has to mention it explicitly
[20:31:08] fox_mulder_cp: how to use enum in rails g scaffold? im man i can't see this type
[20:31:13] arup_r: or need to change the route name, if want rails to do it automatically
[20:31:21] pipework: arup_r: You might be able to just use a class, actually.
[20:31:22] rhizome: fox_mulder_cp: i don't think you do
[20:31:23] kr1shnak: rhizome: so that a manager can 'manage' his employees via the employees controller
[20:31:24] pipework: Like an activemodel class.
[20:31:28] pipework: But not an STI one.
[20:31:40] rafaelfranca: has joined #RubyOnRails
[20:31:41] kr1shnak: rhizome: and an admin can manage all the managers
[20:31:47] rhizome: kr1shnak: what's the difference between that and users who can operate on other users if they have the right permissions?
[20:31:47] kr1shnak: via a managers controller
[20:32:34] arup_r: kr1shnak: controllers are fine.. it is all about route
[20:33:02] symbol: has joined #RubyOnRails
[20:33:15] arup_r: pipework: http://api.rubyonrails.org/classes/ActiveRecord/Persistence.html#method-i-becomes .. it says about STI helper. But no idea, what you are saying. I used this when I have a STI setup.. never tried what you said.
[20:33:24] DonOtreply: has joined #RubyOnRails
[20:33:29] fox_mulder_cp: hm. enum - list, list can't scaffolded too ((
[20:33:33] kr1shnak: rhizome: I guess there is no difference, I just thought it was a nice way to structure the app. To have two explicitly different controllers for each specific use case
[20:33:53] rrawlins_: has joined #RubyOnRails
[20:34:00] pipework: arup_r: I'm not sure, I'd have to try it. It may be bogus.
[20:34:09] arup_r: same here.. :)
[20:34:53] Rodya_: has joined #RubyOnRails
[20:35:00] rhizome: kr1shnak: sure, i understand that, and at any rate you're going to be doing the same checks no matter what, so it might just be a question of organization
[20:35:33] Spami: has joined #RubyOnRails
[20:36:32] atmosx: has joined #RubyOnRails
[20:39:01] njero: has joined #RubyOnRails
[20:40:56] kr1shnak: ok I might be doing something super hacky now. I created a new class for Client: class Client < User end. And for the Destroy link in the view I did: link_to 'Destroy', client.becomes(Client)
[20:41:24] maxz: has joined #RubyOnRails
[20:41:40] smathy: danielpicard, so you don't know Rails yet?
[20:41:42] kr1shnak: this is a test project where Client is the equivalent of Employee
[20:42:14] seaworthy: has joined #RubyOnRails
[20:43:35] danielpicard: @smathy, barely, but I know it better than this damn LimeChat
[20:44:26] dionysus69: has joined #RubyOnRails
[20:45:14] smathy: danielpicard, so I'd recommend to start with a tutorial like Agile Web Development with Rails or Rails 4 in Action.
[20:45:25] mag42c: has joined #RubyOnRails
[20:46:26] danman: has joined #RubyOnRails
[20:47:15] kr1shnak: I'd go with Agile Web Dev with Rails, if you are new to Rails
[20:47:42] danielpicard: I've gone through the bulk of a rails udemy course and followed along and built the apps as shown. I've started a simple project integrating what I've learned, and now I'm stuck
[20:48:20] danielpicard: I'd ask on stackoverflow but I don't know exactly what I'm asking for
[20:48:33] smathy: danielpicard, ok, I don't know that course, so I'm assuming it's decent, so what are you stuck on?
[20:48:48] slash_join: Anyone know whether rails provides instrumentation for active record connecting/disconnecting to/from a database?
[20:48:48] benlieb: has joined #RubyOnRails
[20:49:02] andchar: has joined #RubyOnRails
[20:49:09] shmilan: has joined #RubyOnRails
[20:49:23] Conflict: will 'bundle install --path vendor/bundle' install gems into the current project?
[20:50:29] momomomomo: has joined #RubyOnRails
[20:50:36] jonathanwallace1: has joined #RubyOnRails
[20:51:35] danielpicard: Smathy, I've got Users (Devise took care of this) and organizations. You log in, create an org, it is associated to the user that created it.
[20:51:49] rhizome: Conflict: i think the idea with vendor is that you don't have to
[20:51:50] danielpicard: I want to create agendas that are associated to the organization
[20:52:53] danielpicard: I've got the org class and agenda class, but I have no idea how to associate the agenda to the organization. Kind of like I want the user to log in to the organization and then create the agenda, but I might be way off base here.
[20:53:20] danielpicard: I'm good with research, I just need a step in the right direction.
[20:53:23] rhizome: how did you associate users with orgs?
[20:53:23] nettoweb: has joined #RubyOnRails
[20:53:26] emachnic: has joined #RubyOnRails
[20:53:40] Conflict: rhizome: i'm confused that if i enter my password and install the bundled gems to Rubygems using sudo is bad or not?
[20:53:57] Rodya_: has joined #RubyOnRails
[20:53:59] danielpicard: orgs belong to users; users have many orgs
[20:54:32] rhizome: danielpicard: what would you think is a good way to translate that to orgs-agendas?
[20:54:46] matthewd: slash_join: I don't think so
[20:54:49] Sheperson: has joined #RubyOnRails
[20:54:57] theunraveler: has joined #RubyOnRails
[20:55:08] slash_join: matthewd: thank you :)
[20:55:36] benlieb: How do I setup @request.ev in an rspec before(:suite) (in rails_helper.rb)?
[20:55:43] benlieb: Trying to do this: @request.env["devise.mapping"] = Devise.mappings[:user]
[20:55:49] benlieb: but @request is not defined
[20:56:00] Sheperson: I am trying to override a method
[20:56:04] benlieb: I basically don't want to have to set the mapping in every spec
[20:56:30] kirillzh: has joined #RubyOnRails
[20:56:47] danielpicard: rhizome: I've got the org and agenda association in the models, but I don't know how to attach the org_id to the agenda when I create the agenda
[20:57:14] smathy: danielpicard, !associations
[20:57:14] helpa: danielpicard: http://guides.rubyonrails.org/association_basics.html - Active Record Association Basics by Mike Gunderloy
[20:57:18] chrisarcand: benlieb: I would venture to guess that's because it's only associated with :controller metadata being loaded. Try scoping it to specs with only that tag set.
[20:57:35] Sheperson: I have this: https://gist.github.com/anonymous/3cfecffbeed865a153aa
[20:57:43] rhizome: benlieb: what kind of test?
[20:57:56] Sheperson: I am trying to pass a new argument to super
[20:57:56] benlieb: rhizome: controller
[20:58:04] Sheperson: but it does not work
[20:58:29] benlieb: I tried to put it in config.before(:suite)
[20:58:37] benlieb: I'm not sure you can scope that
[20:58:58] rhizome: no idea about rspec
[20:59:14] blackmesa: has joined #RubyOnRails
[20:59:22] chrisarcand: benlieb: Actually wait, I know. Instance variables are not supported in before(:suite). You can't do that as you have it.
[20:59:22] danielpicard: I used current_user to attach the user_id to organization, but there isn't something comparable for attaching org_id to agenda...
[20:59:24] rhizome: sheperson: what is the "it" in that sentence?
[20:59:41] Sheperson: super is called with the old args
[20:59:55] badoo: has joined #RubyOnRails
[21:00:08] Sheperson: the item that I push into args has no effect on calling super
[21:00:25] benlieb: chrisarcand: I had a similar problem if I recall trying to set the locale globally. Ended up passing it in EVERY get/post etc.
[21:00:33] rhizome: sheperson: what "effect" are you looking for?
[21:00:45] Sheperson: I am expecting locale to be set in get
[21:01:07] Sheperson: *to be passed to get
[21:01:07] Sheperson: but it does not
[21:01:16] aep: has joined #RubyOnRails
[21:01:21] rhizome: so if you `puts args` in that get method, you don't see anything about the locale you just added?
[21:01:45] rhizome: that is, is it really not there, or are you putting it in the wrong place
[21:02:02] mhoungbo: has joined #RubyOnRails
[21:02:05] Sheperson: it is there
[21:02:10] rhizome: even so, i have to think there's a better way to add a default locale
[21:02:20] fedexo: has joined #RubyOnRails
[21:02:26] tvw: has joined #RubyOnRails
[21:02:28] Sheperson: can you please explain more?
[21:02:31] Sheperson: about adding a default locale
[21:02:32] chrisarcand: benlieb: I think you can do what you want with Filters => https://www.relishapp.com/rspec/rspec-core/docs/hooks/filters
[21:02:46] rhizome: well, a default locale would be defined as a locale that you are forcing on the user
[21:03:05] rhizome: such as it appears you are doing here
[21:03:10] chrisarcand: Just do the same thing, scoped only to controllers. That's more proper even if before(:suite) worked.
[21:03:29] craysiii: has joined #RubyOnRails
[21:03:38] jottr: has joined #RubyOnRails
[21:03:40] shmilan: has joined #RubyOnRails
[21:04:17] rhizome: i don't know how to respond to that
[21:04:40] benlieb: chrisarcand: ahhh, the :example worked!
[21:04:52] rhizome: maybe try searching google for "rails default locale"
[21:04:53] benlieb: I was trying with :suite, :all
[21:05:00] benlieb: chrisarcand: thanks!
[21:05:14] Sheperson: I know how to set a default locale
[21:05:14] Sheperson: I have a route
[21:05:22] celly: has joined #RubyOnRails
[21:05:27] Sheperson: which has a locale constraint
[21:05:32] powersurge1: has joined #RubyOnRails
[21:05:33] Sheperson: and in RSpec I am trying to reach that route
[21:05:57] Sheperson: with get :index
[21:05:57] celly: has joined #RubyOnRails
[21:05:59] Sheperson: but the locale does not get passed to that call
[21:06:12] Sheperson: I need to do it manually
[21:06:36] Sheperson: so, I thought, instead if doing it in many places, I set it globally
[21:07:39] blackmesa: has joined #RubyOnRails
[21:09:00] badoo: Hi everyone, I'm having this weird error on my new machine when I try to install gems: Errno::ETIMEDOUT: Connection timed out - connect(2) for "rubygems.global.ssl.fastly.net" port 443 (https://rubygems.org/specs.4.8.gz)
[21:09:18] badoo: but on vagrant everything works fine, any idea ?
[21:10:33] rhizome: sheperson: so is your question really how to get params into that get :index?
[21:11:27] Sheperson: how to pass an extra param into get
[21:11:35] rhizome: does get :index, locale: :en not work?
[21:11:48] drbayer: has joined #RubyOnRails
[21:12:41] Sheperson: I want to set it for all calls to get automatically
[21:13:02] moeabdol1: has joined #RubyOnRails
[21:13:13] rhizome: why not rely on i18n?
[21:13:18] codedmart: has joined #RubyOnRails
[21:13:20] rhizome: how are you setting a default locale?
[21:14:03] kies^: has joined #RubyOnRails
[21:14:51] Sheperson: in application.rb
[21:14:52] griffindy: has joined #RubyOnRails
[21:15:07] Sheperson: config.i18n.default_locale = 'en'
[21:15:10] baweaver: has joined #RubyOnRails
[21:15:48] drbayer_: has joined #RubyOnRails
[21:16:32] emachnic: has joined #RubyOnRails
[21:16:48] Devalo: has joined #RubyOnRails
[21:20:32] jonathanwallace1: has joined #RubyOnRails
[21:25:57] srruby: has joined #RubyOnRails
[21:26:40] rubyonrails295: has joined #RubyOnRails
[21:27:20] rubyonrails174: has joined #RubyOnRails
[21:27:46] srruby: I have user model with has_many :addresses. How do I delete all addresses for a user with address.zip="94901"
[21:28:05] rubyonrails645: has joined #RubyOnRails
[21:28:15] arooni: has joined #RubyOnRails
[21:28:34] rubyonrails645: hello im wondering what is a better service? AWS Elastic Beanstalk or Heroku?
[21:29:37] flappynerd: rubyonrails645, I don't like either of them
[21:29:58] flappynerd: rubyonrails645, also, geez, change your nick to something so I don't have to tab complete 10 times :)
[21:30:13] flappynerd: rubyonrails645, if you have AWS just use EC2
[21:30:42] Arlantir_: has joined #RubyOnRails
[21:30:58] rubyonrails645: what i saw appeal in elastic beanstalk and heroku is that i dont really have to manage anything
[21:31:04] Demerzel: i've tried configuring elastic beanstalk but haven't had much time for it
[21:31:18] qejk: has joined #RubyOnRails
[21:31:26] Demerzel: so i stuck to capistrano + ec2 + rds
[21:31:35] shmilan: has joined #RubyOnRails
[21:31:46] Arlantir_: Show you how to fix the guard (main)> exit E, [2016-02-06T00: 15: 18.732722 # 6153] ERROR -: run () in thread failed: undefined method `callback '! for nil: NilClass: \ n?
[21:31:57] Cohedrin: has joined #RubyOnRails
[21:32:01] flappynerd: rubyonrails645, yeah that's what most people see, what most people don't see is the problems this will cause in the future
[21:32:18] Demerzel: srruby: address.where(zip: '94901').destroy_all
[21:32:31] tbuehlmann: srruby: `user.addresses.where(zip: '94901').destroy_all`
[21:32:34] Demerzel: srruby: addresses.where(zip: '94901').destroy_all <-- this one
[21:32:50] Demerzel: or the one tbuehlmann mentioned
[21:32:53] rubyonrails645: which problems would those be
[21:33:09] jahbrewski: flappynerd: not a fan of Heroku? The platform has greatly improved the past year or so
[21:33:21] flappynerd: jahbrewski, it's also become extremely expensive
[21:33:25] Demerzel: isn't heroku much more expensive?
[21:33:31] flappynerd: and indeed, I'm still not a fan of heroku
[21:33:40] benlieb: has joined #RubyOnRails
[21:33:51] ql6wlld: has joined #RubyOnRails
[21:33:59] jahbrewski: flappynerd: if my clients are paying 30-40k for an app a couple hundred bucks per month isn't breaking their banks :)
[21:34:02] flappynerd: rubyonrails645, I have a laundry list somewhere in the back of my mind, it's all just things you end up not being able to do because heroku doesn't provide something
[21:34:17] flappynerd: I've encountered this dozens of times
[21:34:20] macsteps: has joined #RubyOnRails
[21:34:27] Rodya_: has joined #RubyOnRails
[21:34:43] flappynerd: EC2 means I have (nearly) 100% control and freedom to install and configure my deploy scripts as I see fit and as needed
[21:34:44] Demerzel: jahbrewski: ec2 instances will typically be much more useful than heroku even in that case
[21:34:57] srruby: Thanks guys. Now say that address :has_one :county How do I delete addresses with county = "San Francisco"
[21:35:03] flappynerd: and, effectively the same problem exists on EB
[21:35:06] bronson: has joined #RubyOnRails
[21:35:14] Ropeney: has joined #RubyOnRails
[21:35:19] Demerzel: srruby: address should belong_to :county i'd imagine
[21:35:33] rubyonrails645: flappynerd: ill take a look into ec2. i heard managing to it wont crash is alot of work?
[21:35:45] Demerzel: srruby: in which case, you'd do something like: addresses.where(county: { name: 'San Francisco' }).destroy_all
[21:35:54] jahbrewski: flappynerd: Demerzel fair enough. I like the sane defaults Heroku provies though. Feals very rails-esque
[21:36:17] Demerzel: jahbrewski: agreed - i think heroku is a great start for a project but not a good lifetime investment
[21:36:39] Demerzel: at some point you'll need to move it to ec2 or other hosting
[21:36:49] jahbrewski: Demerzel: certainly. And in fact, we use a combination of aws/heroku/etc.
[21:37:34] jahbrewski: For a basic rails site though, you really can't beat heroku for ease of setup. And time=money
[21:37:47] flappynerd: jhass, well, it *is* very rails esque
[21:37:52] flappynerd: jahbrewski, ^
[21:37:57] Demerzel: the problem is of course that when the transition happens, you'll have to transition heroku config to a more standardized config used on regular machines where nothing is hidden behind magic
[21:38:02] flappynerd: but I have effectively the same complaint about rails itself to a certain extent :P
[21:38:21] jahbrewski: That's something I find developers forget. "But why would I pay for that when I could do X" ...because X takes 10x as long..
[21:38:24] flappynerd: jahbrewski, emphasis on the word "basic"
[21:38:56] flappynerd: jahbrewski, the thing is though that for me it doesn't take 10x as long
[21:39:00] bronson: last two projects I've started on Heroku I wish I hadn't.
[21:39:06] bronson: Sure, you get a site up a few hours faster.
[21:39:16] flappynerd: and often times the reverse is true, battling with heroku to get around something weird they do takes 10x longer than just doing it myself on a VPS
[21:39:21] jahbrewski: bronson: curious why you didn't like it?
[21:39:30] bronson: Hooooly cow, the workarounds required to get around the ephemeral filesystem.
[21:39:39] flappynerd: yeah, workarounds--
[21:39:40] bronson: We were doing PDF generation and that is NOT heroku friendly.
[21:39:42] jahbrewski: bronson: use s3?
[21:39:44] Demerzel: honestly i think this is a case of personal preferences
[21:39:48] rubyonrails645: thoughts on google app engine?
[21:40:00] Demerzel: it's why i do some things the way i do because i've experience pain in most other ways of doing it
[21:40:08] yaroslav: has joined #RubyOnRails
[21:40:10] Demerzel: i think as long as you haven't experienced pain with heroku
[21:40:11] bronson: jahbrewski: sure, but it's even easier to just use a host with a disk.
[21:40:12] Demerzel: more power to you!
[21:41:10] bronson: As long as you don't stray from the Rails Blog scaffold demo, you're good on Heroku.
[21:41:22] benlieb: has joined #RubyOnRails
[21:41:46] jahbrewski: bronson: I've got plently of projects more complex than a scaffold demo on Heroku :)
[21:42:01] bronson: Once you start having long-lived connections, or caching, or interesting gems, ... First step is to move to a real host.
[21:42:02] jgpawletko: has joined #RubyOnRails
[21:42:06] jahbrewski: bronson: But again, Heroku is just a tool. If it doesn't help you, drop it
[21:42:33] rubyonrails645: jahbrewski: thoughts on google app engine?
[21:42:33] bronson: agree with that. Catch is, once you code Heroku workarounds into your app, it gets harder to drop.
[21:42:34] jahbrewski: One of the reasons *I* use it is because these guys use it: thoughtbot.com
[21:42:47] Demerzel: i've not used google app engine
[21:42:50] neohunter: has joined #RubyOnRails
[21:42:54] bronson: meh, thoughtbot uses whatever their customer wants.
[21:42:56] jahbrewski: and the folks at thoughtbot know a hell of a lot more than I do
[21:42:58] Demerzel: thoughtbot is pretty rad
[21:43:24] neohunter: On rails 2.3 (dont hate me) i'm doing render :update {|page| page << "some javascript" } what i can do to put that code in a file?
[21:43:44] Demerzel: ACTION starts up the hate engine...
[21:43:45] jahbrewski: bronson: Have you checked out their playbook? http://playbook.thoughtbot.com/
[21:43:49] bronson: ACTION wistfully remembers the 2.3 days
[21:44:01] Demerzel: damn it, out of gas
[21:44:19] rubyonrails645: so seems like everyone here is riding on with EC2
[21:44:23] jahbrewski: lots of great stuff in there
[21:44:34] emachnic: has joined #RubyOnRails
[21:45:39] yaroslav: heroku actually can get you pretty far these days with custom buildpacks and a ton of addons
[21:45:46] yaroslav: nothing like when they've started
[21:46:21] yaroslav: and following 12factor ideas is a good idea anyway for a modern webapp
[21:46:28] bronson: jahbrewski: yep, I like that guide. but it's assuming that you have a bog-standard Rails app.
[21:46:34] noeden: has joined #RubyOnRails
[21:47:04] theunraveler: has joined #RubyOnRails
[21:47:45] kies^: has joined #RubyOnRails
[21:47:55] bronson: neohunter: I don't understand the question... put the code in a .rb file and require it?
[21:48:59] bronson: I think the answer is: start wherever you feel like. Heroku is fine. But make sure to switch to a less custom hosting platform before writing any workarounds into your app.
[21:49:34] jahbrewski: bronson: as soon as Heroku becomes a hindrance and not a time saver, drop it
[21:50:14] jahbrewski: which is a good rule of thumb to live by as a developer. At a certain point Rails itself becomes more of a hindrance than a helper..
[21:51:05] moeabdol: has joined #RubyOnRails
[21:51:23] NBarnes: What do you switch to when Rails is holding you back?
[21:52:22] jahbrewski: nbarnes: Depends on what about it is holding you back
[21:52:45] bronson: nbarnes: whatever is the trendiest. Elixir is pretty hot these days. Or Go.
[21:53:17] NBarnes: 'trendy and sexy' is hard to resist in terms of technology selection, but I've come to distrust them as heuristics.
[21:53:34] NBarnes: (I'm looking at you here, Angular)
[21:53:35] jahbrewski: nbarnes: I think bronson is joking, right?
[21:54:01] jahbrewski: nbarnes: Oh yeah. I'm a huge fan of tried and true.
[21:54:24] bronson: ACTION does a twitter search and chooses the platform whose commenters have the prettiest profile pics
[21:54:31] NBarnes: I know, I'm trying to be joking back.
[21:54:44] noeden: hi there, I am new to rails. I want to have an ordered has_many association
[21:54:47] thorgi: has joined #RubyOnRails
[21:54:53] noeden: Is there a build in solution?
[21:55:12] rubyonrails645: why would Aws beanstalk be bad if its just a automated deployment of ec2?
[21:55:21] bronson: noeden: yep, I'm guessing you didn't google 'has_many order' ?
[21:55:37] Oliphaunte: has joined #RubyOnRails
[21:55:40] noeden: I did. I added a property to the related object named position
[21:55:50] NBarnes: I choose new dev technologies based upon number of namechecks in my Twitter feed.
[21:56:03] noeden: but I don't know how to set the position property in the association setter
[21:56:03] NBarnes: Right now I'm teaching myself functional programming and Elm.
[21:56:18] bronson: noeden: hm, not following. can you gist it?
[21:56:30] jahbrewski: rubyonrails645: I don't have much experience with beanstalk.. I tried it a while back and the interface just seemed rough/bad
[21:56:34] Demerzel: bronson: so which platform as the prettiest profile pics?
[21:57:15] rubyonrails645: jahbrewski: understand. it is pretty rough and confusing.
[21:57:16] bronson: ha, you called my bluff. I don't know but now I'm curious.
[21:57:58] jahbrewski: rubyonrails645: Yeah. It just didn't feel like it was saving me any time.
[21:58:08] noeden: bronson: https://gist.github.com/fvosberg/424b32da64c7947c2128
[21:58:11] rubyonrails645: jahbrewski: what do you currently use?
[21:58:19] noeden: position is null after submission
[21:58:31] cjibo: has joined #RubyOnRails
[21:58:37] jahbrewski: rubyonrails645: Heh. Heroku for most of my rails apps.
[21:58:57] jahbrewski: rubyonrails645: I use amazon too though.
[21:59:03] noeden: how can I set the position in the recipe model while creating the association or adding an instruction to it?
[21:59:06] jahbrewski: rubyonrails645: Cloudfront is great.
[21:59:40] jahbrewski: rubyonrails645: What's your use case? What are you currently using?
[22:00:30] cjibo: has left #RubyOnRails: ()
[22:00:41] rubyonrails645: well i need to deploy a backend api for a iOS app. Im currently on Heroku. but its pretty expensive.
[22:00:44] lexileo: has joined #RubyOnRails
[22:00:45] YourManCJ: has joined #RubyOnRails
[22:01:09] YourManCJ: So what is considered the best resource to learn rails / how did you learn rails?
[22:01:43] noeden: I am new to rails too but the udemy course https://www.udemy.com/pro-rubyonrails is pretty great
[22:01:52] thorgi: hi all - is it possible to have model validation errors repeated for each instance of nested attributes? E.g. in a typical "author has many books and accepts its nested attributes, book belongs to author" scenario, Author.new({"books_attributes"=>{"0"=>{"title"=>{""}}, "1"=>{"title"=>""}}}) with title precence validation will only give me the presence error once in Author.errors
[22:02:00] jahbrewski: rubyonrails645: well, you have to factor in the cost of switching to a new platform. and the time.
[22:02:03] noeden: But I am sure that there are tons of free resources
[22:02:07] thorgi: but I'd like to attribute specific errors to specific instances of the nested form
[22:02:42] rubyonrails645: jahbrewski: well im still developing so its not much that big of a deal for me.
[22:02:43] jahbrewski: rubyonrails645: Take a look at your current hosting expenses, calculate your estimated savings, minus the cost of the switch, and decide if it makes sense
[22:03:08] YourManC1: has joined #RubyOnRails
[22:03:27] rubyonrails645: jahbrewski: can heroku scale if i were to have a lot of app traffic?
[22:03:34] benlieb: has joined #RubyOnRails
[22:03:43] YourManC1: has left #RubyOnRails: ()
[22:03:45] jahbrewski: rubyonrails645: yes.
[22:04:27] jahbrewski: rubyonrails645: And they make it extremely easy. Literally dragging a slider. Granted you'll want to invest some time into performance enhancements once you start scaling.
[22:04:43] lexileo: has joined #RubyOnRails
[22:05:20] jahbrewski: rubyonrails645: Don't prematurely optimize though. Don't worry about scaling until you have to. Scaling is a great problem to have.
[22:05:52] jahbrewski: rhizome: same thing right? :)
[22:05:57] rubyonrails645: jahbrewski: thanks for the tips
[22:06:48] jahbrewski: rubyonrails645: Sure thing. Those are my thoughts. Certainly not applicable for everyone. I run a development shop, so time is literally money for us.
[22:07:08] YourManCJ: has joined #RubyOnRails
[22:07:30] rubyonrails645: jahbrewski: also, if i need to save photos for users i should use something like S3 and then save the URL in my database like Postgres
[22:07:46] jahbrewski: rubyonrails645: That's what we do.
[22:07:53] quazimodo: has joined #RubyOnRails
[22:07:55] YourManCJ: sorry computer went titsup. So what is considered the best *FREE* way to learn rails?
[22:08:01] jahbrewski: rubyonrails645: Paperclip has built in support for s3
[22:08:12] Papierkorb: YourManCJ: Reading the rails guides and just using it
[22:08:41] jahbrewski: YourManCJ: https://www.railstutorial.org/book
[22:08:55] jahbrewski: +1 for reading the guides and just using it though
[22:09:17] YourManCJ: that is what I was looking for. Kinda like reading man pages on linux
[22:09:33] jahbrewski: YourManCJ: Also depends on how you learn best. There are videos everywhere if that's your thing. Books. Blog posts. Etc.
[22:10:28] rubyonrails645: jahbrewski: but if im using an ios applicatoin to upload, wont i just use the aws ios sdk to upload to s3?
[22:10:42] jahbrewski: YourManCJ: Working organically through your own project is probably the best way, once you get some of the fundamentals down.
[22:11:04] YourManCJ: thats the plan. Also is there a
[22:11:15] YourManCJ: "best pratice" for uploading to github
[22:11:24] jahbrewski: YourManCJ: I posted an ad on Craitslist that I was a rails dev (hadn't built an app in my life), took on a client project, and learned on the job
[22:11:28] YourManCJ: as in not leaving passwords security stuff on there
[22:11:49] YourManCJ: that is actually exactly what I am doing :)
[22:11:50] jahbrewski: YourManCJ: Yeah.. don't leave passwords and security stuff on there :)
[22:12:06] djbkd: has joined #RubyOnRails
[22:12:09] jahbrewski: YourManCJ: use ENV vars
[22:12:14] prgmmr: has joined #RubyOnRails
[22:12:32] YourManCJ: is there someting I can just .gitignore, or is there a better way?
[22:12:49] jahbrewski: rubyonrails645: Ah, probably. Yes.
[22:13:19] momomomomo: has joined #RubyOnRails
[22:13:26] B1n4r10: has joined #RubyOnRails
[22:13:31] jahbrewski: rubyonrails645: I've got a few mobile apps that upload to my server first and then s3
[22:14:04] jahbrewski: YourManCJ: you can put anything in .gitignore ...what's your question?
[22:14:08] chadhs: has joined #RubyOnRails
[22:14:22] mentero_: has joined #RubyOnRails
[22:14:55] YourManCJ: was wondering about the security thing, as in storing passwords in a file, gitignoring the file
[22:15:03] YourManCJ: but it looks like ENV vars will work well
[22:15:14] noeden: Can I override the setter of a has_many association?
[22:16:01] jahbrewski: YourManCJ: Yeah, ENV vars work well. I've used Figaro before for managing config vars: https://github.com/laserlemon/figaro
[22:16:11] DonOtreply: has joined #RubyOnRails
[22:17:07] bronson: noeden: your code looks ok to me
[22:17:20] YourManCJ: jahbrewski: I screwed up my last project and accidently threw files containing passwords onto github....My team was not happy
[22:17:21] noeden: but position is nil?
[22:17:42] hobodave: has joined #RubyOnRails
[22:17:48] noeden: I would like to set position in the instructions setter
[22:17:53] jahbrewski: YourManCJ: Yeah.. don't do that.
[22:17:55] bronson: noeden: have you tried from the console?
[22:18:09] noeden: No, with my create form
[22:18:18] jahbrewski: YourManCJ: Do you have a firm understanding of git?
[22:18:25] bpr_admin: has joined #RubyOnRails
[22:18:34] rubyonrails645: jahbrewski: why do you upload to two places?
[22:18:37] bronson: noeden: try on the console and see what happens.
[22:18:44] YourManCJ: After that I went and learned myself pretty good. Still open to learning more though
[22:19:03] jahbrewski: YourManCJ: Truly understanding git is a valuable investment in yourself as a developer
[22:19:09] noeden: What is the propert code to do it by hand? set an array of instructions or add it one by one with <<
[22:19:31] bronson: noeden: something like: r = Recipe.new; r.instructions << Instruction.new(position:4)
[22:19:52] YourManCJ: yep, and that is what I figured out so I went and out and learned as much as I could
[22:19:54] bronson: that way you can watch sql log messages and play with it.
[22:19:56] noeden: I dont want to set the position explicitly
[22:19:59] jahbrewski: jahbrewski: My server essentially acted as a proxy. It handled the upload to s3.
[22:20:12] noeden: I want it to be set by the setter (in the recipe)
[22:20:19] jahbrewski: ha, meant to address that to rubyonrails645
[22:20:50] bpr_admin: I'm having problems, I acidentally ran the command rake db:migrate, and I believe that this application has no database, so now when trying to deploy to AWS EB, I get this error: Could not load database configuration. No such file - ["config/database.yml"]
[22:20:50] noeden: I dont want to handle it outside of the model which is responsible for that (the recipe)
[22:21:49] bpr_admin: what can I do to make this application not look for a "config/database.yml" file?
[22:22:12] jahbrewski: bpr_admin: you've got a rails app with no database?
[22:22:19] bronson: noeden: ah, not sure wheat you want then. set position in before_create maybe? or just order by created_at?
[22:22:19] rubyonrails645: jahbrewski: okay i see. for my app i was thinking of using Heroku/Beanstalk (havent decided) with S3 for file storage, and Postgresql for user data.
[22:22:50] jahbrewski: rubyonrails645: Sounds like a pretty standard stack.
[22:22:58] bpr_admin: I really don't actually know, I'm taking an app that was built for heroku and porting it to AWS EB, I'm a sysadmin and not a dev
[22:23:28] noeden: No, at the end I want, that the recipe always returns the instructions in the same oder I assign them. And when I change the order it should be persistent
[22:23:37] noeden: after handling it on my own.
[22:23:55] safety_cut: has joined #RubyOnRails
[22:24:06] jahbrewski: bpr_admin: I find it hard to believe the app has no database.. no real reason to use Rails if that's the case
[22:24:07] bronson: so order it by position and then by created_at?
[22:24:23] superlou: has joined #RubyOnRails
[22:24:28] jtong_: has joined #RubyOnRails
[22:24:33] jahbrewski: bpr_admin: the
[22:24:59] bronson: or, if you want to set it to something, then do that. Rails won't automatically set it for you.
[22:25:01] bpr_admin: jahbrewski: is there an easy way to find out if I look at the git master code and not what I have changed?
[22:25:37] jahbrewski: bpr_admin: Is there anything in the app/models directory?
[22:25:41] bronson: noeden: still not understanding what you want.
[22:25:49] ur5us: has joined #RubyOnRails
[22:26:04] noeden: bronson, do you understand php?
[22:26:18] stannard: has joined #RubyOnRails
[22:26:25] noeden: https://gist.github.com/fvosberg/b43757a82388674cc635 This is the way I would solve it in php
[22:26:36] jahbrewski: bpr_admin: If so, open one up and see if you see something like "<ActiveRecord::Base" at the top
[22:26:37] noeden: I overwrite setter and adder and set the position there
[22:26:52] noeden: outside of the recipe model I don't have to think about the position
[22:26:52] bpr_admin: jahbrewski: yes, 22 .rb files ... I think we are using mysql for the backend and not sqlite
[22:27:15] noeden: In the getter I return it ordered by position
[22:27:21] noeden: that is what rails do for my
[22:27:24] noeden: that is what rails do for me
[22:27:30] jahbrewski: bpr_admin: That's fine. But you've got your answser. You need to find out what happened to your config/database.yml file
[22:27:47] jahbrewski: bpr_admin: Or create a new one
[22:27:49] noeden: But I would like to know how to override the setter and "adder" for this relation to set there the position
[22:27:58] bronson: noeden: and you don't want to do it in before_create?
[22:28:04] nfk: has joined #RubyOnRails
[22:28:41] bronson: overriding setters is probably doable but I've never done it. Doing it in AR callbacks is more traditional.
[22:28:43] noeden: That would affect it not on update
[22:28:43] bpr_admin: jahbrewski: there isn't one in the master, that is currently in prodction still on heroku
[22:29:12] noeden: so I should do it in hooks?
[22:29:18] noeden: just before persistence?
[22:29:32] bronson: noeden: I wouldn't expect updating a record to reorder it. your app though. :)
[22:29:44] bronson: before_save might work for you
[22:30:29] noeden: Ah bronson, I didn't think about that. That rails only orders at selecting from the database.
[22:30:33] quazimodo: has joined #RubyOnRails
[22:30:35] quazimod1: has joined #RubyOnRails
[22:31:07] noeden: But I have this problem with your solution too, haven't I?
[22:32:46] bpr_admin: jahbrewski: does that make sense to you?
[22:33:59] jahbrewski: bpr_admin: Nope, not really. Never had an app without that file.
[22:34:43] jahbrewski: bpr_admin: Ah. I think I see.
[22:35:35] Oliphaunte: has joined #RubyOnRails
[22:35:36] jahbrewski: Looks like you can either use a config/database.yml file to configure your database, or connect to the database via an environment variable (ENV['DATABASE_URL'])
[22:35:44] barhum2013: has joined #RubyOnRails
[22:35:53] jahbrewski: bpr_admin: Your app is probably set up to use the ENV variable
[22:35:58] YourManCJ: question : If I develop on heroku, how easy is it to migrate to DreamHost?
[22:36:37] bronson: YourManCJ: as long as you don't add any Heroku plugins and don't write any Heroku-specific workarounds, it's easy.
[22:36:37] jahbrewski: bpr_admin: http://edgeguides.rubyonrails.org/configuring.html#configuring-a-database
[22:37:00] bpr_admin: jahbrewski: so, if that's the case, when I ran the rake command did I start telling the application to look for that file? and if so, how do I undo that?
[22:37:20] jahbrewski: bpr_admin: ^^^ read through that guide
[22:37:30] YourManCJ: coolio thanks, making an app for a business and I need to be able to deploy to a server, but not there server for development
[22:37:37] YourManCJ: *their server
[22:38:11] DonOtreply: has joined #RubyOnRails
[22:38:29] macsteps: has joined #RubyOnRails
[22:41:45] yfeldblum: has joined #RubyOnRails
[22:41:48] gavinhughes: has joined #RubyOnRails
[22:45:47] Palsson: has joined #RubyOnRails
[22:46:02] TravisTheNavi: has joined #RubyOnRails
[22:46:40] bpr_admin: jahbrewski: I found this file in the config directoy, database.yml.dist which seems to have db config info in it. not sure how to handle telling the application to look at that file instead
[22:49:07] jahbrewski: bpr_admin: rename it?
[22:49:14] jtong: has joined #RubyOnRails
[22:49:45] rubyonrailed: has joined #RubyOnRails
[22:50:35] TravisTheNavi: has joined #RubyOnRails
[22:51:00] jtong: has joined #RubyOnRails
[22:51:46] shaboobala: has joined #RubyOnRails
[22:52:24] Oliphaunte: has joined #RubyOnRails
[22:52:34] shaboobala: Hey there. If I am offloading things to a background worker, is it still meant to use rails? Or do I pass in all info I need explicitly into the worker?
[22:52:40] pawnbox: has joined #RubyOnRails
[22:52:50] bronson: depends on how you write the worker
[22:53:22] bronson: I think most ActiveJob workers assume the Rails environment is available.
[22:54:33] lost_soul_: Hey everyone. I know this is probably a very high level question, but this has been flying over my head the entire day and nothing I've researched has pointed me to what I'm doing wrong. I'm trying to define a method to list all instances of one object but only return the name attribute http://pastie.org/10710543
[22:55:10] yashinbasement: has joined #RubyOnRails
[22:55:26] yereby: has joined #RubyOnRails
[22:56:03] bronson: lost_soul_: Manufacturer.order('created_at DESC').pluck(:name) ?
[22:56:19] Pazician: has joined #RubyOnRails
[22:57:00] bronson: no idea what you mean by 'all instances of'
[22:57:23] lost_soul_: That, worked perfectly. Thank you bronson. I wasn't aware of pluck. I'm making a note in case I need it again.
[22:57:33] bronson: pluck is super handy
[22:57:48] Demerzel: oh and you can use symbols for that too. Something like Manufacturer.order(created_at: :desc).pluck(:name)
[22:58:07] Demerzel: if you're into symbols that is
[23:00:12] sandstrom: has joined #RubyOnRails
[23:00:55] lost_soul_: Thank you bronson, you saved me a night of restlessness!
[23:00:58] stannard: has joined #RubyOnRails
[23:01:16] lost_soul_: and thanks Demerzel, I'll keep that in mind!
[23:02:56] baweaver: has joined #RubyOnRails
[23:03:25] bronson: pluck is flexible: User.where(region: 'Texas').distinct.pluck(:favorite_color)
[23:03:46] bronson: hard to remember life before it.
[23:05:33] Papierkorb: But don't overuse it either. For small 'tricks' like doing pluck(:foo, :bar).to_h it's useful, but apart from that, smells like pre-mature optimization
[23:06:13] n00bDev: has joined #RubyOnRails
[23:07:01] lost_soul_: Hmmm, well. I'm trying to pass the method into a select field.
[23:07:27] lost_soul_: I need to list all manufacturers as part of a form and pass it to the database using submit.
[23:08:07] Papierkorb: lost_soul_: If you really need that query /nowhere/ else, and it's really only for this, it's reasonable IMO
[23:08:55] Demerzel: talking about premature optimization...
[23:09:15] chrismaxwel: has joined #RubyOnRails
[23:09:44] Demerzel: when you're ready for it, one optimization for pluck that I like to use once I'm done prototyping something, is: Manufacturer.select(:name).pluck(:name)
[23:10:05] Demerzel: the select ensures only the fields you're about to pluck are returned back
[23:10:56] Demerzel: don't do this until your code is functionally complete though
[23:11:07] VeryBewitching: The select ensures that you're not doing a full table scan for a value, to be exact :D
[23:11:08] ziyadb: has joined #RubyOnRails
[23:12:09] jottr: has joined #RubyOnRails
[23:12:17] quacker: has joined #RubyOnRails
[23:12:46] VeryBewitching: One thing I don't consider to be premature optimization is to be specific about what you select, all the time. If you're only going to need the name column, select just that. You will always have faster database turn around by being explicit with what you retrieve in conjunction with what you display.
[23:14:24] pwnd_nsfw: has joined #RubyOnRails
[23:15:18] bpr_admin: what is the difference between database.yml.dist and database.yml ... what's the purpose of the .dist end?
[23:16:11] yereby: has joined #RubyOnRails
[23:17:17] lost_soul_: Nice. Thanks all. I'll definitely optimize it once I have everything finalized, plus I'll keep it in mind for the future!
[23:17:26] sandstrom: has joined #RubyOnRails
[23:18:37] Devalo: has joined #RubyOnRails
[23:19:52] jtong: has joined #RubyOnRails
[23:21:19] sonofdirt: has joined #RubyOnRails
[23:22:33] pawnbox: has joined #RubyOnRails
[23:24:46] smathy: Demerzel, pluck already does that.
[23:25:11] dopie: https://gist.github.com/d30d5d631451cab752ee how do i test that step1 is rendered???
[23:25:11] aloneintheworld: has joined #RubyOnRails
[23:26:43] smathy: dopie, render_views
[23:29:21] kain: has joined #RubyOnRails
[23:30:16] rickmasta: has joined #RubyOnRails
[23:30:56] one_zero: has joined #RubyOnRails
[23:30:56] dopie: `render_views` is not available from within an example (e.g. an `it` block) or from constructs that run in the scope of an example (e.g. `before`, `let`, etc). It is only available on an example group (e.g. a `describe` or `context` block).
[23:31:30] bronson: yea, I don't understand that limitation either
[23:31:36] bronson: but at least rspec's error messages are super helpful
[23:32:21] Oliphaunte: has joined #RubyOnRails
[23:34:31] sandstrom: has joined #RubyOnRails
[23:35:21] dopie: expect(response).to render_template(partial: 'steps/_step1')
[23:39:32] shmilan: has joined #RubyOnRails
[23:42:45] bpr_admin: Anyone have insight to this?: what is the difference between database.yml.dist and database.yml ... what's the purpose of the .dist end?
[23:43:40] fryguy: bpr_admin: a lot of times database.yml ends up in .gitignore because it varies from computer to computer and environment to environment, so the .dist (we use .sample internally) is used to provide a sample of what the file might look like so you can copy it to database.yml and update to suit your needs
[23:44:35] RubyRev: has joined #RubyOnRails
[23:44:53] bpr_admin: fryguy: thanks, what do you think it can mean if there is no database.yml in the production env but the .dist file is there?
[23:46:45] fryguy: bpr_admin: it means your deployment script isn't putting database.yml into place
[23:47:39] yereby: has joined #RubyOnRails
[23:50:42] rubyonrailed: has joined #RubyOnRails
[23:51:44] sandstrom: has joined #RubyOnRails
[23:51:53] bpr_admin: ah, ok, thank you for that insight!
[23:52:54] bpr_admin: I'm porting an application to AWS EB made in heroku by a developer, and there's so much I don't understand, I'm a infrustructure guy
[23:56:22] stannard: has joined #RubyOnRails
[23:56:37] dopie: ok i got it to pass but the test looks ugly
[23:56:38] dopie: https://gist.github.com/b8ec894dcbda2a0cfdc3
[23:57:21] yereby: has joined #RubyOnRails
[23:57:27] duderonomy: has joined #RubyOnRails
[23:57:36] ramfjord_: has joined #RubyOnRails
[23:57:43] yereby: has left #RubyOnRails: ()
[23:57:51] kies^: has joined #RubyOnRails
[23:58:20] TravisTheNavi: has joined #RubyOnRails
[23:59:17] targaf: has joined #RubyOnRails