godzirra

Activity Graph

Page 1 of 1

2018-04-05

[08:11:46] godzirra: Ping timeout: 264 seconds

2018-03-26

[16:52:54] godzirra: has joined #RubyOnRails
[16:53:31] godzirra: Hey guys. If I have an app/views/organizations/index.html.erb, and a `def index; end`, why would I not be rendering it? It's telling me server can't connect, even though I see in the server logs that it's conencting and returning a 204.
[16:55:37] godzirra: It's like it's caching when the server had a problem before, and won't stop it. It's weird.
[16:55:47] godzirra: I've tried in a different browser, with the same problem.
[16:57:27] godzirra: https://gist.github.com/slooker/6a26071a2fb239a995aa09fa2e13d547
[16:57:41] godzirra: It's returning a 204, but not the index.html.erb in app/views/orginzations/index.html.erb
[17:07:52] godzirra: I do. It's empty though, other than just validations.
[17:07:59] godzirra: Let me take out the fetch for hte organizations.
[17:08:33] godzirra: After commenting that out, I still get the same thing.
[17:08:42] godzirra: I get the log that it was loaded, but no content.
[17:11:06] godzirra: Yeah, I've been googling, but I haven't found anything. I'm likely not searching for the right things.
[17:12:29] godzirra: Hmm.. looks like it may be a rails 5 thing where it returns a 204 if you don't have a render method?
[17:14:32] godzirra: Okay. That's the only thing I've really found so far. I'm so confused, this seems like it should be super trivial.
[17:16:05] godzirra: When I add a 'render :index', I get a 200 now, but I still don't get my template. :/
[17:19:54] godzirra: It doesn't apparently matter what I add after render, it always returns a 304 with no content
[18:41:30] godzirra: Can anyone tell me why I'm not getting my view rendered when I go to the endpoint? The gist of the controller and logs is here: https://gist.github.com/slooker/6a26071a2fb239a995aa09fa2e13d547 The directory structure for my view is here: https://www.dropbox.com/s/j0wqiu0z5wl7xz5/Screenshot%202018-03-26%2013.00.47.png?dl=0

2015-04-09

[01:54:25] godzirra: Hey guys. How come DateTime.parse("10/13/1994") says invalid date, but 10/12/1994 doesn't/
[01:55:22] godzirra: Oh crap. It's doing day, month, year isn't it.
[01:55:43] godzirra: Is there a way to tell it it's actually doing month/day/year because american dates are dumb?
[01:58:20] godzirra: Nevermind, I figured it out. Pretty much as soon as I realized it was day/month/year...
[02:01:20] godzirra: sevenseacat: thanks

2014-06-13

