catbusters

Activity Graph

Page 1 of 3 | Next »

2019-03-22

[15:03:19] catbusters: has joined #RubyOnRails
[15:03:19] catbusters: has joined #ruby
[22:22:23] catbusters: Quit: Connection closed for inactivity

2019-03-17

[00:27:59] catbusters: has joined #ruby
[00:28:00] catbusters: has joined #RubyOnRails
[00:29:14] catbusters: I'm trying to do a query like this: ((a = 1 OR b = 2) AND (y = 1 OR z = 2))
[00:29:36] catbusters: I know how I can chain multiple OR queries but how would I write a query like this?
[03:07:30] catbusters: Quit: Connection closed for inactivity

2019-03-11

[18:42:22] catbusters: has joined #RubyOnRails
[18:42:22] catbusters: has joined #ruby
[21:11:39] catbusters: Quit: Connection closed for inactivity

2019-03-03

[03:22:02] catbusters: Quit: Connection closed for inactivity

2019-03-02

[23:52:49] catbusters: has joined #RubyOnRails
[23:52:49] catbusters: has joined #ruby

2019-02-25

[02:42:47] catbusters: Quit: Connection closed for inactivity

2019-02-24

[02:40:51] catbusters: Quit: Connection closed for inactivity
[14:04:08] catbusters: has joined #ruby
[14:04:09] catbusters: has joined #RubyOnRails
[14:12:13] catbusters: I've this weird issue with the rails guides
[14:12:43] catbusters: They don't load on my browser, the page loads half a quarter of the way and then becomes blank and hangs
[14:13:02] catbusters: I've been forced to use the Kindle version of the guides due to this
[14:46:38] catbusters: Maybe you could use a before save hook? I know it's hacky but if it works...
[19:13:32] catbusters: Quit: Connection closed for inactivity
[23:03:18] catbusters: has joined #RubyOnRails
[23:03:18] catbusters: has joined #ruby
[23:03:52] catbusters: Anyone using devise with omniauth?

2019-02-23

[11:21:49] catbusters: has joined #RubyOnRails
[11:21:49] catbusters: has joined #ruby
[11:22:57] catbusters: I have a table that rails keeps modifying in schema.rb upon migration
[11:23:26] catbusters: `create_table "friendly_id_slugs", id: :integer, default: nil, force: :cascade do |t|`
[11:23:31] catbusters: gets changed to
[11:23:39] catbusters: `create_table "friendly_id_slugs", id: :serial, force: :cascade do |t|`
[11:23:41] catbusters: Using postgres
[11:57:54] catbusters: I don't see why not
[11:58:06] catbusters: The code you're talking about is generic enough
[13:01:20] catbusters: The whole table
[16:02:27] catbusters: Check out https://github.com/ohler55/ox
[16:02:57] catbusters: It has a streaming parser module
[16:30:22] catbusters: You could import the XML files into postgres locally as the next best thing
[18:08:12] catbusters: Maybe you could use https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/DatabaseStatements.html
[19:22:19] catbusters: How fassster?

2019-02-19

[06:42:32] catbusters: has joined #RubyOnRails
[06:42:32] catbusters: has joined #ruby
[09:31:57] catbusters: Quit: Connection closed for inactivity

2019-02-17

[18:17:25] catbusters: has joined #RubyOnRails
[18:17:25] catbusters: has joined #ruby
[18:19:37] catbusters: Do you generally leave turbolinks on or turn it off in rails apps?
[21:56:53] catbusters: Quit: Connection closed for inactivity

2019-02-16

[04:28:40] catbusters: has joined #RubyOnRails
[04:28:40] catbusters: has joined #ruby
[07:04:49] catbusters: What's the "correct" way to do controller specific or action specific javascript in rails?
[11:17:56] catbusters: Quit: Connection closed for inactivity
[16:23:08] catbusters: has joined #RubyOnRails
[16:23:23] catbusters: has joined #ruby
[18:42:27] catbusters: Quit: Connection closed for inactivity

2019-02-15

[13:44:50] catbusters: has joined #RubyOnRails
[13:44:50] catbusters: has joined #ruby
[13:45:49] catbusters: Anyone using Grape?
[17:04:15] catbusters: Quit: Connection closed for inactivity
[17:16:40] catbusters: has joined #ruby
[17:16:41] catbusters: has joined #RubyOnRails
[19:34:15] catbusters: Quit: Connection closed for inactivity

2019-02-12

[14:00:35] catbusters: has joined #RubyOnRails
[14:00:35] catbusters: has joined #ruby
[16:39:48] catbusters: Quit: Connection closed for inactivity

