« Back to channel list

#RubyOnRails - 08 April 2019

« Back 1 day Forward 1 day »
[00:18:16] jottr: has joined #RubyOnRails
[00:41:33] cerberussg: has joined #RubyOnRails
[00:50:35] jottr: has joined #RubyOnRails
[01:06:52] Technodrome: has joined #RubyOnRails
[01:26:27] orbyt_: has joined #RubyOnRails
[02:02:18] orbyt_: has joined #RubyOnRails
[02:07:56] Haydos: has joined #RubyOnRails
[02:08:29] Saukk: has joined #RubyOnRails
[02:16:44] mangold: has joined #RubyOnRails
[02:21:59] pd09041999: has joined #RubyOnRails
[02:40:10] agent_white: has joined #RubyOnRails
[02:45:58] duderonomy: has joined #RubyOnRails
[02:51:43] jottr: has joined #RubyOnRails
[02:53:42] NeXTSUN: has joined #RubyOnRails
[03:09:29] braincrash: has joined #RubyOnRails
[03:09:32] LtHummus: has joined #RubyOnRails
[03:11:42] mangold: has joined #RubyOnRails
[03:28:00] jottr: has joined #RubyOnRails
[03:52:54] segy: has joined #RubyOnRails
[04:01:10] jottr: has joined #RubyOnRails
[04:32:13] jottr: has joined #RubyOnRails
[04:55:55] sidx64: has joined #RubyOnRails
[05:01:46] sidx64: has joined #RubyOnRails
[05:07:46] segy: has joined #RubyOnRails
[05:10:07] v01d4lph4: has joined #RubyOnRails
[05:16:48] conta: has joined #RubyOnRails
[05:19:12] v01d4lph4: has joined #RubyOnRails
[05:23:55] Xiti`: has joined #RubyOnRails
[05:29:15] mangold: has joined #RubyOnRails
[05:29:21] v01d4lph4: has joined #RubyOnRails
[05:35:51] segy: has joined #RubyOnRails
[05:50:04] regedit: has joined #RubyOnRails
[05:52:13] dionysus69: has joined #RubyOnRails
[06:04:06] sevenseacat: has joined #RubyOnRails
[06:07:19] ariedler: has joined #RubyOnRails
[06:17:29] shortCircuit__: has joined #RubyOnRails
[06:19:33] srinidhi: has joined #RubyOnRails
[06:22:36] shortCircuit__: I am having a problem while writing spec for a method that has a method that accepts a block.
[06:22:48] shortCircuit__: I am not being able to derive the cause of the error
[06:22:53] shortCircuit__: https://gist.github.com/ikouchiha47/fffdfd491a8df4212db0f1824df29762 this is the gist
[06:23:18] shortCircuit__: but if I comment out the particular lines in the code, rspec seems to run successfully
[06:29:13] segy: has joined #RubyOnRails
[06:29:42] ricekrispie2: has joined #RubyOnRails
[06:33:23] jottr: has joined #RubyOnRails
[06:37:57] snickers: has joined #RubyOnRails
[06:45:18] shortCircuit__: if anyone needs more context I can put it in the gist
[06:45:52] pd09041999: has joined #RubyOnRails
[06:46:26] DaniG2k: has joined #RubyOnRails
[06:48:12] DaniG2k: im trying to get webpacker working in a Rails 4 project I'm working on
[06:48:28] DaniG2k: I added the gem to the Gemfile
[06:48:46] DaniG2k: added the javascript_pack_tag to the application htmlfile
[06:48:57] DaniG2k: I've set it up to work with vuejs
[06:49:00] DaniG2k: I think all is well
[06:49:09] DaniG2k: only thing that isn't working is the CI/CD pipeline
[06:50:27] DaniG2k: I think I somehow need to add the webpacker step to my circleci config file but really not sure how/where
[06:51:01] DaniG2k: the error I'm seeing in CircleCI is: ActionView::Template::Error: Webpacker can't find application in /home/circleci/octopi/public/packs-test/manifest.json. Possible causes:
[06:51:39] DaniG2k: any idea how I can fix this?
[06:52:31] sevenseacat: yes, you need to build your assets as part of your testing script
[06:57:42] DaniG2k: any idea what the correct way to do that would be
[06:58:25] sevenseacat: https://github.com/rails/webpacker#custom-rails-environments
[06:58:38] DaniG2k: thanks, will have a look
[06:58:52] shortCircuit__: dang I found the error. :/
[07:02:44] DaniG2k: sevenseacat: my webpacker.yml file already seems tobe configured with a production block
[07:02:53] sevenseacat: test != production
[07:03:10] DaniG2k: i also have a test block though
[07:03:24] DaniG2k: it has compile: true and public_output_path: packs-test
[07:07:43] DaniG2k: maybe I need to create that packs-test directory?
[07:07:52] Dbugger: has joined #RubyOnRails
[07:10:28] blackmesa: has joined #RubyOnRails
[07:14:40] Ergo: has joined #RubyOnRails
[07:16:41] ht85: has joined #RubyOnRails
[07:18:22] prestorium: has joined #RubyOnRails
[07:20:58] ht85: Hey! I'm working on an app that stores users time zones as friendly names (e.g. "Pacific Time (US & Canada)"), and I'd like to switch to storing the standard name (e.g. "America/Los Angeles"). I've changed it manually and it seems to work, but I'm worried it'll break something.
[07:21:33] ht85: Anyone has experience with this? Is it common to work with regular names as well, or might some gems expect friendly names and break?
[07:41:34] lxsameer: has joined #RubyOnRails
[07:53:27] mikecmpbll: has joined #RubyOnRails
[07:57:59] pd09041999: has joined #RubyOnRails
[08:08:08] ariedler: has joined #RubyOnRails
[08:15:40] jottr: has joined #RubyOnRails
[08:28:23] ae84: has joined #RubyOnRails
[08:30:22] mangold: has joined #RubyOnRails
[08:38:04] srinidhi: has joined #RubyOnRails
[08:56:19] agent_white: has joined #RubyOnRails
[09:04:26] pd09041999: has joined #RubyOnRails
[09:12:03] srinidhi: has joined #RubyOnRails
[09:13:30] sidx64: has joined #RubyOnRails
[09:15:29] mangold: has joined #RubyOnRails
[09:53:35] pd09041999: has joined #RubyOnRails
[10:07:25] conta: has joined #RubyOnRails
[10:09:09] ariedler: has joined #RubyOnRails
[10:10:22] lxsameer: has joined #RubyOnRails
[10:11:08] agent_white: has joined #RubyOnRails
[10:11:45] beilabs: has joined #RubyOnRails
[10:37:03] jottr_: has joined #RubyOnRails
[10:39:06] sidx64: has joined #RubyOnRails
[10:55:07] ariedler: has joined #RubyOnRails
[10:58:44] jottr: has joined #RubyOnRails
[11:20:21] mfoo: has joined #RubyOnRails
[11:22:22] Terens: has joined #RubyOnRails
[11:22:40] Terens: I want to allow app users
[11:22:56] Terens: to authorize with oauth third party app but I have an API only app
[11:23:07] Terens: I am not sure what is the best way to name the endpoints
[11:30:29] Dbugger: has joined #RubyOnRails
[11:40:05] pd09041999: has joined #RubyOnRails
[11:40:55] segy: has joined #RubyOnRails
[11:42:53] pd09041999: has joined #RubyOnRails
[11:44:05] lankanmon: has joined #RubyOnRails
[11:47:59] pd09041999: has joined #RubyOnRails
[11:50:52] catbusters: has joined #RubyOnRails
[11:55:51] sidx64: has joined #RubyOnRails
[11:59:28] prestori_: has joined #RubyOnRails
[12:24:12] segy: has joined #RubyOnRails
[12:34:02] mfoo: Unicorn's documentation for HUP handling states that it "gracefully restarts all workers" - it seems to actually pause requests, then restart all workers at the same time. The effect is that requests hang (connections don't drop). Is there a minimum pool size such that there are always some available workers?
[12:36:07] jottr: has joined #RubyOnRails
[12:36:50] mfoo: (note that Puma's documentation for USR1 specifies "restart workers in phases, a rolling restart" a number which I assume can be configured but can't find the config for yet
[12:49:45] beilabs: Have an app on 4.2.7.1; all of a sudden our static assets are no longer available on rspec. Any ideas? config.serve_static_files = true in test.rb
[12:55:25] beilabs_: has joined #RubyOnRails
[12:58:51] Terens: I have implemented several integrations for the app
[12:58:56] Terens: I am working on
[12:59:14] Terens: would you store configurations within integration/configuration routes or
[12:59:20] Terens: configurations/integration
[13:07:56] prestorium: has joined #RubyOnRails
[13:11:08] regedit: has joined #RubyOnRails
[13:13:46] beilabs_: has joined #RubyOnRails
[13:16:12] blackmesa: has joined #RubyOnRails
[13:27:52] kapil____: has joined #RubyOnRails
[13:33:38] Technodrome: has joined #RubyOnRails
[13:36:18] hammer065: Is there a way to run certain Code from startup in the background?
[13:36:41] hammer065: Or has anybody a better solution for a PostgreSQL LISTEN?
[13:40:25] beingjohnm: has joined #RubyOnRails
[13:47:36] s00pcan: has joined #RubyOnRails
[14:01:35] jottr_: has joined #RubyOnRails
[14:11:49] linucks: has joined #RubyOnRails
[14:13:00] linucks: Hi there, I'm wondering if anyone has experience with asset-sync and AWS for storing static files. I am getting an error "[fog][WARNING] Unable to fetch credentials: connect_write timeout reached" when running bundle exec rake assets:precompile and just cannot work out the cause.
[14:18:27] pd09041999: has joined #RubyOnRails
[14:19:32] jottr: has joined #RubyOnRails
[14:51:04] brool: has joined #RubyOnRails
[14:51:12] segy: has joined #RubyOnRails
[14:53:49] snickers: has joined #RubyOnRails
[14:54:17] v01d4lph4: has joined #RubyOnRails
[14:59:30] sidx64: has joined #RubyOnRails
[15:01:59] TvL2386: has joined #RubyOnRails
[15:02:18] orbyt_: has joined #RubyOnRails
[15:25:05] segy: has joined #RubyOnRails
[15:26:39] hd1: has joined #RubyOnRails
[15:29:50] jottr: has joined #RubyOnRails
[15:39:12] segy: has joined #RubyOnRails
[15:42:53] tdy: has joined #RubyOnRails
[15:44:23] sidx64: has joined #RubyOnRails
[15:51:03] sidx64_: has joined #RubyOnRails
[15:56:32] sidx64: has joined #RubyOnRails
[15:57:01] mondz: has joined #RubyOnRails
[16:11:33] Saukk: has joined #RubyOnRails
[16:19:31] jottr: has joined #RubyOnRails
[16:23:50] someuser: has joined #RubyOnRails
[16:36:45] orbyt_: has joined #RubyOnRails
[16:41:21] kapil____: has joined #RubyOnRails
[16:54:19] jottr: has joined #RubyOnRails
[17:00:34] Aherin: has joined #RubyOnRails
[17:15:02] jottr: has joined #RubyOnRails
[17:19:00] pitastrudl: has joined #RubyOnRails
[17:19:47] pitastrudl: im learning rails and i'm wondering what is the purpouse of the asteriks and & symbols in terms of syntax in the database.yml
[17:20:14] pitastrudl: for example development: <<: *default
[17:20:32] pitastrudl: some have test: &test <<: *default
[17:23:51] pitastrudl: the reason for the question is that on a rake db:create:all, it creates the test database but not the development one, the trace does not say much
[17:32:01] lxsameer: has joined #RubyOnRails
[17:36:30] blackmesa: has joined #RubyOnRails
[17:39:07] snk: pitastrudl (IRC): that syntax is how you inherit/include items in YAML
[17:39:09] snk: https://stackoverflow.com/questions/41063361/what-is-the-double-left-arrow-syntax-in-yaml-called-and-wheres-it-specced
[17:42:37] nacsurte: has joined #RubyOnRails
[17:43:00] nacsurte: is it possible to nil out the foreign key when you delete a belongs_to association?
[17:43:05] nacsurte: automatically?
[17:45:15] Momentum: has joined #RubyOnRails
[17:45:32] segy: has joined #RubyOnRails
[17:45:49] Momentum: is it possible to set postgres role in rails? it always default to the current user
[17:50:28] uksio: has joined #RubyOnRails
[17:50:44] KeyJoo: has joined #RubyOnRails
[17:52:38] eddof13: has joined #RubyOnRails
[17:57:00] pro777: nacsurte> Are you looking for dependent: :destroy ?
[17:57:46] NOS94: has joined #RubyOnRails
[18:02:27] NOS94: Hey everyone, I'm working with the coocoon gem to create an order form which has nested fields for the line items -- I need to setup an index and add to it every time coocoon creates a new association. I've been googling a way for a few hours, tried using local_assigns and some javascript, but I'm running out of ideas and could use some help if anyone is familiar with it?
[18:16:43] nacsurte: Pro777: I guess more like dependent: :nullify
[18:17:01] nacsurte: but the model is an STI model
[18:20:49] coffeejunk: has joined #RubyOnRails
[18:20:52] epochwolf: has joined #RubyOnRails
[18:21:05] fowlduck: has joined #RubyOnRails
[18:21:07] hhzza: has joined #RubyOnRails
[18:21:28] JJonah: has joined #RubyOnRails
[18:28:50] jottr: has joined #RubyOnRails
[18:42:28] segy: has joined #RubyOnRails
[18:51:00] agent_white: has joined #RubyOnRails
[19:09:49] blackmesa: has joined #RubyOnRails
[19:25:00] samort7: has joined #RubyOnRails
[19:25:11] dviola: has joined #RubyOnRails
[19:25:23] samort7: Can anyone explain to me what the array here does? <%= form_with(model: [ @series, @series.books.build ], local: true) do |form| %>
[19:40:16] duderonomy: has joined #RubyOnRails
[19:40:40] eddof13: has joined #RubyOnRails
[19:41:16] hightower3: has joined #RubyOnRails
[20:06:07] carbone5: has joined #RubyOnRails
[20:07:30] orbyt_: has joined #RubyOnRails
[20:07:40] Technodrome: has joined #RubyOnRails
[20:27:43] jottr: has joined #RubyOnRails
[20:47:54] snk: samort7: i believe that's needed when you want to reference something in a namespaced route
[20:48:03] snk: see the examples at: https://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-form_with
[20:49:09] samort7: @snk, yea, I have been reading that over-and-over but it's just not clicking for me. I think the issue is what I'm trying to currently do with it
[20:50:29] samort7: I have a series model that has_many book models. All I want is that when you click on the "edit" button for a book inside a series, it pre-populates the fields in the form with the book's data
[20:50:30] snk: yeah, the invocation you gave there is a bit odd. I'd expect something more like `@series, books.new` in order to add a new book to your series model, given what the docs say
[20:51:42] samort7: Here's the actual code. I just started this project so it's really really really basic right now: https://github.com/tliss/lianhuanhua/blob/master/app/views/books/_form.html.erb
[20:52:04] orbyt_: has joined #RubyOnRails
[20:52:20] samort7: Also, I should mention that I took that invocation straight from the Rails "Getting Started" guide: https://guides.rubyonrails.org/getting_started.html
[20:52:59] samort7: Where they use <%= form_with(model: [ @article, @article.comments.build ], local: true) do |form| %>
[20:54:53] segy: has joined #RubyOnRails
[20:55:06] snk: ah, that's just setting up the form to post to the nested url correctly, it's not doing any autofilling
[20:55:30] snk: for autofilling forms, i think you can set a `:value` parameter
[20:56:28] snk: maybe something like `<%= f.text_field :series_number, :value => @series.number %>`
[20:57:32] snk: provided your series model has a number method to retrieve the number, and it's defined when you render the view
[20:59:44] samort7: If that's the case, then I don't understand why when I click edit for "series", it prepopulates the fields correctly from the database without anything extra added to the form. (referring to this: https://github.com/tliss/lianhuanhua/blob/master/app/views/series/_form.html.erb)
[20:59:46] snk: so, your code is configuring the form to post to `/series/<id>/books`, which may be correct
[21:00:10] snk: but the value needs to be configured on the text field
[21:02:49] eddof13: has joined #RubyOnRails
[21:05:22] snk: trying to see if i can install this locally, so i can throw a debugger on it
[21:05:44] jottr: has joined #RubyOnRails
[21:06:02] samort7: sure, your help is much-appreciated. I've been working on this bug for like 3 days now haha
[21:06:49] samort7: I'm thinking - in my model I retrieve the @series object and the @book object (from that @series object), so I think I should be able to just do mode: @book and have it pre-populate
[21:06:53] snk: but my suspicion is that there's some rails magic for prepopulating simple forms, when you're modifying a simple model -- and the magic doesn't extend to filling form fields for other dependent models
[21:07:17] samort7: snk: I was thinking something along those lines as well.
[21:07:25] gb_away: has joined #RubyOnRails
[21:07:40] samort7: snk: But I couldn't find any documentation on it - at least not with form_with. There's a lot of stuff on form_for though
[21:10:11] samort7: I think I figured it out
[21:10:43] samort7: <%= form_with(model: @book, url: series_book_path, local:true) do |form| %>
[21:11:08] samort7: agh, damnit
[21:11:35] xco: has joined #RubyOnRails
[21:12:11] samort7: It prepopulates when you get to the edit page, but if you try to go to the series/show page it breaks
[21:12:25] ur5us: has joined #RubyOnRails
[21:13:05] samort7: Probably because that page also contains the form, but doesn't have a direct book to reference
[21:19:50] snk: yeah, setting the form_with to `model: [:series, @book]` has similar results :/
[21:20:23] eddof13: has joined #RubyOnRails
[21:21:55] samort7: Yea. Hmm... Interesting issue
[21:22:41] samort7: I feel like we're close though
[21:22:56] rtrain300: has joined #RubyOnRails
[21:23:18] rtrain300: Hi all. I'm getting a "We're sorry, but something went wrong." Error on my application but the server is not outputting any logs. Anyone have ideas?
[21:25:02] samort7: rtrain300: what were you trying to do when you got that error?
[21:25:14] rtrain300: Just visit the webpage
[21:25:27] samort7: did you try stopping the server and restarting it?
[21:26:10] samort7: rtrain300: are you just trying to connect to localhost:3000?
[21:26:36] rtrain300: no, it's running on AWS
[21:26:57] rtrain300: Accessing it with a public IP address
[21:34:05] rtrain300: We're sorry, but something went wrong.
[21:34:05] rtrain300: If you are the application owner check the logs for more information.
[21:36:01] snk: samort7: sorry, i gotta run, i got nothing for you :/
[21:37:48] samort7: no worries
[21:37:54] samort7: snk: Did find something out
[21:38:09] samort7: snk: if you make a book/show.html.erb page, it renders
[21:38:18] snk: but, i think this form really wants to be a @book form, and the series show view needs to know about books
[21:38:20] samort7: snk: so its something! needs more tweaking! but thanks for your helps!
[21:38:32] snk: no prob, good luck
[21:38:38] samort7: snk: thanks!
[21:52:46] jottr: has joined #RubyOnRails
[22:12:44] agent_white: has joined #RubyOnRails
[22:24:32] Fernando-Basso: has joined #RubyOnRails
[22:30:30] jottr: has joined #RubyOnRails
[22:32:02] matthewd: has joined #RubyOnRails
[22:32:34] segy: has joined #RubyOnRails
[22:43:14] azta: has joined #RubyOnRails
[22:46:08] azta: the time/date helper functions aren't using my timezone, Date.today => Tue, 09 Apr 2019, 1.day.ago => Sun, 07 Apr 2019 22:44:25 UTC +00:00
[22:46:37] azta: Time.now => 2019-04-09 00:44:20 +0200 is correct. Do I need to set this specifically for rails?
[22:47:20] azta: or do they always use UTC?
[22:53:51] xco: has joined #RubyOnRails
[23:42:21] segy: has joined #RubyOnRails