« Back to channel list

#RubyOnRails - 05 October 2017

« Back 1 day Forward 1 day »
[00:00:21] Skull0Inc: has joined #RubyOnRails
[00:06:30] cnk: I usually like Michael Hartl' stuff https://www.learnenough.com/action-cable-tutorial
[00:16:18] chrisgopher: has joined #RubyOnRails
[00:18:11] Skull0Inc: Hey all. Need some advice / resources links for learning to design proper ERD relationships for Active model / collection. Can anyone give any pointers for a beginner?
[00:19:00] Iambchop: has joined #RubyOnRails
[00:22:19] jhfisc: has joined #RubyOnRails
[00:27:41] jhfisc: has joined #RubyOnRails
[00:29:21] timdotrb_: has joined #RubyOnRails
[00:34:06] jhfisc: has joined #RubyOnRails
[00:36:51] jhfisc: has joined #RubyOnRails
[00:47:39] sevenseacat: has joined #RubyOnRails
[00:54:37] jhfisc: has joined #RubyOnRails
[01:03:20] jhfisc: has joined #RubyOnRails
[01:04:47] knight33: has joined #RubyOnRails
[01:12:39] fschuindt: has joined #RubyOnRails
[01:27:40] bronson: has joined #RubyOnRails
[01:39:42] wethu: has joined #RubyOnRails
[01:50:07] fschuindt: has joined #RubyOnRails
[01:52:16] jhfisc: has joined #RubyOnRails
[02:02:00] phon: has joined #RubyOnRails
[02:02:02] FCser: has joined #RubyOnRails
[02:02:15] ltd: has joined #RubyOnRails
[02:02:47] harrycs: has joined #RubyOnRails
[02:02:55] andrewray: has joined #RubyOnRails
[02:08:25] alfiemax: has joined #RubyOnRails
[02:08:55] jhfisc: has joined #RubyOnRails
[02:15:57] knight33: has joined #RubyOnRails
[02:32:08] roshanavand: has joined #RubyOnRails
[02:35:18] irishfromua: has joined #RubyOnRails
[02:49:52] apparition: has joined #RubyOnRails
[02:53:10] Saukk: has joined #RubyOnRails
[02:54:58] gamblor3: has joined #RubyOnRails
[02:57:29] orbyt_: has joined #RubyOnRails
[03:13:32] gamblor3: has joined #RubyOnRails
[03:13:59] bronson: has joined #RubyOnRails
[03:33:04] srinidhi: has joined #RubyOnRails
[03:40:55] Jameser: has joined #RubyOnRails
[03:45:12] fschuindt: has joined #RubyOnRails
[03:58:50] jhfisc: has joined #RubyOnRails
[04:08:34] Ropeney: has joined #RubyOnRails
[04:23:14] chrisgopher: has joined #RubyOnRails
[04:23:30] uks: has joined #RubyOnRails
[04:30:06] jhfisc: has joined #RubyOnRails
[04:36:16] jhfisc: has joined #RubyOnRails
[04:51:14] fschuindt: has joined #RubyOnRails
[05:15:07] knight33: has joined #RubyOnRails
[05:15:27] bronson: has joined #RubyOnRails
[05:25:22] worknick: has joined #RubyOnRails
[05:25:50] worknick: i have a public/test.html page. how can i access rails assets such as css files and images insiide this test.html page?
[05:26:04] worknick: no controller involved. just plain html page.
[05:26:11] worknick: no routes too.
[05:32:37] paranoicsan: has joined #RubyOnRails
[05:40:12] kitsuneyo: has joined #RubyOnRails
[05:40:28] kies: has joined #RubyOnRails
[05:43:16] ma5ter: has joined #RubyOnRails
[05:44:30] alfiemax: has joined #RubyOnRails
[05:45:28] fschuindt: has joined #RubyOnRails
[06:01:29] paranoicsan: has joined #RubyOnRails
[06:04:21] snickers: has joined #RubyOnRails
[06:07:13] paranoicsan: has joined #RubyOnRails
[06:15:39] timdotrb: has joined #RubyOnRails
[06:15:42] timdotrb: Evening, all
[06:23:06] timdotrb: I’m having another issue with rails_admin (surprise). I have a has_one / belongs_to association, but I’m not getting a dropdown on my has_one model
[06:23:20] timdotrb: Everything looks to be working on the belongs_to side
[06:23:57] AzaToth: has joined #RubyOnRails
[06:27:05] ^mtkd: has joined #RubyOnRails
[06:42:28] conta: has joined #RubyOnRails
[06:43:56] shime: has joined #RubyOnRails
[06:51:13] jphase: has joined #RubyOnRails
[06:56:10] mtkd: has joined #RubyOnRails
[07:11:01] fschuindt: has joined #RubyOnRails
[07:14:55] DoubleMalt: has joined #RubyOnRails
[07:16:04] bronson: has joined #RubyOnRails
[07:29:09] DoubleMalt: has joined #RubyOnRails
[07:32:40] fschuindt: has joined #RubyOnRails
[07:36:00] dionysus69: has joined #RubyOnRails
[07:38:11] jhfisc: has joined #RubyOnRails
[07:41:58] b0zz0: has joined #RubyOnRails
[07:44:48] jhfisc: has joined #RubyOnRails
[07:47:21] blackmesa: has joined #RubyOnRails
[07:50:43] shime: has joined #RubyOnRails
[07:55:13] Trynemjoel: has joined #RubyOnRails
[07:55:25] jhfisc: has joined #RubyOnRails
[07:55:35] DoubleMalt: has joined #RubyOnRails
[07:57:05] one_zero: has joined #RubyOnRails
[07:59:51] defsdoor: has joined #RubyOnRails
[08:00:52] kitsuneyo: has joined #RubyOnRails
[08:02:34] rgr: has joined #RubyOnRails
[08:09:01] jhfisc: has joined #RubyOnRails
[08:13:46] mikecmpbll: has joined #RubyOnRails
[08:22:36] jhfisc: has joined #RubyOnRails
[08:25:38] dionysus69: I have a cronjob generated by whenever gem
[08:25:41] dionysus69: * * * * * /bin/bash -l -c 'cd /home/user/project && bundle exec rake task --silent'
[08:25:56] dionysus69: if I execute this in terminal it works fine, but it doesnt execute every minute as it should
[08:26:10] dionysus69: logs indicate that this task is executing, but rake results are missing
[08:26:30] hahuang65: has joined #RubyOnRails
[08:28:20] lxsameer: has joined #RubyOnRails
[08:34:46] workmad3: has joined #RubyOnRails
[08:40:06] hive-mind: has joined #RubyOnRails
[08:46:03] marr: has joined #RubyOnRails
[08:46:59] blackmesa1: has joined #RubyOnRails
[08:47:18] xco: has joined #RubyOnRails
[08:53:57] hive-mind: has joined #RubyOnRails
[08:54:06] jhfisc: has joined #RubyOnRails
[08:57:24] Jameser: has joined #RubyOnRails
[09:01:59] jhfisc: has joined #RubyOnRails
[09:05:37] sevenseacat: has joined #RubyOnRails
[09:14:05] jhfisc: has joined #RubyOnRails
[09:16:06] xco: on this line in my rails app https://gist.github.com/anonymous/bcc344f7e7b3fca9df8ecf3efe7e1190#file-help-rb-L2 (in a private controller method”), i’m getting undefined method `fetch' for #<ActionDispatch::Http::UploadedFile:0x007fca4cc87120>. i’m confused because :device_id is an ID of a parameter hash, where is ActionDispatch::Http::UploadedFile coming from?
[09:17:18] bronson: has joined #RubyOnRails
[09:21:46] tbuehlmann: xco: can you add the params object to the gist?
[09:21:54] Ergo: has joined #RubyOnRails
[09:22:51] DoubleMalt: has joined #RubyOnRails
[09:26:00] xco: tbuehlmann: how do i get that?
[09:27:04] tbuehlmann: put `raise params.inspect` into your controller action and repeat the request
[09:28:15] xco: thanks… one minute
[09:30:51] xco: tbuehlmann: https://gist.github.com/xcobar/20c538bbc8d8fa7bd63e26cc3737960a
[09:31:26] hive-mind: has joined #RubyOnRails
[09:32:27] Sylario: has joined #RubyOnRails
[09:34:50] kitsuneyo: has joined #RubyOnRails
[09:36:07] ferr: has joined #RubyOnRails
[09:45:33] jhfisc: has joined #RubyOnRails
[09:50:39] jhfisc: has joined #RubyOnRails
[09:54:59] tbuehlmann: xco: yeah, so params[:image_request] is a file
[09:55:50] xco: yeap, a Tempfile. now that it’s clearer i can fix it. thank you :)
[09:56:32] jhfisc: has joined #RubyOnRails
[09:59:30] jhfisc: has joined #RubyOnRails
[10:08:07] timdotrb: has joined #RubyOnRails
[10:14:22] wethu: has joined #RubyOnRails
[10:15:00] ferr: has joined #RubyOnRails
[10:15:47] rgr_: has joined #RubyOnRails
[10:17:16] xiljin: has joined #RubyOnRails
[10:19:47] ferr: has joined #RubyOnRails
[10:22:21] bruno-: has joined #RubyOnRails
[10:34:47] xiljin: has joined #RubyOnRails
[10:40:38] fschuindt: has joined #RubyOnRails
[10:41:22] workmad3: has joined #RubyOnRails
[10:44:37] kitsuneyo: has joined #RubyOnRails
[10:51:15] apparition: has joined #RubyOnRails
[11:00:09] dionysus69: has joined #RubyOnRails
[11:03:33] ferr: has joined #RubyOnRails
[11:08:44] drale2k_: has joined #RubyOnRails
[11:09:41] b0zz0: has joined #RubyOnRails
[11:18:22] bronson: has joined #RubyOnRails
[11:30:44] kitsuneyo: has joined #RubyOnRails
[11:37:19] drale2k_: has joined #RubyOnRails
[11:37:56] blackmesa1: has joined #RubyOnRails
[11:47:28] drale2k_: has joined #RubyOnRails
[11:49:48] kitsuneyo: has joined #RubyOnRails
[11:51:39] kitsuneyo: has joined #RubyOnRails
[11:52:33] kitsuneyo: has joined #RubyOnRails
[11:53:16] kitsuneyo: has joined #RubyOnRails
[11:54:32] bruno-: has joined #RubyOnRails
[11:55:21] kitsuneyo: has joined #RubyOnRails
[11:56:18] conta1: has joined #RubyOnRails
[11:58:00] dionysus69: has joined #RubyOnRails
[12:09:32] knight33: has joined #RubyOnRails
[12:16:25] fmcgeough: has joined #RubyOnRails
[12:21:48] fmcgeough: has joined #RubyOnRails
[12:28:39] Psy-Q: has left #RubyOnRails: ("Leaving")
[12:37:26] drale2k_: has joined #RubyOnRails
[12:44:40] ShalokShalom_: has joined #RubyOnRails
[12:45:09] ams__: has joined #RubyOnRails
[12:45:54] drale2k_: has joined #RubyOnRails
[12:46:11] dionysus69: I dont really get what's the point of this gem https://github.com/huacnlee/rails-settings-cached
[12:46:18] tycoon177: How would I go about setting up a route to proxy api calls? basically, rails would take the currently authenticated user, find their api key and then forward the request to the correct location. if it helps, i'm using pouchdb with couchdb for remote storage and want to protect databases from being read by others
[12:46:30] dionysus69: Keep track of any global setting that you dont want to hard code into your rails app
[12:46:44] dionysus69: isn't it same as if I set env vars with figaro for example?
[12:48:01] rfoust: has joined #RubyOnRails
[12:54:37] chouhoulis: has joined #RubyOnRails
[12:54:46] workmad3: has joined #RubyOnRails
[12:55:28] truenito: has joined #RubyOnRails
[12:56:36] bazzy: has joined #RubyOnRails
[12:59:54] drale2k_: has joined #RubyOnRails
[13:04:54] kitsuneyo: has joined #RubyOnRails
[13:10:16] snickers: has joined #RubyOnRails
[13:11:30] ur5us: has joined #RubyOnRails
[13:12:22] b0zz0: has joined #RubyOnRails
[13:15:27] jhfisc: has joined #RubyOnRails
[13:19:22] bronson: has joined #RubyOnRails
[13:19:48] sevenseacat: has joined #RubyOnRails
[13:20:49] jhfisc: has joined #RubyOnRails
[13:21:02] blackmesa1: has joined #RubyOnRails
[13:23:26] tycoon177: How would I go about setting up a route to proxy api calls? basically, rails would take the currently authenticated user, find their api key in my database and then forward the request to the correct location and then respond with the exact api response without modification
[13:27:04] jhfisc: has joined #RubyOnRails
[13:32:58] skapshikar: has joined #RubyOnRails
[13:33:03] skapshikar: has left #RubyOnRails: ()
[13:41:41] jhfisc: has joined #RubyOnRails
[13:43:03] bruno-: has joined #RubyOnRails
[13:46:47] alfiemax: has joined #RubyOnRails
[13:48:07] jhfisc: has joined #RubyOnRails
[13:54:55] drale2k_: has joined #RubyOnRails
[14:00:53] jhfisc: has joined #RubyOnRails
[14:01:20] jtperreault: has joined #RubyOnRails
[14:01:26] b0zz0: has joined #RubyOnRails
[14:08:40] jhfisc: has joined #RubyOnRails
[14:10:02] orbyt_: has joined #RubyOnRails
[14:14:55] jhfisc: has joined #RubyOnRails
[14:15:55] aseibert: has joined #RubyOnRails
[14:17:20] blackmesa1: has joined #RubyOnRails
[14:22:13] jhfisc: has joined #RubyOnRails
[14:28:28] kitsuneyo: has joined #RubyOnRails
[14:28:38] skapshikar: has joined #RubyOnRails
[14:29:13] kitsuneyo: has joined #RubyOnRails
[14:30:02] kitsuneyo: has joined #RubyOnRails
[14:31:50] cgfbee: has joined #RubyOnRails
[14:34:26] jhfisc: has joined #RubyOnRails
[14:34:57] sekmo: has joined #RubyOnRails
[14:35:50] jphase: has joined #RubyOnRails
[14:40:01] bronson: has joined #RubyOnRails
[14:46:43] mrbubbles: has joined #RubyOnRails
[14:47:00] mrbubbles: When deploying to heroku with a RAils 5.1 app, what dictates the version of Yarn that is installed? Is it the buildpack?
[14:50:51] jhfisc: has joined #RubyOnRails
[14:50:54] soahccc: I'm a bit confused right now, the new_framework_defaults.rb is supposed to be deleted if you have migrated, no?
[14:51:37] soahccc: I'm currently on 5.1 and my belongs_to defaults to optional: true
[14:54:45] moei: has joined #RubyOnRails
[14:57:17] Trynemjoel: has joined #RubyOnRails
[14:58:07] soahccc: And this lead to a strange behaviour (which isn't that strange but it's new?) that if the belongs_to is optional, the reverse has_many(dependent: :destroy) doesn't destroy anything...
[14:58:57] soahccc: And I just readded the new_framework_default file and especially the setting `Rails.application.config.active_record.belongs_to_required_by_default = true` and yet, belongs_to is optional by default...
[15:03:18] jhfisc: has joined #RubyOnRails
[15:08:10] fschuindt: has joined #RubyOnRails
[15:08:48] marr: has joined #RubyOnRails
[15:09:05] jhfisc: has joined #RubyOnRails
[15:12:42] sekmo: Hi everyone! Is it ok to use something like `movie = Movie.where(tmdb_code: params[:tmdb_code]).first_or_create!(title: params[:title])`, or it's more idiomatic to use the `create_with` method?
[15:14:53] sekmo: Here it is: https://github.com/sekmo/movienight/blob/master/app/controllers/wishes_controller.rb
[15:15:55] matthewd: sekmo: It's not idiomatic to use an undocumented internal method
[15:19:33] sekmo: why is it an internal method?
[15:21:27] mrbubbles: I was trying to use Webpack on my project after upgrading to Rails 5.1 but it's causing no end of issues. Is there a single line I can comment out to just revert to Asset Pipeline, but leaving all the webpack stuff there so I can look at it when I have more time?
[15:22:13] jhfisc: has joined #RubyOnRails
[15:26:02] andrewray: has joined #RubyOnRails
[15:28:48] jhfisc: has joined #RubyOnRails
[15:29:12] cagomez: has joined #RubyOnRails
[15:38:43] FrostCandy: has joined #RubyOnRails
[15:40:10] FrostCandy: if (session[:ctime] || Time.now.utc > session[:ctime]) gives me a "Comparison of time with nil failed", but shoulnd't session[:ctime] shortcut if it's nil? Do I have to check explicitly for nil like session[:ctime].nil?
[15:41:04] FrostCandy: or maybe a if (session[:ctime) || ( time.now.utc ...)
[15:41:07] FrostCandy: I'll try that heh
[15:42:01] jhfisc: has joined #RubyOnRails
[15:42:17] snickers: has joined #RubyOnRails
[15:42:31] FrostCandy: I had to explicitly look for .nil.
[15:42:40] timdotrb: has joined #RubyOnRails
[15:43:42] kitsuneyo: has joined #RubyOnRails
[15:45:15] kitsuneyo: has joined #RubyOnRails
[15:48:12] jhfisc: has joined #RubyOnRails
[15:57:47] aseibert: has joined #RubyOnRails
[15:58:26] bruno-: has joined #RubyOnRails
[16:02:27] jhfisc: has joined #RubyOnRails
[16:05:17] kitsuneyo: has joined #RubyOnRails
[16:07:58] orbyt_: has joined #RubyOnRails
[16:10:12] blackmesa: has joined #RubyOnRails
[16:12:00] jhfisc: has joined #RubyOnRails
[16:15:25] [Butch]: has joined #RubyOnRails
[16:16:50] kitsuneyo: has joined #RubyOnRails
[16:17:02] kies: has joined #RubyOnRails
[16:22:25] fschuindt: has joined #RubyOnRails
[16:23:31] jhfisc: has joined #RubyOnRails
[16:24:07] cschneid_: has joined #RubyOnRails
[16:24:21] dviola: has joined #RubyOnRails
[16:27:32] troys: has joined #RubyOnRails
[16:30:06] jhfisc: has joined #RubyOnRails
[16:30:17] gusrub: has joined #RubyOnRails
[16:31:45] roshanavand: has joined #RubyOnRails
[16:34:24] drale2k_: has joined #RubyOnRails
[16:36:06] jhfisc: has joined #RubyOnRails
[16:39:13] andrewray: has joined #RubyOnRails
[16:39:56] andrewray: has joined #RubyOnRails
[16:40:51] andrewray: has joined #RubyOnRails
[16:41:37] andrewray: has joined #RubyOnRails
[16:43:59] jhfisc: has joined #RubyOnRails
[16:45:01] b0zz0: has joined #RubyOnRails
[16:48:27] tpendragon: has joined #RubyOnRails
[16:50:55] cubehut: has joined #RubyOnRails
[16:52:09] bronson: has joined #RubyOnRails
[16:54:12] cagomez: has joined #RubyOnRails
[16:58:30] jhfisc: has joined #RubyOnRails
[16:59:39] mostlybadfly: has joined #RubyOnRails
[17:00:59] one_zero: has joined #RubyOnRails
[17:01:26] mikecmpbll: has joined #RubyOnRails
[17:06:36] b0zz0: has joined #RubyOnRails
[17:06:41] leclerc: has joined #RubyOnRails
[17:08:34] mcr1: has joined #RubyOnRails
[17:09:39] mcr1: Is there a plugin/gem that will give webrick TLS capabilities? I don't need this for production, but I'm working on an application that uses TLS client certificates, and running under apache/passenger in devel mode is a bit annoying.
[17:10:18] matthewd: mcr1: I'd suggest using puma
[17:10:25] mcr1: okay. Why?
[17:11:01] mcr1: (reading the man page for webrick, I realize it now supports TLS...)
[17:11:54] matthewd: Because it's the default server, gives a webrick-style experience, and is IMO easier to configure and work with
[17:12:51] fschuindt: has joined #RubyOnRails
[17:13:15] mcr1: It's the default now?
[17:13:48] matthewd: e.g., I suspected webrick would likely have built-in TLS support, but confirming that seemed like hard work
[17:14:16] jhfisc: has joined #RubyOnRails
[17:14:25] mcr1: I was surprised to see it. puma is the default for 5.1? I just realized this project is still at 4.2, which is odd since the other two microservices are at 5.x
[17:14:46] matthewd: It's been the default since 5.0
[17:16:55] mtkd: has joined #RubyOnRails
[17:17:14] aseibert: has joined #RubyOnRails
[17:19:01] aseibert: has joined #RubyOnRails
[17:21:04] tcopeland: has joined #RubyOnRails
[17:21:15] kuwze: can someone help me with this? https://gist.github.com/kuwze/ab01d9de0a2fb1e5a78715238b65cf8a
[17:21:56] kuwze: apparently the csv is not being split on ',' so 'id' ends up being bound to the entire row
[17:22:08] kuwze: I'm trying to follow this: https://gorails.com/episodes/intro-to-importing-from-csv
[17:22:50] matthewd: kuwze: And which of those examples do you think this matches?
[17:23:55] kuwze: I think this one: https://gist.github.com/kuwze/5fcaf611a4fd7dfe1cc263c70ef48ec3
[17:24:10] kuwze: matthewd: that's from the transcript (I think 'raw' is supposed to be 'row' though)
[17:25:10] matthewd: Wow, yeah, that transcript is full of typos
[17:26:07] matthewd: There aren't a lot of lines to compare between those two.. typos (and variable names) aside, there's only one real difference as far as I can see
[17:26:15] matthewd: Maybe it's relevant?
[17:26:20] kuwze: matthewd: what is it?
[17:26:38] rgr: has joined #RubyOnRails
[17:27:19] matthewd: That rather defeats the point of me trying to avoid giving you the answer, but it's `headers: true`
[17:28:23] fschuindt: has joined #RubyOnRails
[17:29:10] kuwze: matthewd: why would you avoid giving me the answer?
[17:29:28] kuwze: matthewd: also I don't think that's the issue, as further down the page he gives an example with 'headers: true'. https://gist.github.com/kuwze/47e0239603c87e475d423a444ffcf8e6
[17:30:23] cubehut: matthewd: I'm a bit surprised that a transcript from GoRails, never used it but heard some good stuff about them, can have so many typos...
[17:30:25] jhfisc: has joined #RubyOnRails
[17:33:44] LateralOctober: has joined #RubyOnRails
[17:33:46] matthewd: kuwze: Because being able to notice the differences between two approximately-similar blocks of code is a useful skill, best trained by exercising it. And which would reveal that that example is different, in very relevant ways, in how it handles the row inside the block.
[17:36:12] dblessing: has joined #RubyOnRails
[17:40:35] b0zz0: has joined #RubyOnRails
[17:41:23] b0zz0: has joined #RubyOnRails
[17:42:10] b0zz0: has joined #RubyOnRails
[17:42:53] b0zz0: has joined #RubyOnRails
[17:43:12] cpruitt: kuwze: I only glanced at this but I don’t understand why you’re using `id, title, description, author, tags, created_at, updated_at = row`. If iI recall, `row` here would be an instance of CSV::Row, not an array of values.
[17:43:43] b0zz0: has joined #RubyOnRails
[17:43:51] cpruitt: I suspect that if you inspect `id` on a subsequent line you might find that it’s not the string you think that it is.
[17:44:26] b0zz0: has joined #RubyOnRails
[17:45:11] b0zz0: has joined #RubyOnRails
[17:46:01] b0zz0: has joined #RubyOnRails
[17:46:46] b0zz0: has joined #RubyOnRails
[17:47:31] b0zz0: has joined #RubyOnRails
[17:48:19] b0zz0: has joined #RubyOnRails
[17:48:51] drale2k_: has joined #RubyOnRails
[17:49:06] b0zz0: has joined #RubyOnRails
[17:52:31] bronson: has joined #RubyOnRails
[17:53:36] kuwze: matthewd: thank you, I understand I have to learn how to program through hard work and persistence.
[17:53:53] kuwze: cpruitt: I'm not familiar with Ruby, so I just copied that from the gorails video
[17:54:43] orbyt_: has joined #RubyOnRails
[17:55:46] cpruitt: kuwze: So, I think the short answer is you should spend some time reading documentation and other tutorials about ruby’s CSV support. The gorails vid (or transcript) sounds like it might be a little questionable. You might need some more background learning before you can really dig into this.
[17:56:28] cpruitt: I’d at least familiarize yourself with using `#inspect` on an object to see what it is and what it’s values are.
[17:56:51] LateralOctober: has joined #RubyOnRails
[17:57:44] cubehut: kuwze: Try reading the code you copy line by line and understand, or at least guess, what it does. That way you won't have that many issues when it breaks and you have to debug it because you will easily pin point the issue.
[17:59:21] LateralOctober: has joined #RubyOnRails
[18:00:56] cpruitt: kuwze: Go back & watch te video from 12:00 to 14:00 (maybe a little more)
[18:01:15] cpruitt: They explain the headers option and what they change to make it work.
[18:01:27] cpruitt: You’re mixing code from two different approaches.
[18:07:01] FernandoBasso: has joined #RubyOnRails
[18:07:11] LateralOctober: has joined #RubyOnRails
[18:08:35] b0zz0: has joined #RubyOnRails
[18:09:05] kuwze: cpruitt: thank you. I initally discounted the fact that headers: true was in there, but it seems to have a significant impact on what happens.
[18:09:36] dionysus69: has joined #RubyOnRails
[18:13:56] LateralOctober: has joined #RubyOnRails
[18:17:31] cpruitt: kuwze: CSV::Row behaves differently depending on whether there are headers (acts like name/value pairs in a hash) or just a list with no headers (depends on column order like an array)
[18:22:24] jhfisc: has joined #RubyOnRails
[18:23:44] Guest97372: has joined #RubyOnRails
[18:23:47] jkwood: has joined #RubyOnRails
[18:26:26] skapshikar: has joined #RubyOnRails
[18:27:23] skapshikar: has left #RubyOnRails: ()
[18:27:30] FernandoBasso: I have a controller test for 'show post category'. I assert the success of `get admin_post_category_url(id: post_category.id)`
[18:27:48] FernandoBasso: Without :id there the test fails and complains about missing :id key.
[18:28:17] FernandoBasso: Shouldn't it also work with `get admin_post_category_url(post_category)` (without :id and without .id)?
[18:33:00] matthewd: FernandoBasso: Is it using the route you intend it to?
[18:34:13] FernandoBasso: matthewd, I don't know. I am new to this testing thing (and rails).
[18:35:04] FernandoBasso: I am confused about using helper methods that routes creates automatically.
[18:35:53] FernandoBasso: I am referring to this: http://guides.rubyonrails.org/routing.html#path-and-url-helpers
[18:36:19] FernandoBasso: And my test is just like this first one shown here http://guides.rubyonrails.org/testing.html#putting-it-together
[18:36:24] matthewd: Check `rails routes`
[18:36:54] jhfisc: has joined #RubyOnRails
[18:37:24] FernandoBasso: matthewd, http://sprunge.us/AGHJ
[18:38:54] matthewd: Hmm.. is the locale thing making it upset?
[18:40:38] FernandoBasso: I don't know. Perhaps. Above that I have test for index, new and create and they work.
[18:40:58] b0zz0: has joined #RubyOnRails
[18:41:34] FernandoBasso: matthewd, here, if it helps: http://sprunge.us/hcIU?rb
[18:43:12] shime: has joined #RubyOnRails
[18:43:38] skapshikar: has joined #RubyOnRails
[18:43:56] gambl0re: has joined #RubyOnRails
[18:48:19] bruno-: has joined #RubyOnRails
[18:49:27] veloutin: I am calling url_for in a controller and get an error from an extra param I didn't pass (no route matches controller, action foo: "5", foo_id: "5". It seems like the extra param "foo" comes from the current controller action being inside a scope :foo, is that right?
[18:50:04] veloutin: can I unset this param when calling url_for ?
[18:50:12] jhfisc: has joined #RubyOnRails
[18:50:32] matthewd: FernandoBasso: I think it's going to be to do with what parameters the helper is expecting, but I'm not actually sure how to prove that :/
[18:51:30] FernandoBasso: matthewd, No problem. It works the way I showed. I was just trying to understand it myself. Thanks a lot for your help and patience. Much appreciated.
[18:52:04] matthewd: veloutin: Hash-based url_for will retain the parameters that are in the route. You can probably set it to nil? I'd generally avoid hash-based routing in favour of the named helpers, though.
[18:52:59] veloutin: matthewd: ok, thanks
[18:54:52] jhfisc: has joined #RubyOnRails
[19:06:24] cagomez: has joined #RubyOnRails
[19:14:06] jhfisc: has joined #RubyOnRails
[19:16:20] theunraveler: has joined #RubyOnRails
[19:16:33] fschuindt: has joined #RubyOnRails
[19:21:02] mtkd: has joined #RubyOnRails
[19:23:24] srkska: has joined #RubyOnRails
[19:32:38] dviola: has joined #RubyOnRails
[19:40:36] blackmesa: has joined #RubyOnRails
[19:43:28] gusrub_: has joined #RubyOnRails
[19:48:25] orbyt_: has joined #RubyOnRails
[19:48:39] cagomez: has joined #RubyOnRails
[19:50:29] cagomez: has joined #RubyOnRails
[19:52:52] conta: has joined #RubyOnRails
[19:53:31] bronson: has joined #RubyOnRails
[19:55:58] cagomez: has joined #RubyOnRails
[20:01:26] Skull0Inc: has joined #RubyOnRails
[20:04:22] netzfisch: has joined #RubyOnRails
[20:05:20] Skull0Inc: Hey, does anyone know how to associate records in console? E.g I have Company--->User<---Role. So company has many users and role also has many users. I'm trying to associate in the console a user witha company. company.users = user. Any ideas?
[20:06:38] cpruitt: Skull0inc: Console is no different than what you’d do anywhere else in your app.
[20:07:06] cpruitt: `@comapny.users << @user`
[20:07:25] Skull0Inc: I'm trying to get it working in console first before I build.
[20:07:29] jhfisc: has joined #RubyOnRails
[20:07:43] cpruitt: So you’re just asking how to add a record to an association collection?
[20:07:51] hahuang65: has joined #RubyOnRails
[20:08:15] Skull0Inc: yes. With a has_man relation. I've gotten it to work for has_many through: but this is just has many.
[20:08:56] cpruitt: http://guides.rubyonrails.org/association_basics.html#has-many-association-reference
[20:08:56] Skull0Inc: so user = User.first; company = Company.first; role = Role.first
[20:09:15] cpruitt: If you’re adding user to company, role is irrelivant
[20:09:23] cpruitt: Company doesn’t care about roles
[20:09:30] Skull0Inc: hmm. Good point.
[20:09:58] Skull0Inc: I need general guidance with Model creation and relations. pros and cons as there are many ways to do it.
[20:10:28] cpruitt: See the link I sent. That guide is as good a starting point as any.
[20:11:19] LateralOctober: has joined #RubyOnRails
[20:11:33] Skull0Inc: have tried the build method but not quite sure how that works.
[20:12:08] Skull0Inc: like company.users.build(user)
[20:12:43] cpruitt: #build creates a new unsaved instance and adds it to the collection, but performs no saving. You need to call #save on your model (company) to persist the addition to the database.
[20:13:14] Skull0Inc: can I pass it in as described above?
[20:13:23] Skull0Inc: it errors out for me that way.
[20:14:32] Skull0Inc: Okay, will follow through reference link and get back if anything.thanks.
[20:15:46] cpruitt: No, Company.users.build() takes the same arguments as User.new(), which would be a hash of attributes for the new object. Like: Company.users.new({ first_name: “Arthur”, last_name: “Dent” })
[20:16:17] cpruitt: If you already have a user object and want to add it to the collection use `Company.users << some_user`
[20:17:12] cpruitt: (Just to be clear, `Company.users.new` is the same as `Company.users.build`)
[20:18:35] LateralOctober: has joined #RubyOnRails
[20:18:39] pta2002: has joined #RubyOnRails
[20:21:41] pta2002: Hello, I'm having some problems when I try to deploy my app to heroku https://gist.github.com/pta2002/dab99fd34e0d59e825c7b2c9b0ccf84d (this is the log)
[20:22:50] pta2002: oh nevermind, I fixed it. Turns out heroku doesn't migrate automatically, I thought it did
[20:22:56] pta2002: has left #RubyOnRails: ("WeeChat 1.9")
[20:23:49] Skull0Inc: cpruitt: seems theres no method on Company.users. 'undefined method' which is the strange part.
[20:24:08] matthewd: Company != company
[20:25:24] Skull0Inc: company = Company.first
[20:25:33] Skull0Inc: either says undefined.
[20:27:28] matthewd: `company.users << user` should work, assuming relevant associations etc
[20:28:14] matthewd: Skull0inc: Otherwise, gist what you're running and the full error you're getting?
[20:29:44] Skull0Inc: company(has_many :users) user(has_one :role, belongs_to :company, required: false).
[20:30:02] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[20:31:29] cpruitt: Skull0inc: My earlier example had the C in company capitalized. It should not be.
[20:33:47] Skull0Inc: https://gist.github.com/anonymous/ecb88737f1473eb197e84cc4cb0c1647
[20:34:47] Skull0Inc: Just trying to figure out how the relations (really work) and furthrmore create relevant signup form to create necessary records in those models.
[20:35:28] LateralOctober: has joined #RubyOnRails
[20:37:01] Skull0Inc: Oh. Sorry the error message. Lemme create one.
[20:40:05] timdotrb: has joined #RubyOnRails
[20:40:11] jhfisc: has joined #RubyOnRails
[20:42:42] Skull0Inc: https://gist.github.com/anonymous/2f8f777db00b178a81da3ea7099c11e4
[20:45:58] kuwze: I am using this library https://github.com/mbleigh/acts-as-taggable-on/ but I don't understand how to print out the tags https://gist.github.com/kuwze/c8175c9cce7e5878ff7518985f2cb7bc
[20:47:22] kuwze: actually I just figured it out
[20:47:28] Skull0Inc: cpruitt: https://gist.github.com/anonymous/4b4519f094d0fcda54c7d3462a0ba67a
[20:47:56] jphase: has joined #RubyOnRails
[20:48:01] timdotrb: Afternoon, all
[20:49:16] Skull0Inc: cpruitt: Gotta leave office soon, dunno if response will be logged.
[20:49:50] timdotrb: I'm running Solr for searching with sunspot_rails, and for some reason, solr doesn't appear to be indexing new or updated objects.. Any ideas why this behavior might occur? The docs says sunspot_rails is supposed to auto index on object save
[20:50:52] jhfisc: has joined #RubyOnRails
[20:51:25] kuwze: can someone point me to a good explanation of the difference between a = Author.create(name: "asdf") and @a = Author.new(:name => "asdf")
[20:52:06] timdotrb: kuwze, create actually creates the object. new simply instantiates it, after you call .new you need to call .save
[20:52:56] kuwze: timdotrb: but what about the usage of @? I understand it is for instance variables, but I don't undertstand what it means in the example I gave
[20:53:38] timdotrb: kuwze, If you had that code in your controller, @a would be accessible in your view. a would not
[20:54:45] kuwze: so what does prefixing with "@" really do? If you said it can then be accessible in the view, does that mean it's defining a public variable? And why is it used for new and not create?
[20:55:11] rgr: has joined #RubyOnRails
[20:55:58] timdotrb: kuwze, it has nothing to do with create vs new. a would be a local variable, @a would be an instance variable. Hence why a would only be available in your controller, whereas @a would be accessible in your view
[20:55:59] cpruitt: Skull0inc: “ActiveModel::MissingAttributeError: can't write unknown attribute `company_id`” This sounds like you’ve never created the company_id column in your users table
[20:56:22] kuwze: timdotrb: that makes sense. thank you for that explanation.
[20:56:31] timdotrb: kuwze, no problem :)
[20:57:15] ResidentBiscuit: has joined #RubyOnRails
[20:57:40] ResidentBiscuit: has joined #RubyOnRails
[21:09:54] hahuang65: has joined #RubyOnRails
[21:16:14] b0zz0: has joined #RubyOnRails
[21:18:12] fschuindt: has joined #RubyOnRails
[21:18:23] jhfisc: has joined #RubyOnRails
[21:19:51] wethu: has joined #RubyOnRails
[21:26:06] jhfisc: has joined #RubyOnRails
[21:28:15] kuwze: I am using https://github.com/mbleigh/acts-as-taggable-on/ for tagging, but I don't understand how I can display them.
[21:28:21] kuwze: here is my controller atm: https://gist.github.com/kuwze/d19fa801c59eb087adb0eb79bc9e2b7c
[21:28:55] kuwze: the project (and controller I guess) was created with --api
[21:36:22] drale2k_: has joined #RubyOnRails
[21:38:06] jhfisc: has joined #RubyOnRails
[21:41:31] Skull0Inc: has joined #RubyOnRails
[21:46:49] bronson: has joined #RubyOnRails
[21:47:53] jhfisc: has joined #RubyOnRails
[21:54:18] jhfisc: has joined #RubyOnRails
[21:58:43] shime: has joined #RubyOnRails
[21:59:28] jhfisc: has joined #RubyOnRails
[22:01:06] orbyt_: has joined #RubyOnRails
[22:03:05] jhfisc: has joined #RubyOnRails
[22:05:07] kuwze: okay I have a.tag_list will list the tags but it's not being rendered by my controller 'render json: @post'
[22:06:56] FrostCandy: Has anyone seeen @user.grant? I saw @user.save and it appears to save the user info to the db no problem, but can't find the method .grant. Does that sound like a devise gem method maybe?
[22:06:58] jake_g: has joined #RubyOnRails
[22:08:31] havenwood: FrostCandy: I'd suggest checking `@user.public_method(:grant).owner` and `@user.public_method(:grant).source_location`
[22:09:07] jake_g: Hi, I’m running into an issue where ‘app/models/concerns’ isn’t autoloading. My understanding of the docs here is that it should: http://guides.rubyonrails.org/autoloading_and_reloading_constants.html#autoload-paths. Is there some other configureation I’m missing? Rails 5.1 created with `—api` option
[22:09:37] FrostCandy: havenwood: ok thanks, is what you posted in a gem somewhere typially? or likely in this guys code somewhere? I'm about ot grep the gem directory heh
[22:10:07] havenwood: FrostCandy: The owner will likely be a gem Class or Module. The source location should also be revealing.
[22:10:21] FrostCandy: havenwood: ok thanks
[22:10:37] matthewd: FrostCandy: That's a thing that you should run, in any place convenient, to ask the code where the method was defined -- not at thing you should be looking for
[22:11:30] FrostCandy: yup totally forgot about .sorce
[22:11:33] FrostCandy: and the like
[22:13:08] jake_g: Maybe its a different issue but I get `Uninitialized constant ModelName::ConstantName`
[22:14:20] jhfisc: has joined #RubyOnRails
[22:19:13] wethu: has joined #RubyOnRails
[22:23:56] jhfisc: has joined #RubyOnRails
[22:24:03] kuwze: does anyone know how to force a parameter to be shown when rendering an object in json? I have tried adding it to the serializer and controller to no avail
[22:28:29] FrostCandy: --- it was the rolify gem , thanks for the advice
[22:30:05] jhfisc: has joined #RubyOnRails
[22:31:31] timdotrb: kuwze, can you gist your code?
[22:35:30] acosonic: has joined #RubyOnRails
[22:40:11] jhfisc: has joined #RubyOnRails
[22:49:46] jphase: has joined #RubyOnRails
[22:53:56] jhfisc: has joined #RubyOnRails
[22:56:18] alfiemax: has joined #RubyOnRails
[23:00:06] jhfisc: has joined #RubyOnRails
[23:00:35] orbyt_: has joined #RubyOnRails
[23:03:37] jhfisc: has joined #RubyOnRails
[23:04:48] knight33: has joined #RubyOnRails
[23:25:44] Olipro: has joined #RubyOnRails
[23:30:17] jhfisc: has joined #RubyOnRails
[23:35:45] Olipro: has joined #RubyOnRails
[23:37:20] p8m: has joined #RubyOnRails
[23:40:52] jhfisc: has joined #RubyOnRails
[23:42:26] xaviergmail: has joined #RubyOnRails
[23:43:00] harrycs: has joined #RubyOnRails
[23:45:58] jhfisc: has joined #RubyOnRails
[23:52:25] conta1: has joined #RubyOnRails
[23:52:29] orbyt_: has joined #RubyOnRails
[23:59:48] bronson: has joined #RubyOnRails
[23:59:55] rfoust: has joined #RubyOnRails