2019-02-11

[06:50:51] catbusters: has joined #ruby
[06:50:52] catbusters: has joined #RubyOnRails
[09:33:35] catbusters: It's my first time deploying a Rails application. When I set RAILS_ENV to production, I get this error and the application errors out `ActionView::Template::Error (The asset "application.js" is not present in the asset pipeline.)`
[09:33:47] catbusters: I understand I need to precompile the assets?
[09:34:23] catbusters: `RAILS_ENV=production rails assets:precompile` like this, is that correct?
[09:35:53] catbusters: Okay. When I do this, the application starts working, but all the files from the public directory get `404`ed
[09:38:00] catbusters: That makes it work, thanks
[09:38:10] catbusters: But I guess that's not the recommended way of doing things?
[09:40:01] catbusters: I do have Nginx set up already
[09:56:37] catbusters: Figured it out, thanks for the help tbuehlmann
[11:14:34] catbusters: I'm facing a problem with ActiveStorage only in production. The image links that are produced result in 404s (using S3, and they do get uploaded in the bucket, I checked)
[11:15:06] catbusters: I did `ActiveStorage::Blob.find_signed`
[11:15:18] catbusters: Got this `#<ActiveStorage::Blob id: 7, key: "VBmLQMxmroSDt1zkwYXxn7S3", filename: "WD2.jpg", content_type: "image/jpeg", metadata: {"identified"=>true, "width"=>1698, "height"=>898, "analyzed"=>true}, byte_size: 316932, checksum: "H60SeSt+Df8IB7vIjb1YhA==", created_at: "2019-02-11 10:54:32">`
[11:27:25] catbusters: `image_tag(url_for(f.object.cover_image))` in formtastic
[11:28:13] catbusters: When I did the same thing locally it had worked
[11:32:20] catbusters: I'm getting an nginx 404 error, opening the link doesn't add anything to `production.log`
[11:35:58] catbusters: Yeah I got it
[11:36:14] catbusters: The previous rule I had set for the public folder assets not loading
[11:36:27] catbusters: It was intercepting the active_storage path
[11:39:39] catbusters: I can't figure out what to do with the nginx config though
[11:40:39] catbusters: https://bpaste.net/show/62e5f222e2ec
[11:41:13] catbusters: If I remove the images block the files in the public folder don't load, and if I add it in, active_storage files don't load
[11:55:00] catbusters: Okay I figured it out
[12:39:04] catbusters: Why does Spring keep regenerating Gemfile.lock? Gave me a literal headache with so many merge conflicts
[12:45:12] catbusters: Well I was trying to do a git pull, but it kept saying Gemfile.lock had changed. I tried it so many times to revert the changes, but each time I would, it'd get changed again. I tried deleting it, but it came back again.
[12:45:23] catbusters: Finally I did bin/spring stop and it started working
[12:58:19] catbusters: What should be used isntead?
[19:54:52] catbusters: I'm facing this really weird issue. I've got a form and I'm trying to listen to `ajax:success`
[19:55:01] catbusters: Works perfectly on desktop doesn't work at all on mobile
[19:55:29] catbusters: Is Turbolinks to blame?
[22:45:43] catbusters: Quit: Connection closed for inactivity

2019-02-10

[11:49:26] catbusters: has joined #RubyOnRails
[11:49:26] catbusters: has joined #ruby
[11:50:02] catbusters: How can I access a credential stored in `credentials.yml.enc`
[11:50:49] catbusters: I can do `Rails.application.credentials` but I have to add `Rails.application.credentials.development` to make it work
[11:51:38] catbusters: Then how do I store environment specific secrets?
[11:51:56] catbusters: API keys and all
[12:04:29] catbusters: Alright thanks
[14:17:28] catbusters: Quit: Connection closed for inactivity
[18:48:08] catbusters: has joined #RubyOnRails
[18:48:08] catbusters: has joined #ruby
[23:06:35] catbusters: Quit: Connection closed for inactivity

2019-02-08

[06:19:46] catbusters: has joined #ruby
[06:19:47] catbusters: has joined #RubyOnRails
[06:40:09] catbusters: Do you have `# encoding: utf-8` set in the page? It's most likely not the cause, but couldn't hurt to try
[06:41:36] catbusters: That goes in your html file
[06:41:54] catbusters: in your top level layout file
[06:48:26] catbusters: There's a gem called http you might want to try
[06:49:02] catbusters: haxx0r glad it worked :)
[06:52:20] catbusters: https://github.com/httprb/http is what I've been using and they claim to have been inspired by requests
[13:19:10] catbusters: Quit: Connection closed for inactivity

