« Back to channel list

#RubyOnRails - 26 July 2017

« Back 1 day Forward 1 day »
[00:01:15] jhfisc: has joined #RubyOnRails
[00:06:38] cagomez: has joined #RubyOnRails
[00:07:14] umaaji: has joined #RubyOnRails
[00:08:48] jhfisc: has joined #RubyOnRails
[00:13:38] spheric: has joined #RubyOnRails
[00:15:14] jhfisc: has joined #RubyOnRails
[00:17:58] rfoust: has joined #RubyOnRails
[00:21:52] umaaji: has joined #RubyOnRails
[00:22:10] SilentNinja1: has joined #RubyOnRails
[00:22:45] SilentNinja1: Hi, I'm using RVM running ruby-2.4.1, when I run bundle exec --verbose rake db:create
[00:23:13] SilentNinja1: I get the following error msg:
[00:23:16] jhfisc: has joined #RubyOnRails
[00:23:56] SilentNinja1: https://hastebin.com/baqeroxodi.coffeescript
[00:24:23] SilentNinja1: bundle is installed, not sure why I would get this error message.
[00:24:36] SilentNinja1: any help would be appreciated.
[00:26:10] eelster: Are you sure you have bundler installed globally/in that specific dir?
[00:26:45] knight33: has joined #RubyOnRails
[00:27:08] mustmodify: has left #RubyOnRails: ()
[00:28:07] jhfisc: has joined #RubyOnRails
[00:28:09] cagomez: has joined #RubyOnRails
[00:28:28] nahtnam: has joined #RubyOnRails
[00:32:00] Radar: SilentNinja1: does running "gem install bundler" fix that problem?
[00:32:59] jhfisc: has joined #RubyOnRails
[00:33:43] SilentNinja1: Hmm, OK I'll try that thanks
[00:39:19] jhfisc: has joined #RubyOnRails
[00:42:40] mtkd: has joined #RubyOnRails
[00:42:42] bronson: has joined #RubyOnRails
[00:44:40] rakm: has joined #RubyOnRails
[00:56:04] Radar: SilentNinja1: did that fix your problem?
[00:56:27] sevenseacat: has joined #RubyOnRails
[00:59:02] quazimodo: has joined #RubyOnRails
[00:59:31] Radar: What is happening now?
[00:59:40] Radar: probably rvm is to blame (as usual)
[00:59:48] Radar: http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you
[00:59:54] Radar: http://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you
[01:00:05] Radar: Follow that guide. I don't know how to install it on centos but I'm sure you can work it out.
[01:00:08] Radar: rvm implode --force first
[01:00:25] SilentNinja1: what does rvm implode do?
[01:00:54] SilentNinja1: removes are versions of ruby?
[01:02:04] brent__: has joined #RubyOnRails
[01:05:08] Radar: It removes RVM.
[01:09:14] npgm: has joined #RubyOnRails
[01:26:37] happygilmoregent: has joined #RubyOnRails
[01:30:09] jhfisc: has joined #RubyOnRails
[01:43:24] bronson: has joined #RubyOnRails
[01:51:18] Dreamer3_: has joined #RubyOnRails
[01:51:24] jhfisc: has joined #RubyOnRails
[01:53:26] Jameser: has joined #RubyOnRails
[02:01:29] jhfisc: has joined #RubyOnRails
[02:05:11] fcser_: has joined #RubyOnRails
[02:08:54] jhfisc: has joined #RubyOnRails
[02:15:17] rakm: has joined #RubyOnRails
[02:17:12] jhfisc: has joined #RubyOnRails
[02:19:56] fl4sh_: has joined #RubyOnRails
[02:22:32] jhfisc: has joined #RubyOnRails
[02:24:48] mtkd: has joined #RubyOnRails
[02:27:06] Chernobuk: has joined #RubyOnRails
[02:31:16] Heyo: has joined #RubyOnRails
[02:35:10] jhfisc: has joined #RubyOnRails
[02:40:54] jhfisc: has joined #RubyOnRails
[02:44:15] bronson: has joined #RubyOnRails
[02:46:15] rakm: is it possible to configure a route '/packages/:owner/:name` using the show action in resources? I was hoping something like a param: [:owner, :name] would do it, but I think param only accepts a single item
[02:46:46] rakm: another option is to use the constraints option, but i'm not sure if i'm missing something better
[02:47:23] jhfisc: has joined #RubyOnRails
[02:48:07] jscheel: has joined #RubyOnRails
[02:51:11] irishfromua: has joined #RubyOnRails
[02:59:59] jhfisc: has joined #RubyOnRails
[03:04:36] fryguy: rakm: create the route outside of the resources block
[03:05:14] jhfisc: has joined #RubyOnRails
[03:08:46] duderonomy: has joined #RubyOnRails
[03:10:52] jhfisc: has joined #RubyOnRails
[03:13:47] sevenseacat: has joined #RubyOnRails
[03:16:21] jhfisc: has joined #RubyOnRails
[03:17:57] duderonomy: has joined #RubyOnRails
[03:21:19] duderono_: has joined #RubyOnRails
[03:25:15] kies: has joined #RubyOnRails
[03:32:51] jhfisc: has joined #RubyOnRails
[03:45:38] bronson: has joined #RubyOnRails
[04:07:16] jhfisc: has joined #RubyOnRails
[04:19:13] sevenseacat: has joined #RubyOnRails
[04:20:02] cam27: I wsa thinking about avoiding using the helpers files, is that good practice?
[04:20:40] sevenseacat: view helper methods should go in helpers
[04:22:46] cam27: Just so they can be tested?
[04:23:12] sevenseacat: well where else would you put view-related logic?
[04:23:44] cam27: in the view
[04:25:13] cam27: what can’t it just go there? Does it slow the page down?
[04:25:51] sevenseacat: and if you want to use the same logic in multiple views?
[04:26:10] cam27: Then it would make sense
[04:26:22] cam27: SO just use them
[04:27:37] jhfisc: has joined #RubyOnRails
[04:30:30] jarray52: has joined #RubyOnRails
[04:30:36] cagomez: has joined #RubyOnRails
[04:34:07] jhfisc: has joined #RubyOnRails
[04:38:37] elcontrastador: has joined #RubyOnRails
[04:40:19] jhfisc: has joined #RubyOnRails
[04:43:52] Dreamer3_: has joined #RubyOnRails
[04:46:28] bronson: has joined #RubyOnRails
[04:51:24] Abhijit: has joined #RubyOnRails
[04:51:41] Abhijit: i found some hamltoerb convertors online. but is there any erbtohaml convertor?
[04:52:47] krmela: has joined #RubyOnRails
[04:54:44] krmela: hello there good morning i have question what means error dynamic constant assignment sources is on https://gist.github.com/anonymous/69d192e712a74a8f5740d68b8cc0bf6a
[04:58:06] Abhijit: I guess its either CZHEADER.map line or START_DAY = :monday
[04:59:13] Abhijit: krmela, https://stackoverflow.com/questions/6712298/dynamic-constant-assignment
[05:00:23] krmela: it is all three constant HEADER = %w[Monday Tuesday Wednesday Thursday Friday Saturday Sunday]
[05:00:23] krmela: CZHEADER = %w[Pondělí Úterý Středa Čtvrtek Pátek Sobota Neděle]
[05:00:23] krmela: START_DAY = :monday
[05:04:14] krmela: Abhijit: well how other way to redeclare it i think i have it declared ontime on class creation as i dont see any mistake
[05:04:22] havenwood: >> require 'date'; Date::DAYNAMES.rotate
[05:12:36] jhfisc: has joined #RubyOnRails
[05:14:37] brent__: has joined #RubyOnRails
[05:17:57] jhfisc: has joined #RubyOnRails
[05:24:31] Abhijit: krmela, sorry was away
[05:24:42] Radar: GOOD AFTERNOON
[05:24:55] Abhijit: krmela, check what havenwood is saying. i have to log off.
[05:28:26] S1kx: has joined #RubyOnRails
[05:28:47] jhfisc: has joined #RubyOnRails
[05:42:59] Tempesta: has joined #RubyOnRails
[05:46:06] Defenestrate: has joined #RubyOnRails
[05:47:17] bronson: has joined #RubyOnRails
[05:50:24] DTZUZO: has joined #RubyOnRails
[05:56:55] roshanavand: has joined #RubyOnRails
[05:58:27] z0mbee: has joined #RubyOnRails
[06:05:25] armyriad: has joined #RubyOnRails
[06:08:56] rakm: has joined #RubyOnRails
[06:10:42] z0mbee: has joined #RubyOnRails
[06:12:21] z0mbee: has left #RubyOnRails: ()
[06:14:33] jarray52: has left #RubyOnRails: ()
[06:18:47] jhfisc: has joined #RubyOnRails
[06:18:51] muzik: has joined #RubyOnRails
[06:22:33] sevenseacat: has joined #RubyOnRails
[06:23:52] jhfisc: has joined #RubyOnRails
[06:29:33] jhfisc: has joined #RubyOnRails
[06:36:38] rakm: has joined #RubyOnRails
[06:37:29] rakm: has joined #RubyOnRails
[06:38:19] rakm: has joined #RubyOnRails
[06:39:03] rakm: has joined #RubyOnRails
[06:39:53] rakm: has joined #RubyOnRails
[06:40:15] jhfisc: has joined #RubyOnRails
[06:42:28] conta: has joined #RubyOnRails
[06:48:07] bronson: has joined #RubyOnRails
[06:53:30] jhfisc: has joined #RubyOnRails
[07:01:15] jhfisc: has joined #RubyOnRails
[07:07:12] testercsgo: has joined #RubyOnRails
[07:07:50] sooli: has joined #RubyOnRails
[07:10:33] testercsgo: Hi all, hopefully this is a simple question :) I have Game model which has_many of gameformat, and gameformat has_one Game. Then model3 has_one game and gameformat. I was wondering how i can prevent users submitting combinations of games and gameformats that do not exist (based on game and gameformat data relationships). I already have this programmed into the front end as a dynamic dropdown, but want to validate in the model.
[07:10:33] testercsgo: Having trouble wording it in a google search. Thanks :)!
[07:12:38] sevenseacat: has joined #RubyOnRails
[07:13:13] muzik: Your drop down list could use java script, so when one is changed, the other dropdown can be checked
[07:14:12] muzik: So, you inject the possible combinations in your javascript, and look for change events on each dropdown. When either is changed, change the other drop down to only allow the valid combinations
[07:14:14] testercsgo: Hi there. Yeah, I have that implemented. But that wouldn't prevent people 'hacking' with developer tools to submit non-existent combos?
[07:14:30] muzik: Same idea in the model, and raise an error
[07:15:07] jhfisc: has joined #RubyOnRails
[07:15:55] defsdoor: has joined #RubyOnRails
[07:17:38] testercsgo: So there is nothing inbuilt in rails validations to check for the assosiations?
[07:21:15] jhfisc: has joined #RubyOnRails
[07:22:56] tbuehlmann_: testercsgo: what exactly do you want to validate?
[07:23:26] testercsgo: Lets say Game id 1 has gameformat 1 and 2 related to it, and game 2 has gameformat 3 related to it
[07:23:37] testercsgo: THen I go to my event model, and I submit Game 2, with gameformat 1
[07:23:41] testercsgo: it should give an error
[07:23:51] testercsgo: as game 2 only has gameformat 3
[07:24:49] testercsgo: A common example would be a COuntry + State , if you submitted a State and Country combination that did not exist
[07:27:43] tbuehlmann_: sounds like a custom validation to me
[07:30:31] jhfisc: has joined #RubyOnRails
[07:32:05] snowy: has joined #RubyOnRails
[07:37:48] sooli: has joined #RubyOnRails
[07:38:02] testercsgo: Ok, thanks mate!
[07:38:14] testercsgo: Was thinking it might be, just wanted to check no official way :)
[07:42:58] quazimodo: has joined #RubyOnRails
[07:43:25] DoubleMalt: has joined #RubyOnRails
[07:46:40] snowy: has joined #RubyOnRails
[07:48:57] bronson: has joined #RubyOnRails
[07:53:18] marr: has joined #RubyOnRails
[07:53:55] dionysus69: has joined #RubyOnRails
[07:55:34] moeabdol: has joined #RubyOnRails
[07:58:53] jhfisc: has joined #RubyOnRails
[07:59:12] ariedler: has joined #RubyOnRails
[08:00:41] srinidhi: has joined #RubyOnRails
[08:02:43] moeabdol: has joined #RubyOnRails
[08:04:06] mikecmpbll: has joined #RubyOnRails
[08:07:08] jhfisc: has joined #RubyOnRails
[08:07:17] ur5us: has joined #RubyOnRails
[08:12:24] Defenestrate: has joined #RubyOnRails
[08:12:38] jhfisc: has joined #RubyOnRails
[08:26:53] cheeti: has joined #RubyOnRails
[08:27:19] cheeti: hi, I need to generate the pdf with pdfkit and content_tag. its working fine, now i want to add the page border property to the page. I tried to add the (border_style: 'solid' or border_width: 5), this got error pipe line broke error. could please any one help me to how add the page border-property.
[08:28:19] AzaToth: has joined #RubyOnRails
[08:32:07] muzik: cheeti, i had similar issues a while ago, and found the prawn gem to work well for everything i needed. i would recommend that
[08:32:28] muzik: its a wrapper around pdfkit in ruby and works very well
[08:37:36] workmad3: has joined #RubyOnRails
[08:39:41] cheeti: muzik can u sagest any link
[08:40:05] muzik: https://github.com/prawnpdf/prawn
[08:40:06] ur5us: has joined #RubyOnRails
[08:46:42] high_fiver: has joined #RubyOnRails
[08:49:47] bronson: has joined #RubyOnRails
[08:52:13] Radar: GOOD EVENING
[08:53:43] muzik: It certainly is
[08:54:39] Radar: cheeti: FYI: chrome now has a headless mode and you might be able to use that to generate a page.
[08:54:52] Radar: https://developers.google.com/web/updates/2017/04/headless-chrome#create_a_pdf_dom
[08:54:52] sooli: has joined #RubyOnRails
[08:57:00] uks: has joined #RubyOnRails
[09:03:14] jhfisc: has joined #RubyOnRails
[09:10:06] jhfisc: has joined #RubyOnRails
[09:16:15] newton: has joined #RubyOnRails
[09:16:16] jhfisc: has joined #RubyOnRails
[09:22:28] AntiSpamMeta: has joined #RubyOnRails
[09:22:28] jhfisc1: has joined #RubyOnRails
[09:23:20] nekomune: has joined #RubyOnRails
[09:23:20] hron84: has joined #RubyOnRails
[09:23:58] hron84: Anyone has an idea why inherited_resources redirects me to root_url anyway if I create a resource?
[09:24:43] hron84: There is no config for that in the specific controller also I specify create! { |success, failure| success.html { render status: :unprocessable_entity } }
[09:24:57] hron84: in #create method.
[09:25:21] hron84: the status is not i really want i just want an error to show because the request is XHR
[09:25:45] hron84: and Chrome console displays this error very nicely.
[09:26:11] hron84: but instead the error i always get a redirect
[09:26:45] Spami: has joined #RubyOnRails
[09:29:55] jhfisc: has joined #RubyOnRails
[09:30:36] brent__: has joined #RubyOnRails
[09:35:26] Spami: For some reason I have a validation that doesn't works with spec but works with rails console:
[09:36:18] Spami: https://gist.github.com/theonegri/2c910c1158d91791437b3042bb60942e & https://gist.github.com/theonegri/cafae4b981fa388c47d91c10668eb8b6
[09:36:19] Spami: Any idea?
[09:38:07] tbuehlmann_: spami: is build(:test_automation_copycat, test_hash: nil) active?
[09:41:58] jeyraof^mbpr: has joined #RubyOnRails
[09:44:17] jhfisc: has joined #RubyOnRails
[09:46:58] S1kx: has joined #RubyOnRails
[09:51:32] bronson: has joined #RubyOnRails
[10:01:06] ariedler: has joined #RubyOnRails
[10:02:43] srinidhi: has joined #RubyOnRails
[10:03:50] Radar: prove it please
[10:04:54] alfie: has joined #RubyOnRails
[10:08:25] Spami: Radar https://gist.github.com/theonegri/cafae4b981fa388c47d91c10668eb8b6 https://gist.github.com/theonegri/fd5885a74b4c20c48699cfdf182a0643
[10:09:24] Radar: spami: you can include more than one file in each gist.
[10:09:39] Radar: spami: You haven't proved active is true or false.
[10:10:14] Spami: Radar, this line `expect(test_automation_copycat.active?).to be true` should prove it
[10:10:23] Radar: Yeah I guess so
[10:10:29] arup_r: has joined #RubyOnRails
[10:13:49] jhfisc: has joined #RubyOnRails
[10:14:09] Spami: Radar do you have an idea why it could fail?
[10:14:17] Radar: spami: did that line prove it or not?
[10:14:32] Spami: It's active
[10:14:38] Radar: Steps to reproduce the issue in a new app please.
[10:21:59] jhfisc: has joined #RubyOnRails
[10:25:59] ferr: has joined #RubyOnRails
[10:29:06] stamina: has joined #RubyOnRails
[10:33:13] jhfisc: has joined #RubyOnRails
[10:39:14] jhfisc: has joined #RubyOnRails
[10:40:39] mjolnird: has joined #RubyOnRails
[10:43:39] conta: has joined #RubyOnRails
[10:44:19] jhfisc: has joined #RubyOnRails
[10:47:41] zacts: has joined #RubyOnRails
[10:50:15] mikecmpbll: reeeaallly baffled by this one. I have a section of code, which, in the console raises an exception ActiveRecord::RecordNotUnique
[10:50:38] mikecmpbll: however in my test, it just prints the exception message to stdout: "Duplicate entry '81122332-673255333' for key 'index_contact_relationships_on_contact_id_and_student_id'"
[10:52:20] bronson: has joined #RubyOnRails
[10:52:48] mikecmpbll: the RecordNotUnique exception happens during association assignment
[10:55:13] jhfisc: has joined #RubyOnRails
[11:01:21] jhfisc: has joined #RubyOnRails
[11:07:44] jhfisc: has joined #RubyOnRails
[11:12:55] apparition47: has joined #RubyOnRails
[11:18:17] moeabdol: has joined #RubyOnRails
[11:19:18] jhfisc: has joined #RubyOnRails
[11:22:05] jhfisc: has joined #RubyOnRails
[11:28:15] jhfisc: has joined #RubyOnRails
[11:32:50] s2013: has joined #RubyOnRails
[11:34:37] s2013: morning yall
[11:53:10] bronson: has joined #RubyOnRails
[12:01:35] jhfisc: has joined #RubyOnRails
[12:14:09] lacuna: has joined #RubyOnRails
[12:14:44] brent__: has joined #RubyOnRails
[12:14:52] workmad3: has joined #RubyOnRails
[12:15:09] jhfisc: has joined #RubyOnRails
[12:31:11] truenito: has joined #RubyOnRails
[12:31:34] gheegh: has joined #RubyOnRails
[12:32:48] someuser: has joined #RubyOnRails
[12:44:57] ariedler: has joined #RubyOnRails
[12:45:36] eelster: has joined #RubyOnRails
[12:49:39] lacuna: has joined #RubyOnRails
[12:54:20] bronson: has joined #RubyOnRails
[12:59:45] jphase: has joined #RubyOnRails
[12:59:49] sevenseacat: has joined #RubyOnRails
[13:00:42] Qchmqs__: has joined #RubyOnRails
[13:09:28] zebird: has joined #RubyOnRails
[13:12:11] eelster: has joined #RubyOnRails
[13:26:26] Sylario: has joined #RubyOnRails
[13:29:16] xhoy: has joined #RubyOnRails
[13:32:37] banisterfiend: has joined #RubyOnRails
[13:34:18] prestorium: has joined #RubyOnRails
[13:40:14] jscheel: has joined #RubyOnRails
[13:40:29] xhoy: has joined #RubyOnRails
[13:54:50] bronson: has joined #RubyOnRails
[13:57:45] cheeti: has joined #RubyOnRails
[13:59:26] cheeti: hi, how to add border for every page in pdf which is already exist using prawn gem
[13:59:32] chouhoulis: has joined #RubyOnRails
[13:59:58] DoubleMalt: has joined #RubyOnRails
[14:00:30] conta: has joined #RubyOnRails
[14:01:29] cheeti: i am using https://gist.github.com/mamatharao/351a0db7e694c8272aae4cabfa0d85d2 this but it's not working
[14:10:36] jhfisc: has joined #RubyOnRails
[14:13:15] futilegames: has joined #RubyOnRails
[14:14:55] jhfisc: has joined #RubyOnRails
[14:15:38] Moeh: has joined #RubyOnRails
[14:21:14] jhfisc: has joined #RubyOnRails
[14:25:24] gil_: has joined #RubyOnRails
[14:33:11] jhfisc: has joined #RubyOnRails
[14:41:47] jhfisc: has joined #RubyOnRails
[14:47:01] ariedler: has joined #RubyOnRails
[14:48:02] chouhoulis: has joined #RubyOnRails
[14:48:23] Derperperd: has joined #RubyOnRails
[14:48:51] cheeti: hi, how to add border for every page in pdf which is already exist using prawn gem
[14:49:02] cheeti: i am using https://gist.github.com/mamatharao/351a0db7e694c8272aae4cabfa0d85d2 this but it's not working
[14:49:11] machty: how can i configure/decorate the default log message that fires when a rails controller handles a request to include other information (e.g. the id of the admin user logged in, etc) ?
[14:50:55] machty: actually this seems helpful http://www.paperplanes.de/2012/3/14/on-notifications-logsubscribers-and-bringing-sanity-to-rails-logging.html
[14:55:41] bronson: has joined #RubyOnRails
[15:05:42] cam27: has joined #RubyOnRails
[15:08:48] cagomez: has joined #RubyOnRails
[15:09:27] jhfisc: has joined #RubyOnRails
[15:10:52] ElektroBug: has joined #RubyOnRails
[15:11:07] [Butch]: has joined #RubyOnRails
[15:17:33] ElektroBug: In my blog application I have three Models Blog, Tutorial and Project I want to add category to these models should I make different category model with a type having information for which model the category is for
[15:18:14] ElektroBug: I am a begginer in basis of making applications in rails and desktop/web apps in general
[15:19:19] tbuehlmann_: ElektroBug: so a blog/tutorial/project belongs to a category?
[15:20:09] ElektroBug: tbuehlmann_: yes
[15:20:15] jhfisc: has joined #RubyOnRails
[15:20:43] ElektroBug: or it could be blog/tutorial/project has_one category if it can be simplified that way
[15:21:24] tbuehlmann_: I'd probably go with a porlymorphic association, see http://guides.rubyonrails.org/association_basics.html#polymorphic-associations
[15:23:10] ElektroBug: tbuehlmann_: so line Category belongs to is polymorphic and blog/tutorial/project have has one relation?
[15:25:15] jhfisc: has joined #RubyOnRails
[15:25:27] tbuehlmann_: oh, I might have been a bit hasty here
[15:26:42] tbuehlmann_: you could have category_id columns on each of the models, that'd be easy
[15:27:24] ElektroBug: tbuehlmann_: okay thanks
[15:27:46] ElektroBug: will think about the exact deciding and work with it
[15:28:27] gusrub: has joined #RubyOnRails
[15:30:32] jhfisc: has joined #RubyOnRails
[15:40:44] brent__: has joined #RubyOnRails
[15:41:45] high_fiver: has joined #RubyOnRails
[15:43:14] jhfisc: has joined #RubyOnRails
[15:47:54] ariedler: has joined #RubyOnRails
[15:49:07] zacts: has joined #RubyOnRails
[15:51:52] npgm: has joined #RubyOnRails
[15:54:57] mtkd: has joined #RubyOnRails
[15:55:18] gusrub: has joined #RubyOnRails
[15:56:53] bronson: has joined #RubyOnRails
[15:59:04] jhfisc: has joined #RubyOnRails
[15:59:24] lacuna: has joined #RubyOnRails
[16:05:33] truenito: has joined #RubyOnRails
[16:06:09] rakm: has joined #RubyOnRails
[16:09:42] jhfisc: has joined #RubyOnRails
[16:10:08] judithrohatiner: has joined #RubyOnRails
[16:10:48] gusrub: has joined #RubyOnRails
[16:17:14] jhfisc: has joined #RubyOnRails
[16:22:36] cjohnson: Why is it that sometimes I have to explicitly make the new action and sometimes I don't? I took an existing controller whose route was defined as nothing more than: resources :override_parameters
[16:22:47] cjohnson: and the only actions I defined were create, update, destroy
[16:22:56] cjohnson: I am able to go to index, new, and other similar pages for that controller
[16:23:06] cjohnson: I copied its contents almost exactly as my OverridesController, same route setup
[16:23:21] cjohnson: but I need to explicitly have a new and index action or I get missing action new/index
[16:26:40] bronson: has joined #RubyOnRails
[16:28:10] bronson: has joined #RubyOnRails
[16:29:04] FastJack: has joined #RubyOnRails
[16:33:25] jhfisc: has joined #RubyOnRails
[16:38:25] defsdoor: has joined #RubyOnRails
[16:38:52] ar1a: has joined #RubyOnRails
[16:39:14] jhfisc: has joined #RubyOnRails
[16:42:01] eelster: has joined #RubyOnRails
[16:42:59] bios: hey *.. quick question .. ("5.1".to_f * (10**2)).to_i is resulting in 5.09 and I cannot figure out why.. I would think that it should be 510.. anyone have any ideas?
[16:43:36] Heyo: has joined #RubyOnRails
[16:44:14] bios: ok.. 5.1*100 is resulting in 509.99999999999994
[16:44:21] bios: any ideas why that would be happening?
[16:44:38] bios: that seems like the root of my problem
[16:44:42] havenwood: bios: floats
[16:44:56] bios: what's the proper way to do that?
[16:45:16] havenwood: >> 5.1r * 100r # rationals are one option
[16:45:21] havenwood: #=> (510/1)
[16:46:27] havenwood: bios: ('5.1'.to_r * 100r).floor #=> 510
[16:46:28] bios: (5.1r*100r).to_i
[16:46:52] bios: ok.. that helps! thank you!
[16:52:14] conta: has joined #RubyOnRails
[16:57:04] conta: has joined #RubyOnRails
[16:58:54] jhfisc: has joined #RubyOnRails
[16:59:28] KeyJoo: has joined #RubyOnRails
[17:05:09] arBmind: has joined #RubyOnRails
[17:06:08] arBmind: has joined #RubyOnRails
[17:07:12] jhfisc: has joined #RubyOnRails
[17:09:21] one_zero: has joined #RubyOnRails
[17:13:14] jhfisc: has joined #RubyOnRails
[17:16:16] jhfisc: has joined #RubyOnRails
[17:20:35] roshanavand: has joined #RubyOnRails
[17:21:33] SteenJobs_: has joined #RubyOnRails
[17:29:41] duderonomy: has joined #RubyOnRails
[17:29:41] kies: has joined #RubyOnRails
[17:31:22] Aherin: has joined #RubyOnRails
[17:32:32] jhfisc: has joined #RubyOnRails
[17:34:45] SteenJobs_: has joined #RubyOnRails
[17:37:53] conta: has joined #RubyOnRails
[17:38:02] jhfisc: has joined #RubyOnRails
[17:42:43] mtkd: has joined #RubyOnRails
[17:43:26] jhfisc: has joined #RubyOnRails
[17:48:43] Quintasan: has joined #RubyOnRails
[17:49:14] jhfisc: has joined #RubyOnRails
[17:55:14] jhfisc: has joined #RubyOnRails
[17:57:52] weaksauce: has joined #RubyOnRails
[18:01:14] jhfisc: has joined #RubyOnRails
[18:13:46] WeiJunLi: has joined #RubyOnRails
[18:22:18] bronson: has joined #RubyOnRails
[18:24:13] conta: has joined #RubyOnRails
[18:24:29] chouhoulis: has joined #RubyOnRails
[18:25:19] dviola: has joined #RubyOnRails
[18:30:53] srinidhi: has joined #RubyOnRails
[18:46:41] eelster: has joined #RubyOnRails
[18:49:42] jhfisc: has joined #RubyOnRails
[18:50:01] high_fiver: has joined #RubyOnRails
[18:51:21] high_fiver: has joined #RubyOnRails
[18:53:32] jscheel: I have a jank question. Is there a way to force a model to be created/destroyed via a relationship? I have Group and GroupMembership. I have association callbacks that need to run whenever a group membership is added to or removed from the collection. But, if another dev writes code to simply destroy the GroupMembership, instead of removing it from the group’s collection of group memberships, the association callback won’t be fired. I
[18:53:33] jscheel: could add the code in both the Group’s after_remove and in the GroupMembership’s after_destroy, since only one or the other will be called, but that doesn’t work with adding, since after_add on the association and after_create on the model are both called.
[18:54:27] Sylario: jscheel: yes
[18:55:03] Sylario: dependent: :destroy
[18:55:50] jscheel: sylario: using dependent: :destroy on which part?
[18:56:00] Sylario: jscheel: 4th example : http://guides.rubyonrails.org/association_basics.html#why-associations-questionmark
[18:56:31] Sylario: You should read rails guides
[18:56:45] jscheel: sylario: right, but I don’t want to destroy the Group if the GroupMembership is destroyed
[18:57:41] jscheel: and I already have Group has_many :group_memberships, dependent: :destroy
[18:58:22] Sylario: then the destruction of group membership will not destroy the group
[18:58:33] Sylario: and GM callbacks are still run
[18:59:29] Sylario: your adding/removing from a group logic should be fired from gm logic
[19:00:49] Sylario: Or you can have a service to add remove memberships, or you can (ugly?) have a service handling G-GM relations that is called both by G and GM callbacks
[19:01:14] Sylario: But when you start to code against other devs it start to become crazy
[19:01:22] jscheel: sylario: I’m slowly trying to move all of this to a service
[19:01:25] lacuna: has joined #RubyOnRails
[19:01:49] cagomez: has joined #RubyOnRails
[19:01:56] jscheel: there’s actually 5 other pieces to the puzzle, with lots of polymorphic HABTM thrown in to make it super fun
[19:02:12] jscheel: trying to unwrap everything, because it’s all tied up in activerecord callbacks
[19:02:22] ForeignBiscuit: has joined #RubyOnRails
[19:04:08] jscheel: so, there is a resources route for group, and it appears that the update is simply whatever rails provides by default, because there is nothing defined in the controller
[19:05:22] jscheel: and when a member of the group is added, the callbacks fire as expected. But, when a member of the group is removed, only the association callbacks defined on Group are called, the after_destroy callback on GroupMembership is not called. I seem to recall this being a specific design choice by the rails team. Am I crazy?
[19:05:42] jhfisc: has joined #RubyOnRails
[19:06:06] jscheel: sylario: this ring a bell? https://stackoverflow.com/a/11341113
[19:07:52] lxsameer: has joined #RubyOnRails
[19:09:39] Sylario: jscheel : http://guides.rubyonrails.org/active_record_callbacks.html#relational-callbacks
[19:09:47] ur5us: has joined #RubyOnRails
[19:11:07] jphase: has joined #RubyOnRails
[19:11:14] jhfisc: has joined #RubyOnRails
[19:13:33] JR042444__: has joined #RubyOnRails
[19:14:01] JR042444__: has joined #RubyOnRails
[19:14:26] jscheel: sylario: yes, I understand that. I’m talking about setting the collection. According to the docs (http://edgeapi.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html) setting the collection should trigger callbacks if the :through option is set, but not the destroy callbacks. Setting dependet destroy should override this behavior.
[19:14:54] jscheel: (search for “collection=objects” on page)
[19:16:45] Sylario: DO a cascade , if A B C with A has many C through B
[19:17:00] Sylario: do a A destroy B
[19:17:02] Sylario: B destroy C
[19:18:15] Sylario: I have never been a fan of through, and I mainly use it for big AR query
[19:20:01] jhfisc: has joined #RubyOnRails
[19:20:33] lacuna: has joined #RubyOnRails
[19:22:47] jhfisc: has joined #RubyOnRails
[19:23:15] bronson: has joined #RubyOnRails
[19:25:11] conta: has joined #RubyOnRails
[19:25:47] mikecmpbll: has joined #RubyOnRails
[19:29:10] ar1a: has joined #RubyOnRails
[19:29:14] jhfisc: has joined #RubyOnRails
[19:32:59] tycoon177: i'm wondering how i can accomplish this in rails. i have a course that has many course_categories through course_category_assignments, and i would like the assignments to just be check boxes on the courses form. how would i go about structuring this in the controller/model? do i need to accept nested attributes? i'm (not by my own choice) stuck on rails 3 for work.
[19:35:14] jhfisc: has joined #RubyOnRails
[19:39:45] cstls: has joined #RubyOnRails
[19:40:51] tycoon177: i am going to try this link and will report back http://millarian.com/rails/quick-tip-has_many-through-checkboxes/
[19:43:33] eelster: has joined #RubyOnRails
[19:43:44] jhfisc: has joined #RubyOnRails
[19:44:50] tbuehlmann_: tycoon177: I have something for you: https://github.com/tbuehlmann/has-many-through-selection
[19:48:02] jscheel: thanks for your help sylario
[19:48:36] ForeignBiscuit: has joined #RubyOnRails
[19:48:58] jhfisc: has joined #RubyOnRails
[19:53:49] WeiJunLi: has joined #RubyOnRails
[19:54:29] jphase: has joined #RubyOnRails
[20:01:14] jhfisc: has joined #RubyOnRails
[20:07:11] cagomez: has joined #RubyOnRails
[20:07:16] jhfisc: has joined #RubyOnRails
[20:10:47] cagomez: has joined #RubyOnRails
[20:12:17] jhfisc: has joined #RubyOnRails
[20:17:29] tycoon177: tbuehlmann_: the link that i sent ended up working...sorry for taking so long. people kept interrupting me at work
[20:17:37] ForeignBiscuit: has joined #RubyOnRails
[20:20:32] tycoon177: css grid sounds SO nice
[20:20:39] tycoon177: i wish i could use it :(
[20:22:29] bronson: has joined #RubyOnRails
[20:25:03] jhfisc: has joined #RubyOnRails
[20:26:13] mtkd: has joined #RubyOnRails
[20:34:03] jhfisc: has joined #RubyOnRails
[20:37:01] weaksauce: has joined #RubyOnRails
[20:38:34] HoierM: has joined #RubyOnRails
[20:39:19] lacuna: has joined #RubyOnRails
[20:51:38] jhfisc: has joined #RubyOnRails
[20:55:12] WeiJunLi: has joined #RubyOnRails
[20:58:18] jhfisc: has joined #RubyOnRails
[21:14:32] aclark: has joined #RubyOnRails
[21:15:57] b3ck_: has joined #RubyOnRails
[21:17:49] cagomez: has joined #RubyOnRails
[21:18:12] jphase: has joined #RubyOnRails
[21:18:38] cagomez: has joined #RubyOnRails
[21:19:05] lxnr: has joined #RubyOnRails
[21:23:20] bronson: has joined #RubyOnRails
[21:24:54] jhfisc: has joined #RubyOnRails
[21:35:08] jhfisc: has joined #RubyOnRails
[21:42:34] elcontrastador: has joined #RubyOnRails
[21:44:46] jhfisc: has joined #RubyOnRails
[21:47:24] duderonomy: has joined #RubyOnRails
[21:51:04] McBride36: has joined #RubyOnRails
[21:51:13] Lizards|Work: has joined #RubyOnRails
[22:01:33] jhfisc: has joined #RubyOnRails
[22:01:47] Radar: GOOD MORNING
[22:04:44] cagomez: has joined #RubyOnRails
[22:07:37] cagomez: has joined #RubyOnRails
[22:08:19] cagomez: has joined #RubyOnRails
[22:09:58] jhfisc: has joined #RubyOnRails
[22:17:14] jhfisc: has joined #RubyOnRails
[22:19:57] brent__: has joined #RubyOnRails
[22:20:26] bronson: has joined #RubyOnRails
[22:23:14] jhfisc: has joined #RubyOnRails
[22:25:34] gusrub: has joined #RubyOnRails
[22:29:14] jhfisc: has joined #RubyOnRails
[22:31:20] mtkd: has joined #RubyOnRails
[22:37:14] jhfisc: has joined #RubyOnRails
[22:43:58] jhfisc: has joined #RubyOnRails
[22:48:54] jhfisc: has joined #RubyOnRails
[22:54:09] jhfisc: has joined #RubyOnRails
[22:55:40] aclark: has joined #RubyOnRails
[22:57:25] rakm: has joined #RubyOnRails
[23:09:01] jhfisc: has joined #RubyOnRails
[23:12:54] apparition: has joined #RubyOnRails
[23:15:08] JusticeFries: has joined #RubyOnRails
[23:15:49] JusticeFries: hey all, been out of the rails game for a little bit, coming back in with 5.1. i'm trying to figure out how webpacker and sprockets interact, and if I need sprockets at all (are there npm modules for rails ujs and actioncable?)
[23:17:02] JusticeFries: or am I best keeping both of those totally separate and using sprockets as-is and just integrate webpack for my SPA-style stuff?
[23:19:57] jhfisc: has joined #RubyOnRails
[23:24:43] conta: has joined #RubyOnRails
[23:35:34] jhfisc: has joined #RubyOnRails
[23:44:38] cagomez: has joined #RubyOnRails
[23:47:16] jhfisc: has joined #RubyOnRails
[23:49:07] cagomez: has joined #RubyOnRails
[23:59:44] jhfisc: has joined #RubyOnRails