eyeamaye

Activity Graph

Page 1 of 5 | Next »

2016-08-01

[00:31:57] eyeamaye: Quit: Leaving.

2016-07-31

[00:10:37] eyeamaye: Quit: Leaving.
[00:26:49] eyeamaye: has joined #RubyOnRails
[01:39:37] eyeamaye: Quit: Leaving.
[05:17:50] eyeamaye: has joined #RubyOnRails
[05:26:50] eyeamaye: will the asset pipeline only serve css for a controller if i'm using resources :controller in the routes?
[05:28:03] eyeamaye: or do i just need to be using @import in my application.scss ?
[05:29:57] eyeamaye: oh, hmm. it looks like controller-specific assets might not be the default in rails 5?
[08:30:04] eyeamaye: Quit: Leaving.
[17:40:21] eyeamaye: has joined #RubyOnRails

2016-07-30

[00:20:49] eyeamaye: Quit: Leaving.
[04:23:23] eyeamaye: has joined #RubyOnRails
[06:01:15] eyeamaye: Quit: Leaving.
[06:31:56] eyeamaye: has joined #RubyOnRails
[08:16:30] eyeamaye: Quit: Leaving.
[18:53:03] eyeamaye: has joined #RubyOnRails
[19:32:52] eyeamaye: Quit: Leaving.
[19:33:58] eyeamaye: has joined #RubyOnRails

2016-07-29

[06:49:41] eyeamaye: has joined #RubyOnRails
[08:29:18] eyeamaye: Quit: Leaving.
[20:24:08] eyeamaye: has joined #RubyOnRails

2016-07-28

[02:54:34] eyeamaye: Ping timeout: 250 seconds
[20:02:14] eyeamaye: has joined #RubyOnRails
[20:35:45] eyeamaye: Ping timeout: 276 seconds

2016-07-27

[19:40:44] eyeamaye: has joined #RubyOnRails
[19:41:47] eyeamaye: could someone tell me if what i'm doing in the controller here is safe? http://pastie.org/private/8xiizatxwl1yekthyyszug
[19:41:58] eyeamaye: specifically the create method
[19:42:52] eyeamaye: additionally, am i correct in thinking this kind of logic belongs in the controller, or is it more suited in the model, maybe via the before_save callback?
[19:44:12] eyeamaye: adam, i'm using date field in postgres
[19:44:20] eyeamaye: on the views though, yes
[19:44:26] eyeamaye: it's a plain text field and not the date helper
[19:45:08] eyeamaye: to be clear, i'm NOT using the date_field
[19:45:36] eyeamaye: i'm not opposed to using it but i'm using uh. gem 'bootstrap-datepicker-rails'
[19:45:52] eyeamaye: yes the code works
[19:46:10] eyeamaye: let me see if it saves
[19:46:51] eyeamaye: okay yes it saves
[19:47:07] eyeamaye: so the code works
[19:47:19] eyeamaye: i would assume activerecord would typecast it for me too but
[19:47:22] eyeamaye: i guess not
[19:47:26] eyeamaye: maybe if i was using the date_field
[19:47:30] eyeamaye: i suppose i can try it
[19:49:04] eyeamaye: date_field actually has a date picker
[19:49:10] eyeamaye: it feels pretty terrible to use but
[19:49:24] eyeamaye: it has one. didn't know that
[19:50:10] eyeamaye: adam^: soa re you saying that without any doubt, activerecord should be typecasting for me?
[19:50:19] eyeamaye: s/soa re/so are/
[19:50:51] eyeamaye: yeah i should
[19:50:54] eyeamaye: let me see about that
[19:52:01] eyeamaye: so this is nil
[19:52:35] eyeamaye: => #<User id: nil, email: "walkk@test", username: nil, lonlat: nil, bio: nil, created_at: nil, updated_at: nil, birthday: nil, name: nil, gender: nil>
[19:52:35] eyeamaye: User.new(email: "walkk@test", password: "temppass", birthday: "05/31/2010")
[19:52:49] eyeamaye: do i need anything in the model to direct activerecord to cast it?
[19:55:32] eyeamaye: well i guess back to my original question then
[19:55:54] eyeamaye: is using DateTime.strptime in the controller safe?
[19:56:00] eyeamaye: why in the model?
[19:58:06] eyeamaye: hmm. im not sure why but i kinda see it as being controller responsibility because i feel like the model shouldn't be responsible for formatting data.
[19:58:30] eyeamaye: if the model took input from multiple sources, in multiple formats, it would get messy
[19:58:54] eyeamaye: but if the respective controllers formatted the data to fit into the model's constraints, everything would be pretty clean
[20:05:48] eyeamaye: matthewd, can you please explain?