2019-02-07

[12:28:50] catbusters: has joined #ruby
[12:28:51] catbusters: has joined #RubyOnRails
[12:31:07] catbusters: I've a form with the GET method, and it overwrites all the other query parameters on submit. How can I stop that from happening?
[13:26:23] catbusters: https://dpaste.de/XTFw
[13:26:52] catbusters: I've tried the two snippets and it still removes all existing query params
[13:41:14] catbusters: lwwwr: What problem are you facing?
[17:07:19] catbusters: Quit: Connection closed for inactivity

2019-02-05

[11:58:36] catbusters: has joined #RubyOnRails
[11:58:36] catbusters: has joined #ruby
[19:47:56] catbusters: Quit: Connection closed for inactivity

2019-02-03

[09:27:51] catbusters: has joined #RubyOnRails
[09:27:51] catbusters: has joined #ruby
[12:57:15] catbusters: Quit: Connection closed for inactivity
[13:30:05] catbusters: has joined #ruby
[13:30:06] catbusters: has joined #RubyOnRails
[13:30:45] catbusters: Has anyone here used ActionCable?
[15:49:34] catbusters: Quit: Connection closed for inactivity

2019-01-28

[19:20:21] catbusters: has joined #RubyOnRails
[19:20:21] catbusters: has joined #ruby
[19:22:04] catbusters: I'm trying to use Ruby to parse some HTML, and I'm getting some text that looks like this: "they&#39;re in a"
[19:22:17] catbusters: I assume it's supposed to be "they're"
[19:22:24] catbusters: How do I fix this?
[19:30:36] catbusters: What's the difference?
[19:36:49] catbusters: I'm already loading Nokogiri so I guess I'll go with that
[23:59:48] catbusters: Quit: Connection closed for inactivity

2019-01-14

[00:31:47] catbusters: has joined #ruby
[00:31:48] catbusters: has joined #RubyOnRails
[00:33:39] catbusters: Does Rails include jQuery out of the box?
[00:35:05] catbusters: I'm on Rails > 5.1
[00:35:21] catbusters: Reason I ask is I seem to have $ defined already
[00:35:36] catbusters: I think it's probably coming from ujs?
[00:51:47] catbusters: My bad, forgot that browsers define it by default
[03:10:08] catbusters: Quit: Connection closed for inactivity
[16:13:30] catbusters: has joined #RubyOnRails
[16:13:30] catbusters: has joined #ruby
[16:15:35] catbusters: How can I get the URL for a certain route in a .js.erb file? In .html.erb files I can just do `<% posts_path %>`, but it raises `NameError` in my `.js.erb` files
[17:20:59] catbusters: DylanJ: You mean like `posts_url`? Still get the same error with that
[17:21:35] catbusters: `undefined local variable or method `posts_url' for #<#<Class:0x007fbc43abb7e0>:0x007fbc3fcffde8>`
[17:37:31] catbusters: DylanJ: That worked! Thanks :)
[20:23:02] catbusters: Quit: Connection closed for inactivity

2019-01-13

[00:45:00] catbusters: Quit: Connection closed for inactivity

2019-01-12

[11:37:43] catbusters: has joined #RubyOnRails
[11:37:51] catbusters: has joined #ruby
[11:38:22] catbusters: I've some confusion between `belongs_to` and `has_one`
[11:39:37] catbusters: Say I have two tables, `Product` and `ProductDetails`. Traditionally I'd put a FK for `ProductDetails` on `Product`. But the Rails guide says otherwise, to add `belongs_to` on `ProductDetails` (so `ProductDetails` will have the foreign key instead).
[11:40:17] catbusters: This somehow just doesn't feel right to me, but on the other hand `Product belongs_to ProductDetails` wouldn't make sense either
[15:27:20] catbusters: Quit: Connection closed for inactivity
[21:49:37] catbusters: has joined #ruby
[21:49:38] catbusters: has joined #RubyOnRails
[21:51:57] catbusters: How can I get Guard to ignore the `node_modules` directory?

2019-01-11

