« Back to channel list

#RubyOnRails - 25 August 2017

« Back 1 day Forward 1 day »
[00:00:03] gbgdev: has joined #RubyOnRails
[00:00:39] jrabe: has joined #RubyOnRails
[00:04:14] jhfisc: has joined #RubyOnRails
[00:05:14] beilabs: has joined #RubyOnRails
[00:06:57] jhfisc: has joined #RubyOnRails
[00:10:00] jhfisc: has joined #RubyOnRails
[00:11:57] arBmind: has joined #RubyOnRails
[00:12:57] jhfisc: has joined #RubyOnRails
[00:16:53] alfiemax: has joined #RubyOnRails
[00:23:25] umaaji: has joined #RubyOnRails
[00:26:02] AnotherOne: has joined #RubyOnRails
[00:28:10] chouhoulis: has joined #RubyOnRails
[00:31:31] jhfisc: has joined #RubyOnRails
[00:32:34] tsia: has joined #RubyOnRails
[00:33:45] gbgdev: has joined #RubyOnRails
[00:36:33] brent__: has joined #RubyOnRails
[00:38:45] matcouto: has joined #RubyOnRails
[00:44:18] cagomez: has joined #RubyOnRails
[00:46:38] cagomez_: has joined #RubyOnRails
[00:47:35] jhfisc: has joined #RubyOnRails
[00:53:53] jhfisc: has joined #RubyOnRails
[00:55:50] sevenseacat: has joined #RubyOnRails
[01:02:27] TinkerTyper: has joined #RubyOnRails
[01:05:00] jhfisc: has joined #RubyOnRails
[01:07:42] bronson: has joined #RubyOnRails
[01:11:26] michael_mbp: Anyone interesting in pondering a strange resque/redis question?
[01:12:34] michael_mbp: I'm running a couple in a Docker swarm - thoughts on how to kill the workers gracefully, i.e do I need to send TERM or SIGQUIT to the actual resque process?
[01:13:00] jhfisc: has joined #RubyOnRails
[01:13:12] michael_mbp: I could ps aux grep for those PIDs, but then the docker swarm would replace them with a new container.
[01:16:45] beilabs_: has joined #RubyOnRails
[01:18:37] jmay: has joined #RubyOnRails
[01:19:23] tetraktys: has joined #RubyOnRails
[01:24:54] jhfisc: has joined #RubyOnRails
[01:28:21] milesmatthias: has joined #RubyOnRails
[01:35:43] jhfisc: has joined #RubyOnRails
[01:42:46] shilon: has joined #RubyOnRails
[01:49:50] xco: has joined #RubyOnRails
[01:51:44] xco: hello. my app makes an ajax request to populate a table. initially the html loaded asserts line 8 to be 14. but with ajax when the param is ‘month’ the table is populated with value 15 BUT page source shows 14 still. this makes make test faile. passing ‘month’ param to the test should see 15 and not 14
[01:52:14] xco: how do i get around this? the ajax request is not changing the html element so the test sees 14 still irrespective ofo the param passed
[01:52:26] xco: here’s my code
[01:52:26] xco: https://gist.github.com/xcobar/e8f9491394088cb2b0051903433e0846
[01:52:37] xco: i’ll love some help
[01:59:00] mtkd: has joined #RubyOnRails
[02:05:46] hammer065: has joined #RubyOnRails
[02:19:40] alfiemax: has joined #RubyOnRails
[02:25:09] jhfisc: has joined #RubyOnRails
[02:26:40] irishfromua: has joined #RubyOnRails
[02:30:17] DarkBushido: has joined #RubyOnRails
[02:32:06] tpendragon: has joined #RubyOnRails
[03:10:16] bronson: has joined #RubyOnRails
[03:13:56] pulgalipe: has joined #RubyOnRails
[03:27:00] jhfisc: has joined #RubyOnRails
[03:28:02] alfiemax: has joined #RubyOnRails
[03:32:58] jhfisc: has joined #RubyOnRails
[03:47:26] jhfisc: has joined #RubyOnRails
[03:52:03] chouhoulis: has joined #RubyOnRails
[03:53:06] fschuindt: Why do a model append it's name to other classes calls like it was inside a module? Eg.: Inside the model Office, I run: "GeocodeOfficeJob.perform_async" and it errors out: "uninitialized constant Office::GeocodeOfficeJob". It's trying to find the class in a module named "Office". But the class is declared (and invoked) outside it.
[03:59:21] jhfisc: has joined #RubyOnRails
[04:00:35] irishfromua: has joined #RubyOnRails
[04:05:21] jhfisc: has joined #RubyOnRails
[04:07:31] fschuindt: nvm, I was just making a huge confusion ¯\_(ツ)_/¯
[04:11:51] jhfisc: has joined #RubyOnRails
[04:12:47] mtkd: has joined #RubyOnRails
[04:17:44] jhfisc: has joined #RubyOnRails
[04:25:43] jhfisc: has joined #RubyOnRails
[04:40:56] brent__: has joined #RubyOnRails
[04:44:38] jhfisc: has joined #RubyOnRails
[04:53:39] conta: has joined #RubyOnRails
[05:00:18] sevenseacat: has joined #RubyOnRails
[05:12:06] bronson: has joined #RubyOnRails
[05:23:23] paranoicsan: has joined #RubyOnRails
[05:34:57] gusrub: has joined #RubyOnRails
[05:47:03] jhfisc: has joined #RubyOnRails
[05:52:50] conta: has joined #RubyOnRails
[05:56:45] jhfisc: has joined #RubyOnRails
[05:59:50] ur5us: has joined #RubyOnRails
[06:02:00] Chernobuk: has joined #RubyOnRails
[06:06:04] kapil___: has joined #RubyOnRails
[06:10:17] roshanavand: has joined #RubyOnRails
[06:19:17] sevenseacat: has joined #RubyOnRails
[06:19:53] FastJack: has joined #RubyOnRails
[06:20:53] dionysus69: has joined #RubyOnRails
[06:27:55] conta: has joined #RubyOnRails
[06:31:52] pulgalipe: has left #RubyOnRails: ("WeeChat 1.9")
[06:33:53] conta: has joined #RubyOnRails
[06:35:26] fschuindt: has joined #RubyOnRails
[06:36:35] planigan: has joined #RubyOnRails
[06:51:19] ferr: has joined #RubyOnRails
[07:13:39] bronson: has joined #RubyOnRails
[07:15:24] bronson: has joined #RubyOnRails
[07:26:49] srinidhi: has joined #RubyOnRails
[07:28:00] crst: I have an association chain: Users->Elements->Subelements. Now, current_user.subelements takes all subelements (of all users instead of just the current_one) What am I doing wrong? current_user.elements works as intended.
[07:36:48] marr: has joined #RubyOnRails
[07:46:57] apparition: has joined #RubyOnRails
[07:52:25] chouhoulis: has joined #RubyOnRails
[07:54:04] tbuehlmann_: crst: can you gist your models?
[07:54:58] jhfisc: has joined #RubyOnRails
[07:57:51] ams__: has joined #RubyOnRails
[07:58:57] crst: Hi tbuehlmann_, I hope you're well! This is the gist of my models (you are already somewhat familiar with): https://pastebin.com/VaAaJupt
[08:03:48] crst: I created the migrations exactly as instructed here: http://guides.rubyonrails.org/association_basics.html#the-has-many-through-association
[08:05:01] jhfisc: has joined #RubyOnRails
[08:09:57] tetraktys: has joined #RubyOnRails
[08:10:27] jhfisc: has joined #RubyOnRails
[08:10:32] crst: gotta go for an hour or two. I'll be back then bye!
[08:13:45] mikecmpbll: has joined #RubyOnRails
[08:18:48] jhfisc: has joined #RubyOnRails
[08:29:58] Sylario: has joined #RubyOnRails
[08:33:37] jhfisc: has joined #RubyOnRails
[08:37:30] lxsameer: has joined #RubyOnRails
[08:52:54] ur5us: has joined #RubyOnRails
[08:55:47] xhoy: has joined #RubyOnRails
[08:56:34] shilon: has joined #RubyOnRails
[09:03:53] paranoicsan: has joined #RubyOnRails
[09:04:47] jhfisc: has joined #RubyOnRails
[09:09:46] arBmind: has joined #RubyOnRails
[09:10:59] jhfisc: has joined #RubyOnRails
[09:15:55] bronson: has joined #RubyOnRails
[09:18:51] cagomez: has joined #RubyOnRails
[09:22:29] ur5us: has joined #RubyOnRails
[09:25:36] jhfisc: has joined #RubyOnRails
[09:34:54] shilon: hello everyone, how can I increment a value on a attribute?
[09:37:41] srinidhi: has joined #RubyOnRails
[09:37:49] tbuehlmann_: you could call your_model.increment(:attribute, 42)
[09:38:58] crst: has joined #RubyOnRails
[09:41:17] crst: Hi, I'm back. tbuehlmann_: In console when I do User.find(3).topups.count that works. But not in the controller with current_user. Have you an idea why this could be?
[09:41:50] jhfisc: has joined #RubyOnRails
[09:43:33] shilon: tbuehlmann_: not working
[09:44:12] shilon: tbuehlmann_: don’t need to do your_model.save?
[09:44:39] jhfisc: has joined #RubyOnRails
[09:45:33] shilon: nice, had to save :)
[09:46:04] tbuehlmann_: crst: can you gist your code and the error message?
[09:48:09] tbuehlmann_: Shilon: you can also call your_model.attribute += 42, but that only works if attribute is already a number
[09:51:00] jhfisc: has joined #RubyOnRails
[09:52:08] crst: tbuehlmann_: oh man, I've just seen that the var is overwritten later with current_user.topups.find_by_sql("SELECT * FROM topups"). Unbelieveable. Thank you anyways! Btw. would you put permissions in the model to absolutely prevent a user from seeing info from other users? I've read something about keeping controllers small and models big.
[09:53:45] tbuehlmann_: crst: no, I wouldn't. permissions shouldn't be part of the user model
[09:54:37] tbuehlmann_: I like the pundit gem, which has policies for managing authorization
[09:54:38] crst: tbuehlmann_: ok, thanks for this info, helps me a lot.
[09:55:44] crst: ah, that's similar to cancan, right?
[09:56:06] tbuehlmann_: similar in that they both try to solve authorization, yeah
[09:56:47] Sylario: cancan(can?) is nice authorization, pundit is where you go whan cancan(can?) is not enough
[09:56:56] Sylario: I like pundit a lot
[09:58:01] crst: ah cool so it's even better. I was just shortly before implementing cancan. I will use pundit now.
[09:58:06] Sylario: I have a particular fondness for the scope of pundit
[09:58:35] Sylario: If your need are not that complexe, cancancan is enough
[09:59:33] crst: is it for noobs as easy to implement for simple scenarios?
[10:02:05] Sylario: watch the raislcast about authorisation
[10:02:26] Sylario: the original author of cancan is the railscast guy
[10:02:56] jhfisc: has joined #RubyOnRails
[10:04:46] milesmatthias: has joined #RubyOnRails
[10:05:01] cabotto: has joined #RubyOnRails
[10:08:59] jhfisc: has joined #RubyOnRails
[10:14:22] sevenseacat: has joined #RubyOnRails
[10:14:40] jhfisc: has joined #RubyOnRails
[10:16:22] roshanavand: has joined #RubyOnRails
[10:17:40] jhfisc: has joined #RubyOnRails
[10:17:56] shilon: tbuehlmann_: thanks :)
[10:20:42] arBmind: has joined #RubyOnRails
[10:23:00] jhfisc: has joined #RubyOnRails
[10:24:22] cabotto: has left #RubyOnRails: ()
[10:27:53] beilabs: has joined #RubyOnRails
[10:28:58] jhfisc: has joined #RubyOnRails
[10:30:22] cabotto: has joined #RubyOnRails
[10:31:51] arBmind: has joined #RubyOnRails
[10:32:20] jhfisc: has joined #RubyOnRails
[10:37:58] tacoboy: has joined #RubyOnRails
[10:41:21] tetraktys: has joined #RubyOnRails
[10:46:41] jhfisc: has joined #RubyOnRails
[10:48:38] alfiemax: has joined #RubyOnRails
[10:53:05] apparition47: has joined #RubyOnRails
[10:57:18] jhfisc: has joined #RubyOnRails
[11:00:35] arup_r: has joined #RubyOnRails
[11:00:58] jhfisc: has joined #RubyOnRails
[11:01:56] arup_r: I have to enable log rotation in production. So I found some tips in internet like http://yukas.by/rails/logs/rotate/logrotate/2015/11/05/how-to-rotate-rails-logs/ .. I like the Rails way of doing it. But can't I use ActiveSupport::Logger instead of Logger?
[11:03:48] conta: has joined #RubyOnRails
[11:05:41] milesmatthias: has joined #RubyOnRails
[11:09:00] high_fiver: has joined #RubyOnRails
[11:11:30] Jameser: has joined #RubyOnRails
[11:12:26] jhfisc: has joined #RubyOnRails
[11:13:16] zacts: has joined #RubyOnRails
[11:15:43] jhfisc: has joined #RubyOnRails
[11:17:41] bronson: has joined #RubyOnRails
[11:19:21] cabotto: has joined #RubyOnRails
[11:20:57] jhfisc: has joined #RubyOnRails
[11:21:41] davic: has joined #RubyOnRails
[11:24:06] shilon: hey, I have a model with 2 attributes, invitations_limit and invitations_used. I’m trying to add bootstrap progressbar to work with these values. I need to pass invitations_limit as 100% so I can inject style="width: %” dynamically. Is it possibe to do this?
[11:24:52] tbuehlmann_: Shilon: sure. what problem do you face right now?
[11:25:34] shilon: tbuehlmann_: width is always 5% because invitations_limit is currently 5…
[11:26:59] tbuehlmann_: and the progress is supposed to be invitations_used divided by invitations_limit?
[11:27:13] Ergo: has joined #RubyOnRails
[11:29:48] arBmind: has joined #RubyOnRails
[11:34:14] tbuehlmann_: so this is the answer then? just use invitations_used/invitations_limit as the progress %
[11:36:44] shilon: tbuehlmann_: no, it gives me 0
[11:36:57] bruno-: has joined #RubyOnRails
[11:37:07] crst_: has joined #RubyOnRails
[11:37:30] sevenseacat: sounds like you arent dividing it correctly
[11:37:34] sevenseacat: got some code?
[11:37:57] arBmind: has joined #RubyOnRails
[11:38:19] tbuehlmann_: maybe turn integers to float or something, code would surely help
[11:38:19] shilon: I want to have invitations_limit as 100% and everyime I add a user I want to remove 1 from limit and add 1 to count
[11:38:30] sevenseacat: thats not code
[11:40:42] shilon: https://gist.github.com/jamesalbuquerque/f458f24a49e8e9ebbd49c44ac2968638
[11:45:33] sevenseacat: aye, looks like youre doing integer division
[11:46:53] srinidhi: has joined #RubyOnRails
[11:47:29] shilon: sevenseacat: should I do to_f?
[11:48:05] sevenseacat: its always quicker to try it first, and you might just learn something
[11:48:09] shilon: it gives me 5%
[11:52:02] jsrn: I've removed fixtures :all from my test_helper.rb so I can pre-load my fixtures and use transactions, but now my fixture accessors e.g. books(:book_name) are coming up as method undefined. Is there something obvious I'm doing wrong?
[11:52:18] sevenseacat: thats what you wanted, no?
[11:52:54] jsrn: I don't want to re-seed the database every test, but I'd still like to be able to select a record by name
[11:56:28] kitsuneyo: has joined #RubyOnRails
[11:56:43] roshanavand: has joined #RubyOnRails
[12:00:30] tpendragon: has joined #RubyOnRails
[12:01:54] shilon: sevenseacat: think what I needed was this @invitations_available = (Float(@invitations_limit - @invitations_used) / @invitations_limit * 100).ceil
[12:03:18] shilon: :P still need to test it
[12:04:22] sevenseacat: write some tests, for sure :)
[12:11:46] kitsuneyo: has joined #RubyOnRails
[12:13:30] jhfisc: has joined #RubyOnRails
[12:21:48] jhfisc: has joined #RubyOnRails
[12:23:28] kitsuneyo: has joined #RubyOnRails
[12:27:01] jhfisc: has joined #RubyOnRails
[12:30:41] dionysus70: has joined #RubyOnRails
[12:35:58] blitz: has joined #RubyOnRails
[12:35:58] jhass: has joined #RubyOnRails
[12:35:59] sunya7a: has joined #RubyOnRails
[12:35:59] lupine: has joined #RubyOnRails
[12:35:59] DrYockel: has joined #RubyOnRails
[12:35:59] daemonwrangler: has joined #RubyOnRails
[12:35:59] tanuki: has joined #RubyOnRails
[12:36:00] gusrub: has joined #RubyOnRails
[12:36:00] keegnotrub: has joined #RubyOnRails
[12:36:00] Gm4n: has joined #RubyOnRails
[12:39:53] alfie: has joined #RubyOnRails
[12:40:23] jhfisc: has joined #RubyOnRails
[12:42:03] tekk: has joined #RubyOnRails
[12:42:50] lupine: how do you check which option in a select box is selected without recourse to the hidden value?
[12:42:54] lupine: (rspec, capybara)
[12:43:15] lupine: `have_text` doesn't work because all the text values are in the select :/
[12:45:51] jhfisc: has joined #RubyOnRails
[12:48:51] mtkd: has joined #RubyOnRails
[12:54:07] kitsuneyo: has joined #RubyOnRails
[12:58:51] jhfisc: has joined #RubyOnRails
[13:04:01] jhfisc: has joined #RubyOnRails
[13:04:28] syndikate: Hello people, I am trying webpack and yarn with rails. I was able to include bootstrap but not jquery. What is the way to include jquery? I tried most of the available methods found via googling
[13:04:31] syndikate: still failed
[13:16:48] cabotto: has joined #RubyOnRails
[13:17:10] jhfisc: has joined #RubyOnRails
[13:17:55] conta: guys, I have <meta name="csrf-token" content="uNK750689T4FUAENU3Bflnt57cgT93KLUAOr5Hw2bpFEVHUZiBrlAK5D6ZMc+YsWiZ8SPjUFLwGSQ2wSa7mDZQ==">
[13:18:24] conta: in params I have "authenticity_token"=>"uNK750689T4FUAENU3Bflnt57cgT93KLUAOr5Hw2bpFEVHUZiBrlAK5D6ZMc+YsWiZ8SPjUFLwGSQ2wSa7mDZQ=="
[13:18:38] conta: and I am getting ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken):
[13:18:44] conta: what am I missing here?
[13:18:50] syndikate: Are you making any AJAX calls?
[13:19:07] conta: I am using fetch, so kind of
[13:19:25] conta: I also set X-CSRF-Token header
[13:19:31] syndikate: You need to the X-CSRF_TOKEN
[13:19:44] syndikate: What did you set it as?
[13:19:47] bronson: has joined #RubyOnRails
[13:19:58] conta: uNK750689T4FUAENU3Bflnt57cgT93KLUAOr5Hw2bpFEVHUZiBrlAK5D6ZMc+YsWiZ8SPjUFLwGSQ2wSa7mDZQ==
[13:20:18] syndikate: Are you fetching it dynamically?
[13:20:44] syndikate: Could you share the gist where you are fetching the CSRF token and adding it to the header?
[13:21:08] tycoon177: i have a really stupid question, but if at all possible, i'd like to get it to work. i've been using postgresql for my test db even though we use mssql in production (due to some requirements of some 3rd party software that i cannot change) now on rails 4, it chokes on setting up the test db with smalldatetime because that is something that mssql has but postgres does not. is there a way that i can force this to be a full
[13:21:08] tycoon177: date in test?
[13:21:20] jhfisc: has joined #RubyOnRails
[13:22:03] bronson: has joined #RubyOnRails
[13:22:41] conta: syndikate: I will. maybe problem is that it has it as x-csrf-token, not X-CSRF-Token?
[13:24:10] syndikate: conta: Try?
[13:25:24] conta: Well I set is as X-... but in browser it is x-...
[13:26:10] conta: here is gist: https://gist.github.com/hovancik/65b844c1cefa9f741b73dc2feeb7606a
[13:30:26] syndikate: Not big in JS here, but can you do a console.log on this body.get('authenticity_token') and see if you are getting the same token as in the page source?
[13:30:58] syndikate: I was doing some ajax earlier and this is how I did it.
[13:31:11] syndikate: `token = $('meta[name=csrf-token]').attr('content’)`
[13:31:12] jhfisc: has joined #RubyOnRails
[13:31:35] conta: I checked meta in head, in form and in headers and it is the same
[13:37:20] splitshot: has joined #RubyOnRails
[13:37:39] jhfisc: has joined #RubyOnRails
[13:41:20] splitshot: Hey all. Is there a way to specify a has_many through relationship using 2 separate join models? i.e. foo has_many bars through [:baz, other_baz]
[13:41:55] splitshot: As in, the relationship between foo and bar may be a "baz" or an "other_baz"
[13:43:20] tycoon177: splitshot: are you asking about foo > baz > other_baz > bars? or foo > baz & other_baz > bars?
[13:43:59] jhfisc: has joined #RubyOnRails
[13:45:06] splitshot: foo > baz & other_baz > bars I think.
[13:45:45] splitshot: foo > baz || other_baz > bars
[13:46:44] splitshot: I considered creating my own method to combine the results of both has_many through relationship
[13:47:54] Doldge: has joined #RubyOnRails
[13:50:22] syndikate: conte: I am not sure then, can’t really help unless I see the full code.
[13:50:43] roshanavand: has joined #RubyOnRails
[13:51:44] jhfisc: has joined #RubyOnRails
[13:53:55] chouhoulis: has joined #RubyOnRails
[13:56:52] conta: well it's simple form with email field
[13:57:22] jhfisc: has joined #RubyOnRails
[14:07:32] pankaj: has joined #RubyOnRails
[14:08:19] pankaj: I am unable to use bootstrap glyphs in rails. What should I do?
[14:13:31] jhfisc: has joined #RubyOnRails
[14:14:45] AzaToth: has joined #RubyOnRails
[14:21:32] dblessing: has joined #RubyOnRails
[14:25:02] mars777: has joined #RubyOnRails
[14:28:48] cloutz: has joined #RubyOnRails
[14:29:55] jhfisc: has joined #RubyOnRails
[14:39:50] chouhoulis: has joined #RubyOnRails
[14:42:26] bruno-: has joined #RubyOnRails
[14:44:54] chouhoulis: has joined #RubyOnRails
[14:48:02] truenito: has joined #RubyOnRails
[14:49:42] truenito: has joined #RubyOnRails
[14:51:21] tacoboy: has joined #RubyOnRails
[14:53:09] tetraktys: has joined #RubyOnRails
[14:53:50] fschuindt: has joined #RubyOnRails
[14:59:29] kapil___: has joined #RubyOnRails
[15:09:19] dviola: has joined #RubyOnRails
[15:19:48] jhfisc: has joined #RubyOnRails
[15:21:23] milesmatthias: has joined #RubyOnRails
[15:22:50] bronson: has joined #RubyOnRails
[15:27:57] cagomez: has joined #RubyOnRails
[15:36:29] milesmatthias: has joined #RubyOnRails
[15:37:17] milesmatthias: has joined #RubyOnRails
[15:37:26] cagomez: has joined #RubyOnRails
[15:37:29] [Butch]: has joined #RubyOnRails
[15:38:11] milesmatthias: has joined #RubyOnRails
[15:39:20] milesmatthias: has joined #RubyOnRails
[15:44:49] jhfisc: has joined #RubyOnRails
[15:48:11] milesmatthias: has joined #RubyOnRails
[15:54:54] kapil___: Hello, I have already existing polymorphic product line itmes that belongs to sale model. How can I associate it with cocoon gem? I not want to create new products I have already, that I want to use.
[15:56:43] jhfisc: has joined #RubyOnRails
[16:01:20] roshanavand: has joined #RubyOnRails
[16:04:32] pro777: has joined #RubyOnRails
[16:04:33] banisterfiend: has joined #RubyOnRails
[16:05:17] roshanavand: has joined #RubyOnRails
[16:07:03] FrostCandy: has joined #RubyOnRails
[16:08:08] jhfisc: has joined #RubyOnRails
[16:12:40] platoon23: has joined #RubyOnRails
[16:14:35] zacts: has joined #RubyOnRails
[16:17:35] jhfisc: has joined #RubyOnRails
[16:19:47] fschuindt: has joined #RubyOnRails
[16:20:28] truenito: has joined #RubyOnRails
[16:23:44] jhfisc: has joined #RubyOnRails
[16:25:00] roshanavand: has joined #RubyOnRails
[16:26:47] rakm: has joined #RubyOnRails
[16:33:00] jhfisc: has joined #RubyOnRails
[16:37:25] dionysus69: has joined #RubyOnRails
[16:38:27] fschuindt: has joined #RubyOnRails
[16:40:37] mtkd: has joined #RubyOnRails
[16:41:10] bruno-_: has joined #RubyOnRails
[16:50:16] roshanavand: has joined #RubyOnRails
[16:52:31] truenito: has joined #RubyOnRails
[16:55:58] mtkd: has joined #RubyOnRails
[16:57:42] cagomez: has joined #RubyOnRails
[16:58:11] cagomez: has joined #RubyOnRails
[17:00:15] gusrub_: has joined #RubyOnRails
[17:02:43] one_zero: has joined #RubyOnRails
[17:06:04] milesmatthias: has joined #RubyOnRails
[17:06:51] milesmatthias: has joined #RubyOnRails
[17:08:08] milesmatthias: has joined #RubyOnRails
[17:17:52] crst: has joined #RubyOnRails
[17:20:33] alfiemax: has joined #RubyOnRails
[17:24:23] bronson: has joined #RubyOnRails
[17:25:32] jhfisc: has joined #RubyOnRails
[17:27:52] username1: has joined #RubyOnRails
[17:29:36] shilon: has joined #RubyOnRails
[17:30:15] Anubix: has joined #RubyOnRails
[17:31:57] kies: has joined #RubyOnRails
[17:34:47] milesmatthias: has joined #RubyOnRails
[17:36:13] FrostCandy: I put a method in my application_controller.rb file and my landing_page_controller.rb says the method is undefined, but class LandingPageController < ApplicationController suggests LandingPage shoudl be able to see it.
[17:36:39] FrostCandy: LandingPage should inherit the methods in my application controller right?
[17:39:00] Anubix: I have two types of urls /north-america/california and /north-america/california/san--francisco and i need to redirect it 301 to new urls like /north-america/usa/california and /north-america/usa/california/san-francisco
[17:39:09] Anubix: get '/north-america/:country(/:town)', to: redirect('/north-america/usa/%{country}/%{town}', status: 301)
[17:39:13] matthewd: FrostCandy: Yes. Gist the files?
[17:39:16] Anubix: I am trying this but it doesnt work correctly
[17:40:39] FrostCandy: matthewd: gem install gist you mean?
[17:40:47] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[17:41:35] FrostCandy: Oh, you mean share it
[17:42:48] Anubix: https://gist.github.com/anonymous/bd711e7268194c346749be877b2d7d26
[17:44:30] Anubix: it works only for /country/town in url, for only country it throw error key{town} not found but it is set as optional parameter
[17:45:47] FrostCandy: Yup, it's ok. They wont let me share code even though it's boiler plate. I'm sure it's a minor mistake on my end I'll continue researching.
[17:47:05] rakm: has joined #RubyOnRails
[17:53:26] cagomez: has joined #RubyOnRails
[17:54:53] roshanavand: has joined #RubyOnRails
[18:02:05] cagomez: has joined #RubyOnRails
[18:11:11] shilon: has joined #RubyOnRails
[18:11:48] milesmatthias: has joined #RubyOnRails
[18:12:37] milesmatthias: has joined #RubyOnRails
[18:13:24] milesmatthias: has joined #RubyOnRails
[18:14:29] milesmatthias: has joined #RubyOnRails
[18:15:40] beilabs: has joined #RubyOnRails
[18:17:32] jhfisc: has joined #RubyOnRails
[18:18:52] lxsameer: has joined #RubyOnRails
[18:28:47] jhfisc: has joined #RubyOnRails
[18:34:05] DoctorMonocular: has joined #RubyOnRails
[18:34:11] DoctorMonocular: hey everyone, been a while
[18:34:21] DoctorMonocular: is Pundit still the authorization gem that cool kids use?
[18:34:25] DoctorMonocular: is there something better now?
[18:34:53] jhfisc: has joined #RubyOnRails
[18:36:09] cagomez: has joined #RubyOnRails
[18:42:02] jhfisc: has joined #RubyOnRails
[18:48:20] FrostCandy: https://code.sololearn.com/cQhM3GfcrFot/#rb - why isn't my method under the landingpage controller running the method from its parent class?
[18:50:54] mars777: has joined #RubyOnRails
[18:53:29] dionysus69: has joined #RubyOnRails
[18:56:29] FrostCandy: Wait, do all parent methods being used in the chile need to be aliased or re-defined?
[18:56:54] roshanavand: has joined #RubyOnRails
[19:02:48] cagomez: has joined #RubyOnRails
[19:06:23] workmad3: has joined #RubyOnRails
[19:08:05] gambl0re: has joined #RubyOnRails
[19:11:22] milesmatthias: has joined #RubyOnRails
[19:15:22] Mia: has joined #RubyOnRails
[19:24:30] dblessing: has joined #RubyOnRails
[19:26:11] bronson: has joined #RubyOnRails
[19:33:42] milesmatthias: has joined #RubyOnRails
[19:34:47] milesmatthias: has joined #RubyOnRails
[19:35:46] milesmatthias: has joined #RubyOnRails
[19:37:11] daveomcd: has joined #RubyOnRails
[19:40:58] DoctorMonocular: has joined #RubyOnRails
[19:41:04] DoctorMonocular: FrostCandy: hey, did you get an answer?
[19:41:12] DoctorMonocular: there are a couple problems with the code you posted
[19:41:43] DoctorMonocular: I can help you if you didn't already get help
[19:44:38] mostlybadfly: has joined #RubyOnRails
[19:53:41] FrostCandy: DoctorMonocular: I'm still trying to work out how to call my method. :D
[19:54:02] matthewd: FrostCandy: You're defining an instance method, but not calling it on an instance
[19:54:14] FrostCandy: create method should be like def bar puts "bar!" end, then call it like bar but that doesn't want to work
[19:54:26] FrostCandy: oh let me think about that
[19:55:45] FrostCandy: so you're saying i'd need to do a a = new LandingPage, then I could call a.findMethod
[19:56:20] DoctorMonocular: or if you defined it like self.findMethod, then you could call it on the class level
[19:56:45] matthewd: Also, don't use camelcase
[19:56:52] DoctorMonocular: yeah, seriouslu
[19:57:32] FrostCandy: lol oh ya? no camel's then :(
[19:59:17] FrostCandy: DoctorMonocular: https://code.sololearn.com/cQhM3GfcrFot/#rb
[19:59:57] DoctorMonocular: matthewd: hey quick advice. There's a guy at work who's coming from a more traditional server background and wants to know about cron jobs with rails apps... of course it's possible, but I'm inclined to recommend he uses the job queue for things like that. If not that, then at least something like the `whenever` gem. What do you think?
[20:00:51] milesmatthias: has joined #RubyOnRails
[20:01:10] FrostCandy: I wonder if i'm the guy at work. No cron. check .
[20:01:15] DoctorMonocular: sorry for the dump
[20:01:42] FrostCandy: Oh, outside of the class.
[20:02:18] DoctorMonocular: the outside thing is just where I called it
[20:02:29] DoctorMonocular: def self.foo defines a class method
[20:03:51] matthewd: DoctorMonocular: Yeah, I'd use the job queue to do the work, because that saves booting the app etc. Given a non-app-booting approach to get the job enqueued, relying on cron for the actual schedule isn't unreasonable.
[20:04:57] DoctorMonocular: I suspect he'll be better served by responding to actual events than the polling/cron thing he's used to, but we haven't gotten into the weeds with stuff yet
[20:05:12] username1: has joined #RubyOnRails
[20:12:30] FrostCandy: DoctorMonocular: & matthewd: I think I understood everythign you told me about how to implement my methods. But skip_authorization_check is called just after the class. Does using Gems throw needing to identify the class it comes with out the window?
[20:13:08] FrostCandy: skip_authorization_check is a CanCan gem method
[20:13:25] FrostCandy: ok let me try to recode it quick
[20:14:07] matthewd: FrostCandy: You want to identify a method on the controller class, not an instance
[20:14:22] FrostCandy: https://code.sololearn.com/cQhM3GfcrFot/#rb
[20:14:26] matthewd: FrostCandy: So you need to define your method also on the class, using `def self.foo` as DoctorMonocular said
[20:15:02] matthewd: FrostCandy: Or just do the puts right there... it doesn't seem like a particularly useful method to define tbh
[20:16:07] FrostCandy: matthewd: not useful, but was just trying to see how it worked. just having skip_authorization_check right after the class is created (in code not instantiated) is confusing me
[20:16:53] FrostCandy: I know skip_authorization_check is a method becaus i used that command you told me about that told me it was a method that came from the CanCan gem
[20:17:05] matthewd: It's a class method
[20:17:08] matthewd: It's a method on the class
[20:17:22] DoctorMonocular: yeah Cancan defines skip_authorization_check as a method on the ApplicationController class, or a class that's upstream of it
[20:17:27] DoctorMonocular: so you can call it from there
[20:18:01] matthewd: `LandingPageController.skip_authorization_check`, like `LandingPageController.superclass`
[20:18:14] spheric_: has joined #RubyOnRails
[20:19:05] matthewd: (and unlike #index, which is [approximately] `LandingPageController.new.index`)
[20:19:07] FrostCandy: hmm actually i should be able to look up the CanCan code and see for myself how they craeted the method :)
[20:19:42] matthewd: There are probably modules involved which may cloud the matter
[20:20:17] matthewd: Focus on your Gah/foo example, and the difference between `def foo` and `def self.foo`
[20:20:59] gusrub: has joined #RubyOnRails
[20:23:29] FrostCandy: Basicaly if it has self. then I can call it from anywhere like a static method, but if it's just def foo then I can only call it from the instantiated object yes?
[20:24:28] FrostCandy: ah i'll look up ruby self. that will probalby help hehe
[20:25:21] cagomez: has joined #RubyOnRails
[20:25:46] daveomcd: I downgraded my bundler from 1.15.4 to 1.15.3, but i can't get my gemfile.lock to show 1.15.3 at the bottom instead of 1.15.4 -- how can i force it to re build?
[20:26:21] ahrs: has joined #RubyOnRails
[20:26:52] matthewd: FrostCandy: Yes, `def self.foo` is approximately a static method
[20:28:15] matthewd: daveomcd: Change it manually, delete the file, or possibly force some other change
[20:31:08] FrostCandy: matthewd: yup great. I'm under the assumption skip_authoirzation_check is self.skip_authiorzation_check in the parent class seeing as it doesn't throw an erorr like my attempt at a class was initially.
[20:33:10] jhfisc: has joined #RubyOnRails
[20:39:54] ur5us: has joined #RubyOnRails
[20:40:06] rakm: has joined #RubyOnRails
[20:40:54] moei: has joined #RubyOnRails
[21:02:17] milesmatthias: has joined #RubyOnRails
[21:04:47] weathermaker: has joined #RubyOnRails
[21:04:47] jhfisc: has joined #RubyOnRails
[21:10:58] jhfisc: has joined #RubyOnRails
[21:16:34] arBmind: has joined #RubyOnRails
[21:23:12] jhfisc: has joined #RubyOnRails
[21:23:21] mr-spoon: has joined #RubyOnRails
[21:24:25] shilon: has joined #RubyOnRails
[21:24:55] cam27: has joined #RubyOnRails
[21:26:10] cagomez: has joined #RubyOnRails
[21:26:33] cam27: Do people use turbolinks along with Angular? Or are they both serving too similar of a purpose?
[21:26:46] cagomez: has joined #RubyOnRails
[21:28:15] bronson: has joined #RubyOnRails
[21:29:40] jhfisc: has joined #RubyOnRails
[21:38:09] shilon: has joined #RubyOnRails
[21:41:18] cloutz: has joined #RubyOnRails
[21:42:26] cagomez: has joined #RubyOnRails
[21:42:48] kapil___: has joined #RubyOnRails
[21:46:02] kapil___: Hello, I have already existing polymorphic product line itmes that belongs to sale model. How can I associate it with cocoon gem? I not want to create new products I have already, that I want to use.
[21:47:42] jhfisc: has joined #RubyOnRails
[21:47:51] cam27: I found an answer to my above question, which says skip sring and turbolinks on app’s setup, cause turbolinks will clash with our js and spring has a lot of issues
[21:50:17] cam27: has joined #RubyOnRails
[21:53:41] jhfisc: has joined #RubyOnRails
[21:58:33] zephiro: has joined #RubyOnRails
[22:04:09] DoctorMonocular: I'm confused about how the kaminari remote: true works
[22:04:26] DoctorMonocular: I assume it only works if the routes are RESTful and can respond to json?
[22:04:37] DoctorMonocular: there's no real documentation about it anywhere though
[22:05:02] volte: has joined #RubyOnRails
[22:07:02] jhfisc: has joined #RubyOnRails
[22:08:15] volte: Howdy folks. Quick question. (I've googled for "Rails Engine autoload_path order"). I've got a rails Engine that I want loaded into a larger rails app, but I want all the models etc there loaded first. I've tried adding them in the Rails::Engine Engine class. I want this so that I can further override/extend in the main Rails app. Here's the Engine file (as you can see I've
[22:08:15] volte: tried lots of things haha) https://gist.github.com/voltechs/6569b75d99709be5cc679ee88629b716
[22:09:31] volte: I could have sworn I had it working at one point but I didn't commit haha (facepalm)
[22:14:41] jhfisc: has joined #RubyOnRails
[22:15:18] milesmatthias: has joined #RubyOnRails
[22:20:57] jhfisc: has joined #RubyOnRails
[22:23:51] cagomez: has joined #RubyOnRails
[22:26:17] ascarter: has joined #RubyOnRails
[22:26:59] volte: has left #RubyOnRails: ("Peace")
[22:28:18] eckesicle: has joined #RubyOnRails
[22:28:46] jhfisc: has joined #RubyOnRails
[22:29:35] popopopo: has joined #RubyOnRails
[22:34:58] jhfisc: has joined #RubyOnRails
[22:39:50] AntiSpamMeta: has joined #RubyOnRails
[22:40:58] jhfisc: has joined #RubyOnRails
[22:43:23] rakm: has joined #RubyOnRails
[22:44:09] jhfisc: has joined #RubyOnRails
[22:44:11] popopopo: has joined #RubyOnRails
[22:45:18] ams__: has joined #RubyOnRails
[22:45:51] AntiSpamMeta: has joined #RubyOnRails
[22:51:08] DoctorMonocular: yeah I can't seem to figure this out
[22:51:15] DoctorMonocular: I looked at the kaminari code
[22:51:24] DoctorMonocular: found the place where you pass the remote: option in
[22:51:32] DoctorMonocular: it gets passed to Paginator
[22:51:39] DoctorMonocular: then Paginator doesn't do anything with it at all
[22:51:49] DoctorMonocular: that's hte only place I can find it, so I'm stumped
[22:52:55] DoctorMonocular: I guess maybe it's just passing the data-remote attr to the link tag, and rails is supposed to handle the rest somehow?
[22:54:07] Shilon_: has joined #RubyOnRails
[22:54:11] jhfisc: has joined #RubyOnRails
[22:59:24] jhfisc: has joined #RubyOnRails
[22:59:31] mtkd: has joined #RubyOnRails
[23:04:47] cagomez: has joined #RubyOnRails
[23:07:13] jhfisc: has joined #RubyOnRails
[23:09:07] MrPunkin: has joined #RubyOnRails
[23:10:56] mikecmpbll: has joined #RubyOnRails
[23:11:11] rakm: has joined #RubyOnRails
[23:16:02] brent__: has joined #RubyOnRails
[23:19:04] jhfisc: has joined #RubyOnRails
[23:21:43] zephiro: has joined #RubyOnRails
[23:24:59] jhfisc: has joined #RubyOnRails
[23:30:22] bronson: has joined #RubyOnRails
[23:30:58] jhfisc: has joined #RubyOnRails
[23:34:03] jhfisc: has joined #RubyOnRails
[23:40:48] aperkins81: has joined #RubyOnRails
[23:41:58] matthewd: DoctorMonocular: Yes, remote:true is handled client-side by prototype-/jquery-/rails-ujs, based on the presence of the attribute
[23:42:32] DoctorMonocular: matthewd: do you know some details about how it works? Like, is it smart enough to figure it out if the endpoint returns html?
[23:42:42] DoctorMonocular: I'm confused about how it works internally
[23:45:04] jhfisc: has joined #RubyOnRails
[23:48:09] matthewd: Not really, sorry. I remember it does an AJAX request, and then does something appropriate with whatever response it gets... but not exactly how it defines appropriate.
[23:48:28] DoctorMonocular: got it, alright
[23:48:31] DoctorMonocular: thanks anyway :)
[23:52:31] bruno-: has joined #RubyOnRails
[23:56:25] dionysus69: has joined #RubyOnRails
[23:57:36] SteenJobs: has joined #RubyOnRails