2016-07-26

[06:46:27] eyeamaye: has joined #RubyOnRails
[06:49:52] eyeamaye: so i've been contracted to build a social network. i'm not super experienced with rails but i've built a few small projects and i do have a couple years of working with various web technologies under my belt. i'm trying to decide whether i should make a profile model, or if i should add all profile fields to the user model. i'd like to understand why it's best to build it one way vs the other.
[06:50:59] eyeamaye: sevenseacat: okay that's kinda how i felt about it, but for some reason i felt like creating a profile model would be the rails way to do it
[08:25:55] eyeamaye: i'm using devise and i'd like to create a step after registration where a user fills out their public profile. i believe i need to add a new controller method and create the views, but i'm not sure where i should add the controller method. I've generated the devise controllers for the user model and there isn't a "user" controller. right now i'm thinking i should create a new controller in the registrations namespace, but i'm not su
[08:26:30] eyeamaye: to be clear, i'm not asking how to redirect after registration, i know how to do this
[08:27:38] eyeamaye: sevenseacat: yeah that's why i'm thinking that's where it should go, but editing a user's profile isn't really a registration only task. it's something the user might want to do on a regular basis. which is why i'm questioning :P
[08:28:32] eyeamaye: not sure how but
[08:29:10] eyeamaye: well the stuff after that is just
[08:29:19] eyeamaye: , but i'm not sure. any advice would be greatly appreciated
[08:30:31] eyeamaye: anyways. since it's not something that's registration only, i think creating a new controller in registration namespace might be a good way to separate the concerns
[08:30:54] eyeamaye: well, long term might be massive multi-step settings page
[08:31:27] eyeamaye: short term though, it's not too many fields but it's far more than i should show on step 1.
[08:32:32] eyeamaye: i do think i want to have the changing password and email stuff on a separate page from the profile fields
[08:33:51] eyeamaye: this SO answer seems to show that i can just create a users controller that inherits from application controller
[08:34:04] eyeamaye: https://stackoverflow.com/a/7087112
[08:37:11] eyeamaye: right, i just didn't realize that i could simply create a users controller :3
[08:53:24] eyeamaye: thanks sevenseacat, much appreciated
[09:53:42] eyeamaye: Quit: Leaving.

2016-05-17

[01:30:31] eyeamaye: Quit: Leaving.
[01:48:23] eyeamaye: has joined #RubyOnRails
[02:17:14] eyeamaye: Read error: Connection reset by peer
[02:17:32] eyeamaye: has joined #RubyOnRails
[04:23:59] eyeamaye: Quit: Leaving.
[04:24:55] eyeamaye: has joined #RubyOnRails
[06:25:13] eyeamaye: Quit: Leaving.

2016-05-16

[04:46:05] eyeamaye: Read error: Connection reset by peer
[08:33:24] eyeamaye: has joined #RubyOnRails
[11:10:34] eyeamaye: Quit: Leaving.
[17:54:54] eyeamaye: has joined #RubyOnRails
[18:29:59] eyeamaye: Read error: Connection reset by peer
[18:36:16] eyeamaye: has joined #RubyOnRails
[21:31:55] eyeamaye: Read error: Connection reset by peer
[22:28:03] eyeamaye: has joined #RubyOnRails
[23:04:55] eyeamaye: Quit: Leaving.
[23:53:20] eyeamaye: has joined #RubyOnRails