[10:38:46] catbusters: has joined #ruby
[10:38:47] catbusters: has joined #RubyOnRails
[10:44:29] catbusters: I have an action in one of my controllers wherein I want to perform an external API call over the network and return the result of that to the client
[10:44:33] catbusters: Something like this: https://dpaste.de/8Wg4#L
[10:45:33] catbusters: However due to the single-threaded and sync nature of ruby this blocks the entire server from responding to any other requests in the meantime, pages don't load, api calls don't go through, etc.
[10:47:13] catbusters: What can I do to work around this? I've seen people recommend moving the API call to a background job and polling the server from the client for updates, but that solution seems suboptimal
[10:55:10] catbusters: tbuehlmann: Yes, that's the plan. Ruby processes = number of cores is what's used right?
[10:58:19] catbusters: tbuehlmann: Alright. Even in that case though, 1 request will block an entire process
[10:58:39] catbusters: Is there any way in which say I could handle the request async like Node?
[11:07:10] catbusters: Okay I'll test that out
[11:07:38] catbusters: Do there happen to be any conventions around making API calls from inside controllers maybe?
[11:27:18] catbusters: Alright thanks for the help tbuehlmann :)
[12:05:10] catbusters: deathwishdave: Registration and authentication can be handled by any Rails application (you might want to look up devise)
[12:05:16] catbusters: Can you expand on the licensing part?
[12:13:52] catbusters: Maybe someone else can correct me, but this sounds like something you'll need to code yourself, not aware of any readymade Gems for this
[18:18:20] catbusters: Quit: Connection closed for inactivity
[18:50:10] catbusters: has joined #RubyOnRails
[18:50:10] catbusters: has joined #ruby
[20:59:18] catbusters: Quit: Connection closed for inactivity

2019-01-08

[16:50:24] catbusters: has joined #ruby
[16:50:25] catbusters: has joined #RubyOnRails
[18:59:22] catbusters: Quit: Connection closed for inactivity

2019-01-07

[01:28:34] catbusters: Quit: Connection closed for inactivity
[12:48:21] catbusters: has joined #ruby
[12:48:22] catbusters: has joined #RubyOnRails
[13:18:16] catbusters: Hi! I'm trying to use Grape to build an API, and I keep coming across examples that show `get "", root: :something`. What is the `root` supposed to do?
[13:25:16] catbusters: What error are you getting?
[13:26:56] catbusters: The code runs for me. Can you post the exact error?
[13:35:59] catbusters: Could be. I'd need to see the exact error though
[18:12:14] catbusters: I'm trying to create a method inside a class that can only be called from within that class. Here's my code (http://tpcg.io/1REYkr) but I can't get it to work
[18:12:21] catbusters: What am I doing wrong?
[18:21:44] catbusters: phaul: How can I fix it? I want to be able to do Something.call (without creating a new instance), and the call method needs to call other private methods
[18:22:34] catbusters: In the example above, I removed `private` from the add definition and made it `self.add` which makes it work, but I don't want `Something.add` to be callable
[18:30:35] catbusters: phaul: You mean like this? https://bpaste.net/show/d06194244e14
[18:34:19] catbusters: phaul: Alright. And what I'm trying to do is create a Rails service object, so does this way of doing it make sense or am I off track?
[19:00:18] catbusters: Thanks, I'll try using modules instead. Out of curiosity, is `private_class_method` preferable to `class << self` though?
[19:00:44] catbusters: phaul: PORO is what I was going for
[19:14:09] catbusters: So many ways to do things 😅
[19:14:29] catbusters: Would just defining a method inside a module be enough?
[23:01:42] catbusters: Quit: Connection closed for inactivity

2019-01-06

[17:29:04] catbusters: has joined #RubyOnRails
[17:29:04] catbusters: has joined #ruby
[17:29:52] catbusters: Hi! I'm trying to use Grape to build an API, and I keep coming across examples that show `get "", root: :something`. What is the `root` supposed to do?

2019-01-05

[14:42:21] catbusters: has joined #RubyOnRails
[14:42:21] catbusters: has joined #ruby
[17:21:51] catbusters: Quit: Connection closed for inactivity

2019-01-04

[13:48:49] catbusters: has joined #RubyOnRails
[13:48:49] catbusters: has joined #ruby
[13:51:39] catbusters: Are example 1 and 2 equivalent? https://bpaste.net/show/713caf53d909
[13:53:07] catbusters: Ok. Getting a bit confused as I'm from JS land and the lack of braces and parens is putting me off balance
[13:56:10] catbusters: And are these two examples also the same? https://bpaste.net/show/4be5bd06866f
[13:58:11] catbusters: What's the resources block inside the scope block? I mean, it looks like calling a function inside another function
[13:58:19] catbusters: Sorry for the noob questions
[14:03:20] catbusters: So I'd be able to define multiple resources blocks inside the scope block?
[16:27:45] catbusters: Quit: Connection closed for inactivity

2019-01-03

[11:41:05] catbusters: has joined #RubyOnRails
[13:50:33] catbusters: Quit: Connection closed for inactivity