[18:29:16] godzirra: If I want to do something to data I'm returning as part of a render json call, how do I do that? I'm just trying to format the date in the object I'm returning.
[18:30:41] godzirra: slash_nick: in the controller before rendering it as json
[18:38:55] godzirra: slash_nick: Its an AR object that I'm rendering with render :json. I tried just d oing inspection.date = inspection.date.gsub!(/T.*/, '')
[18:38:58] godzirra: but that didn't seem to work
[18:39:33] godzirra: oh, I guess I should be able to just do inspection.date.gsub!(etc)
[18:40:55] godzirra: Oh, I was doing this: inspection.date = inspection.date.strftime("%Y-%m-%d")
[18:40:59] godzirra: Thanks, let me read up on that.
[18:41:21] godzirra: Seems like it should be pretty easy without adding serializers
[18:41:25] godzirra: I just don't know what I'm doing wrong
[18:43:36] godzirra: Getting it into the json isn't the problem.
[18:43:44] godzirra: Ahh. I didn't know I could do that.
[18:43:51] godzirra: Let me try that. Thanks slash_nick
[18:44:24] godzirra: So if I have a methods: special_date_format, how does it know to transform inspection.date?
[18:44:48] godzirra: Ahhh, okay.
[18:44:58] godzirra: I didn't realize you did it in the model. That makes sense. Thanks.
[18:48:51] godzirra: If I'm doing user.as_json, what do I return when I render? Just user.as_json?
[18:49:06] godzirra: not render json: etc?
[18:49:14] godzirra: Sorry for all the newb questions. I've never done it this way before.
[19:11:06] godzirra: Argh. Nothing I'm doing seems to work.
[19:11:24] godzirra: Can anyone suggest a trivial way to serve up the date in an object formatted with strftime?
[19:12:39] godzirra: Here's my json and my code: http://pastebin.com/1tJYbRTf I just can't figure out how to fix the date before rendering.
[19:13:14] godzirra: https://gist.github.com/slooker/eea907dbcd5afc256b82 is my new paste. ;)
[19:23:55] godzirra: I would probably just make it an instance method, personally.
[19:25:07] godzirra: That should work fine.
[19:25:43] godzirra: https://gist.github.com/slooker/eea907dbcd5afc256b82 is my paste. Can anyone tell me a trivial way to format a date that is part of an object before rendering the object in json?
[19:33:56] godzirra: Sweet. Let me read up on jbuilder and rabl.
[19:43:42] godzirra: bricker`work: Thanks again. I'm reading up on it now.
[19:46:49] godzirra: bricker`work: I'm still reading through, but how do I render the json after I put it through jbuilder?
[19:55:41] godzirra: Hm. In my object, the date is this: 2012-05-18 00:00:00
[19:55:54] godzirra: when I call render json: I'm getting this: 2012-05-18T00:00:00.000Z
[19:56:38] godzirra: bricker`work: so should I not be caling it inside a controller?
[19:56:44] godzirra: Or do I just set it equal to a variable

2014-05-07

[03:27:38] godzirra: aAnyone have any idea what channel I'd go to for help figuring out a DNS issue?
[03:28:06] godzirra: Yeah, I'm a volunteer for a volunteer organization. That's not going to happen.

2014-04-27

[05:04:55] godzirra: Howdy guys.
[05:05:18] godzirra: Can anyone tell me how to allow an id with a period in it? I'm trying to pass a latitude longitude but its not working. Do I need to do it as a post instead of a get?
[05:32:11] godzirra: Not sure if anyone's alive. I've not seen anyone talk in 25 minutes since I joined.
[05:32:47] godzirra: Can anyone tell me how to allow an id with a period in it? I'm trying to pass a latitude longitude but its not working. Do I need to do it as a post instead of a get?

2013-11-24

[03:45:19] godzirra: Hi guys. Can anyone take a look at http://pastie.org/8504430 and tell me what I'm doing wrong? It keeps telling me "uninitialized constant FashionController::Collection", even though I've got a Collections.rb model that is "class Collections < ActiveRecord::Base", Do I need to require my models rb files in my controller or something?
[03:46:43] godzirra: Why do I need a model for every controller?
[03:47:36] godzirra: I thought when I did rails generate, it was supposed to be plural. My mistake.
[03:47:47] godzirra: For models.
[03:47:56] godzirra: Got it, thank you. My mistake.
[04:01:33] godzirra: s2013 & Scient, that was the problem, thank you. Is there a way to tell why I'm getting a constraint error on insert for my model though?
[04:03:31] godzirra: https://gist.github.com/anonymous/d3757dddbc312d7079d4 is the error and the code that it says its erroring on.
[04:05:26] godzirra: Because I need the id from the actual json query I'm doing, not the id its assigning automagically.
[04:05:34] godzirra: Looking on stackoverflow, it said that was an easy way to deal with that.
[04:06:03] godzirra: In the migration, there are no restraints.
[04:06:10] godzirra: No. I didn't know I had to? How do I do that?
[04:06:25] godzirra: The only thing on the table I'm doing out of the ordinary is setting an index on the id
[04:06:36] godzirra: Sorry, on the slug