2016-05-15

[02:08:25] eyeamaye: has joined #RubyOnRails
[04:45:31] eyeamaye: Quit: Leaving.
[04:46:55] eyeamaye: has joined #RubyOnRails
[04:49:03] eyeamaye: Read error: Connection reset by peer
[04:49:23] eyeamaye: has joined #RubyOnRails
[05:06:50] eyeamaye: Quit: Leaving.
[05:09:10] eyeamaye: has joined #RubyOnRails
[05:11:15] eyeamaye: Read error: Connection reset by peer
[05:11:36] eyeamaye: has joined #RubyOnRails
[06:29:30] eyeamaye: Quit: Leaving.
[06:29:47] eyeamaye: has joined #RubyOnRails
[07:35:52] eyeamaye: Quit: Leaving.
[22:59:50] eyeamaye: has joined #RubyOnRails
[23:21:53] eyeamaye: Read error: Connection reset by peer
[23:22:15] eyeamaye: has joined #RubyOnRails

2016-05-14

[04:45:25] eyeamaye: has joined #RubyOnRails
[04:45:45] eyeamaye: is it risky to do something like this? params.require(:test).permit(:type, answers: params[:test][:answers].try(:keys))
[04:46:04] eyeamaye: i found that in the rails guide but
[04:46:19] eyeamaye: my brain tells me it kinda defeats the purpose of strong params.
[08:45:34] eyeamaye: Quit: Leaving.
[14:34:34] eyeamaye: has joined #RubyOnRails
[15:03:15] eyeamaye: Quit: Leaving.
[16:38:32] eyeamaye: has joined #RubyOnRails
[20:26:51] eyeamaye: Quit: Leaving.
[20:30:08] eyeamaye: has joined #RubyOnRails
[21:20:30] eyeamaye: Quit: Leaving.
[22:12:34] eyeamaye: has joined #RubyOnRails
[22:22:37] eyeamaye: Quit: Leaving.
[23:08:13] eyeamaye: has joined #RubyOnRails
[23:58:09] eyeamaye: Quit: Leaving.

2016-05-01

[00:44:07] eyeamaye: Quit: Leaving.
[01:17:38] eyeamaye: has joined #RubyOnRails
[03:09:20] eyeamaye: Read error: Connection reset by peer
[04:09:59] eyeamaye: has joined #RubyOnRails
[04:57:52] eyeamaye: Quit: Leaving.

2016-04-30

[03:45:17] eyeamaye: Quit: Leaving.
[03:46:03] eyeamaye: has joined #RubyOnRails
[09:55:58] eyeamaye: Quit: Leaving.
[17:36:40] eyeamaye: has joined #RubyOnRails
[20:05:41] eyeamaye: Ping timeout: 250 seconds
[20:16:36] eyeamaye: has joined #RubyOnRails

2016-04-29

[23:10:17] eyeamaye: has joined #RubyOnRails

2016-04-16

[20:19:35] eyeamaye: has joined #RubyOnRails
[20:19:59] eyeamaye: Client Quit

2016-04-12

[00:58:34] eyeamaye: has joined #RubyOnRails
[03:12:50] eyeamaye: Quit: Leaving.
[04:59:52] eyeamaye: has joined #RubyOnRails
[08:03:09] eyeamaye: Quit: Leaving.
[18:43:52] eyeamaye: has joined #RubyOnRails
[19:54:42] eyeamaye: Ping timeout: 268 seconds

2016-04-11

[04:03:10] eyeamaye: has joined #RubyOnRails
[08:40:51] eyeamaye: Quit: Leaving.
[18:44:36] eyeamaye: has joined #RubyOnRails
[19:20:02] eyeamaye: Read error: Connection reset by peer

2016-04-10

[02:25:05] eyeamaye: has joined #RubyOnRails
[10:19:48] eyeamaye: Read error: Connection reset by peer
[10:20:08] eyeamaye: has joined #RubyOnRails
[11:20:33] eyeamaye: Quit: Leaving.
[20:30:45] eyeamaye: has joined #RubyOnRails
[20:56:53] eyeamaye: Quit: Leaving.
[20:57:43] eyeamaye: has joined #RubyOnRails
[22:11:25] eyeamaye: Quit: Leaving.

2016-04-09

[00:43:43] eyeamaye: has joined #RubyOnRails
[00:57:06] eyeamaye: Read error: Connection reset by peer
[03:26:13] eyeamaye: has joined #RubyOnRails
[03:30:27] eyeamaye: Read error: Connection reset by peer
[07:14:04] eyeamaye: has joined #RubyOnRails
[07:43:32] eyeamaye: Quit: Leaving.
[09:44:35] eyeamaye: has joined #RubyOnRails
[10:45:57] eyeamaye: Quit: Leaving.
[11:46:12] eyeamaye: has joined #RubyOnRails
[12:28:45] eyeamaye: Quit: Leaving.
[13:37:07] eyeamaye: has joined #RubyOnRails
[13:41:34] eyeamaye: Ping timeout: 252 seconds
[18:08:31] eyeamaye: has joined #RubyOnRails
[20:10:01] eyeamaye: Read error: Connection reset by peer
[20:10:23] eyeamaye: has joined #RubyOnRails
[22:20:38] eyeamaye: Quit: Leaving.

2016-04-08

[02:20:53] eyeamaye: Quit: Leaving.
[18:27:05] eyeamaye: has joined #RubyOnRails
[22:08:43] eyeamaye: Read error: Connection reset by peer

2016-04-07

[00:49:10] eyeamaye: has joined #RubyOnRails
[05:20:34] eyeamaye: Quit: Leaving.
[05:50:55] eyeamaye: has joined #RubyOnRails
[06:53:19] eyeamaye: Quit: Leaving.
[06:54:13] eyeamaye: has joined #RubyOnRails
[07:04:18] eyeamaye: Quit: Leaving.
[07:05:03] eyeamaye: has joined #RubyOnRails
[07:39:57] eyeamaye: Read error: Connection reset by peer
[07:40:08] eyeamaye: has joined #RubyOnRails
[07:45:47] eyeamaye: Read error: Connection reset by peer
[19:54:04] eyeamaye: has joined #RubyOnRails

2016-04-06

[05:37:30] eyeamaye: has joined #RubyOnRails
[09:11:17] eyeamaye: Quit: Leaving.
[17:32:28] eyeamaye: has joined #RubyOnRails
[18:04:30] eyeamaye: how can I add a child's attributes into the parent's response body?
[18:05:29] eyeamaye: hmm… then maybe a better way to ask this is, how can I add custom fields to response body?
[18:06:28] eyeamaye: AJAX PUT. and the response body contains all the model's attributes. I want to add some stuff in there.
[18:07:35] eyeamaye: cnk: oooh is that what jbuilder templates are for? neat.
[18:07:51] eyeamaye: arup_r: no, just promises and XHR
[18:09:07] eyeamaye: thanks cnk!
[18:31:20] eyeamaye: Ping timeout: 268 seconds
[18:35:54] eyeamaye: has joined #RubyOnRails
[18:39:14] eyeamaye: cnk: I'm reading through https://robots.thoughtbot.com/better-serialization-less-as-json and it seems to make a good case for skipping overriding as_json / serializable_hash and going straight for a serializer.
[18:40:28] eyeamaye: they're overriding as_json with super though, you might be proposing I just completely override it?
[18:42:41] eyeamaye: skullz, are you referring to activerecord relations?
[18:44:20] eyeamaye: cnk: yeah, your response told me exactly what I needed, i'm just trying to get an idea of your reasoning. which you provided, so thanks again!
[18:44:41] eyeamaye: skullz: so are you asking if you can find out what the activerecord relationship is from another gem?
[18:45:06] eyeamaye: i'm looking at arel now.
[18:46:29] eyeamaye: are you trying to get the has_many? or are you trying to build a query for the id of whatever object you're looking for? or are you trying to get a child object without knowing what the child is?
[18:50:22] eyeamaye: godzillaenlacasa: why?
[18:53:11] eyeamaye: maybe someone can tell you a better way to do this but you probably want to make an AJAX call on the client. you might want to pop out a specific controller for that action.
[18:53:38] eyeamaye: but no, you can't run javascript in the controller. you can have javascript on the client interact with a controller through AJAX though.
[19:15:10] eyeamaye: Read error: Connection reset by peer
[19:15:29] eyeamaye: has joined #RubyOnRails
[19:34:50] eyeamaye: Read error: Connection reset by peer
[19:35:08] eyeamaye: has joined #RubyOnRails
[21:33:04] eyeamaye: does anyone know if I can use jsonapi-resources along with html templates?
[21:44:05] eyeamaye: tubbo: hmm. jsonapi-resources /might/ be a little overkill. but the problem i'm trying to solve is creating and deleting linked resources, basically in the same way described in this sample curl from the peeps example.
[21:44:08] eyeamaye: curl -i -H "Accept: application/vnd.api+json" -H 'Content-Type:application/vnd.api+json' -X POST -d '{ "data": { "type": "phone-numbers", "relationships": { "contact": { "data": { "type": "contacts", "id": "1" } } }, "attributes": { "name": "home", "phone-number": "(603) 555-1212" } } }' http://localhost:3000/phone-numbers
[21:45:16] eyeamaye: maybe i can accomplish this with a normal serializer though.
[21:48:12] eyeamaye: hmm actually I'm pretty sure I can.
[21:51:22] eyeamaye: Quit: Leaving.
[22:22:05] eyeamaye: has joined #RubyOnRails
[22:40:06] eyeamaye: Quit: Leaving.

2016-04-05

[01:33:41] eyeamaye: Quit: Leaving.
[02:42:13] eyeamaye: has joined #RubyOnRails
[09:45:02] eyeamaye: Quit: Leaving.
[17:36:12] eyeamaye: has joined #RubyOnRails
[21:06:19] eyeamaye: Quit: Leaving.
[23:40:04] eyeamaye: has joined #RubyOnRails
[23:41:05] eyeamaye: Client Quit

2016-04-04

[21:22:10] eyeamaye: I know for a fact redux will work for you though.
[21:23:41] eyeamaye: I'm trying to find a link that I ran into once that explained how to do exactly what you're trying to do with redux. let me try and find it.
[21:25:57] eyeamaye: WhatTheRails: Yeah you probably could but I'd suggest learning how to use dispatchers, they're much nicer than setState
[21:26:48] eyeamaye: WhatTheRails: https://egghead.io/series/getting-started-with-redux video tutorial from the creator of redux
[21:28:28] eyeamaye: That's just how to use redux in general. Not your specific problem, still trying to find that link…
[21:32:06] eyeamaye: WhatTheRails: I think you're going to end up putting everything under a single component anyways, but redux will make the communication between those components trivial.
[21:36:51] eyeamaye: If I've got a polymorphic relationship representing 3 distinct models, would it be advisable to have separate controllers for each distinct model for their own unique field and validation requirements, or are there any conventions that make it easy to have a clean unified controller?
[21:39:15] eyeamaye: cnk: Okay, thanks. I'll try that, and you just answered my second question of whether it's safe to rely on model validation
[21:44:41] eyeamaye: cnk: what do you think about doing something like this to differentiate which type it is? http://pastie.org/10785631
[21:47:42] eyeamaye: Oh okay, I see what you mean. I think I understand what to do now. Thanks!
[21:48:07] eyeamaye: Apologies for my apparently annoying questions :3
[21:49:53] eyeamaye: smathy: noted