samort7

Activity Graph

Page 1 of 2 | Next »

2019-05-24

[16:26:47] samort7: Ping timeout: 256 seconds

2019-05-23

[19:34:58] samort7: has joined #RubyOnRails
[19:35:32] samort7: has joined #ruby

2019-05-05

[01:17:11] samort7: Read error: Connection reset by peer

2019-04-22

[02:07:05] samort7: Am I supposed to share credentials.yml.enc or master.key?

2019-04-21

[00:06:26] samort7: has joined #ruby
[00:06:26] samort7: has joined #RubyOnRails
[00:07:32] samort7: If I am installing my project on a 2nd computer, what credentials files do I need to copy over manually? credentials.yml.enc and master.key?

2019-04-09

[13:53:24] samort7: has joined #RubyOnRails
[13:55:21] samort7: has joined #ruby
[15:33:14] samort7: snk: Good morning snk
[15:36:39] samort7: snk: decided to post my issue to SO: https://stackoverflow.com/questions/55596186/use-a-single-form-with-to-create-and-edit-nested-resources-in-rails
[18:22:07] samort7: Quit: Page closed

2019-04-08

[19:25:00] samort7: 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| %>
[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: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: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: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)
[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:07:17] samort7: snk: I was thinking something along those lines as well.
[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: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:13:05] samort7: Probably because that page also contains the form, but doesn't have a direct book to reference
[21:21:55] samort7: Yea. Hmm... Interesting issue
[21:22:41] samort7: I feel like we're close though
[21:25:02] samort7: rtrain300: what were you trying to do when you got that error?
[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: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:20] samort7: snk: so its something! needs more tweaking! but thanks for your helps!
[21:38:38] samort7: snk: thanks!
[22:05:06] samort7: Quit: Page closed

2018-12-23

[03:12:21] samort7: Quit: Leaving

2018-12-21

[06:56:31] samort7: Read error: Connection reset by peer
[16:26:25] samort7: has joined #ruby
[16:26:25] samort7: has joined #RubyOnRails

2018-12-20

[19:22:37] samort7: has joined #RubyOnRails
[19:22:38] samort7: has joined #ruby

2018-12-19

[00:00:30] samort7: Read error: Connection reset by peer

2018-12-18

[17:10:21] samort7: has joined #RubyOnRails
[17:10:21] samort7: has joined #ruby

2018-12-11

[01:55:24] samort7: Ping timeout: 250 seconds
[02:44:08] samort7: has joined #ruby
[02:44:08] samort7: has joined #RubyOnRails
[06:42:13] samort7: Read error: Connection reset by peer

2018-12-10

[16:34:55] samort7: has joined #ruby
[16:34:55] samort7: has joined #RubyOnRails

2018-11-18

[07:23:18] samort7: Read error: Connection reset by peer

2018-11-17

[22:47:47] samort7: has joined #ruby
[22:47:47] samort7: has joined #RubyOnRails

2018-11-09

[15:02:04] samort7: has joined #RubyOnRails
[15:02:04] samort7: has joined #ruby
[16:14:56] samort7: If I have a has_many :through relationship between users and books (so that a user can have many books and books can have many users), how would I create a button/form that when clicked, would create a new relationship in my join table (so that a user would be "favoriting" a book)?
[16:16:34] samort7: I am not sure if I should be using form_tag, form_for, or form_with - and am not sure how the syntax for each of those should be set up
[17:10:52] samort7: ah, this is going to take a lot of time for me to process...
[18:02:32] samort7: Read error: Connection reset by peer
[18:03:03] samort7: has joined #ruby
[18:03:03] samort7: has joined #RubyOnRails
[18:14:13] samort7: Read error: Connection reset by peer

2018-11-06

[07:24:16] samort7: Read error: Connection reset by peer

2018-11-05

[22:39:41] samort7: has joined #ruby
[22:39:41] samort7: has joined #RubyOnRails

2018-11-04

[03:21:45] samort7: Read error: Connection reset by peer

2018-11-03

[01:40:37] samort7: Read error: Connection reset by peer
[15:52:14] samort7: has joined #ruby
[15:52:14] samort7: has joined #RubyOnRails

2018-11-02

[20:33:45] samort7: Inside: I got my join table working and can favorite kit_lists now, thanks to you :)
[22:24:20] samort7: bootstrappm: I am actually a developer in Boston looking for work
[22:24:37] samort7: bootstrappm: Specifically RoR work haha
[22:39:22] samort7: bootstrappm: Just sent you a PM

2018-11-01

[19:32:13] samort7: Model / Active Record question
[19:32:55] samort7: I have a model called "kit_lists" and a model "users"
[19:33:21] samort7: I want a user to favorite kit_lists
[19:34:28] samort7: So I'm trying to figure out what has_many I need to use and if I need to use "through" and if I need to create a third, intermediary model to relate users to kit_lists that they have favorited
[19:35:03] samort7: Sorry, I'm having trouble formulating the question I need to ask, because I'm not exactly sure how I should be structuring this
[19:35:32] samort7: It's like, I want a user to have a collection of kit_lists that they have favorited
[19:35:50] samort7: so I can just do user.favorites and get all of the kit_lists back
[19:37:53] samort7: Can I just add "has_many :kit_lists" to my user model? And if I do that, can two different users be owners of the same kit_list?
[19:39:25] samort7: ("owner" is probably the wrong word there. Can two diff users "have a relationship" with the same kit_list?)
[19:50:21] samort7: by join table, that means I need an intermediary table which contains both ids for users and ids for kit_lists?
[19:51:28] samort7: ah ok! neat!
[19:52:02] samort7: So the user will have "has_many :kit_lists" and the kit_list will have "has_and_belongs_to_many :users"\
[19:52:22] samort7: I just finished Hartle's tutorial and had only learned the "has_many" relationship
[19:52:26] samort7: very cool!
[19:55:42] samort7: what's the difference between the two?
[19:58:29] samort7: oooh. Interesting. Looks like I'll have to research the two of them some more
[19:58:51] samort7: right, that makes sense
[20:01:04] samort7: Ah, that seems pretty definitive then haha
[20:01:52] samort7: I still need to figure out how to setup rubocop haha
[20:02:17] samort7: I've got a laundry list of things to learn :D

2018-10-29

[22:32:49] samort7: has joined #ruby
[22:32:49] samort7: has joined #RubyOnRails

2018-10-25

[05:45:27] samort7: Quit: Leaving
[19:57:57] samort7: has joined #RubyOnRails
[19:57:57] samort7: has joined #ruby
[20:01:34] samort7: Can anyone tell me why my schema doesn't contain the values from my migrations, even after doing rails db:reset?
[20:01:44] samort7: migration: https://github.com/tliss/battlefield-one/blob/kit-models/db/migrate/20181025180009_create_kit_lists.rb
[20:01:54] samort7: schema: https://github.com/tliss/battlefield-one/blob/kit-models/db/schema.rb
[20:02:12] samort7: The string "origin_user" doesn't appear in my schema and I'm not sure why
[20:24:27] samort7: huh. I had to run rake db:rollback a bunch of times to fix it. Weird
[20:49:17] samort7: Read error: Connection reset by peer

2018-10-24

[14:32:37] samort7: has joined #ruby
[14:32:37] samort7: has joined #RubyOnRails
[14:33:31] samort7: I'm trying to learn bootstrap with rails. If I have a row and I want to give that row a border - what do I need to do? I tried adding .row { border: 1px solid red } to my .scss file but it has no effect.
[14:42:08] samort7: ok,m I guess I had it in the wrong place. Can you tell me what the difference is between these two files? I have an application.scss file and a static_pages.scss file (from a view/controlelr I created)
[14:42:29] samort7: the CSS changes only work if I put them in the application.css file. What is the static_pages.scss file used for then?
[14:42:37] samort7: *application.scss
[14:50:56] samort7: nzst: oooh that makes sense
[14:53:09] samort7: nzst: It worked! Thanks!
[14:56:46] samort7: Is it normal to have to use a lot of !important tags to overwrite default bootstrap CSS stylings?
[18:16:47] samort7: nzst: I was just overwriting things like default colors mostly.
[18:25:46] samort7: oh neat, thanks!
[20:27:16] samort7: having trouble sorting an array of hashes
[20:27:46] samort7: ed-e6e4f709.png"]], :kit_num=>"15", :kit_name=>"Artillery Truck"}, {:item_list=>[["0", "Ground Support Attack Plane", "https://eaassets-a.akamaihd.net/battlelog/battlebinary/gamedata/Tunguska/113/23/ground-support-2-seater-71e9cea3.png"]], :kit_num=>"13", :kit_name=>"Attack Plane"}]
[20:27:46] samort7: [{:item_list=>[["1", "Smokey Black", "https://eaassets-a.akamaihd.net/battlelog/battlebinary/gamedata/Tunguska/79/115/Horse-Cavalry-b18d43ed.png"]], :kit_num=>"19", :kit_name=>"Horse"}, {:item_list=>[["0", "Armored Mortar Truck", "https://eaassets-a.akamaihd.net/battlelog/battlebinary/gamedata/Tunguska/100/119/armored-mortar-truck-9c892702.png"], ["1", "Golden Shell", "https://eaassets-a.akamaihd.net/battlelog/battlebinary/gamedata/Tunguska/26/28/Tank-Armor
[20:28:16] samort7: How would I sort the array of hashes based on the value of the :kit_num key?
[20:33:23] samort7: https://codeshare.io/2pOl7E
[20:33:23] samort7: Here's a better formatted version
[20:33:37] samort7: phaul: I tried that but I keep getting undefined method 'kin_num' error
[20:36:59] samort7: it did work
[20:37:19] samort7: shouldn't sort_by!(&:kit_num) also work?
[20:40:34] samort7: ok, i was confusing symbols with methods i guess
[20:51:48] samort7: ah, that can be a bit confusing i guess

2018-10-22

[19:43:48] samort7: has joined #RubyOnRails
[19:43:48] samort7: has joined #ruby
[19:48:23] samort7: Ping timeout: 245 seconds

2018-10-18

[14:07:09] samort7: has joined #RubyOnRails
[14:07:09] samort7: has joined #ruby
[14:07:43] samort7: What is the purpose of the "listen" gem? It seems to me it just does the same thing that Git does?
[14:09:48] samort7: if I do 'git status' it tells me what files have been added/changed/removed
[14:09:52] samort7: isn't that the same thing?
[14:10:56] samort7: is it just that listen actively notifies you in console, whereas with git you have to to invoke the change yourself?
[14:11:43] samort7: tbuehlmann: is it something used internally by rails?
[14:11:57] samort7: tbuehlmann: ah I see
[14:12:53] samort7: Ok. Just trying to figure out what each default gem does and which ones I can remove / shouldn't touch (because they'll break Rails functionality)
[14:17:41] samort7: tbuehlmann, tell me more about spring. Is it the same spring used in, like, Java Spring? And what does it do exactly?
[14:32:41] samort7: tbuehlmann, ah, that does sound annoying. I feel like I have noticed that happening to me sometimes too
[14:48:43] samort7: haha jesus
[16:21:25] samort7: Read error: Connection reset by peer
[19:54:49] samort7: has joined #RubyOnRails
[19:54:49] samort7: has joined #ruby
[20:49:07] samort7: Read error: Connection reset by peer
[20:49:29] samort7: has joined #ruby
[20:49:29] samort7: has joined #RubyOnRails
[21:57:29] samort7: Read error: Connection reset by peer

2018-10-17

[04:10:41] samort7: Big night tonight. Finally finished Hartl's Ruby on Rails tutorial. Got a working Twitter clone :-D
[04:12:04] samort7: FreshCache, thanks!
[04:12:57] samort7: Now I need to come up with a project idea to build myself so I can get better
[04:15:33] samort7: Yea, I've been trying to come up with something I actually want/need and have blanking out somewhat. What were some of the first things you built when you were learning Rails?
[04:18:15] samort7: haha ok, I'll keep an eye out for them
[04:19:11] samort7: I was legit discussing with my mother today the possibility of me making a site for her
[04:19:24] samort7: She sells cats and could use some site to catalog and give info about them
[04:19:55] samort7: So a cat-alog would could be a very real thing in my future
[04:20:47] samort7: Also had an interview today for a Ruby on Rails position
[04:21:05] samort7: didn't get it (but wasn't really anticipating that I would)
[04:21:34] samort7: no biggie. Was an online education company. 100% remote and only has 4 employees
[04:21:47] samort7: I'm thinking I might need a little more structure since I'm still pretty new to software dv
[04:23:11] samort7: yea. I originally was learning Spring, but gave it up after a bit. I feel like I have a waaay better understanding of MVC after the Rails Tutorial than I did in the months I was learning SPring
[04:23:27] samort7: That too. Rails docs are really nice
[07:32:15] samort7: Read error: Connection reset by peer

2018-10-08

[18:31:15] samort7: has joined #ruby
[18:31:16] samort7: has joined #RubyOnRails
[18:31:52] samort7: when I examine log/test.log, it's filled with a bunch of squares. Anyone know why this might be happening
[18:32:10] samort7: like this: [1m[35m (0.1ms)[0m [1m[34mSELECT COUNT(*) FROM "users"[0m
[18:33:21] samort7: hmm, if I open it with vim, I see this: ^[[1m^[[35m (0.1ms)^[[0m ^[[1m^[[34mSELECT COUNT(*) FROM "users"^[[0m
[18:48:27] samort7: alright so my escape codes aren't being rendered for some reason. weird
[18:55:05] samort7: Yea, I'm messing with it right now. I'm on WSL using RubyMine
[21:47:59] samort7: Quit: Leaving

2018-10-07

[16:52:35] samort7: has joined #ruby
[16:52:35] samort7: has joined #RubyOnRails
[16:53:43] samort7: I'm new to metaprogramming and was looking at the docs for instance_variable_set and in https://apidock.com/ruby/Object/instance_variable_set it says: "Sets the instance variable names by symbol to object, thereby frustrating the efforts of the class’s author to attempt to provide proper encapsulation. The variable did not have to exist prior to this call."
[16:53:49] samort7: Is this meant to be a joke?
[17:51:22] samort7: The use of the word "frustrating" makes me feel like this is a method I should not be using?
[21:39:40] samort7: Read error: Connection reset by peer

2018-10-06

[04:11:33] samort7: Read error: Connection reset by peer

2018-10-05

[19:42:20] samort7: has joined #ruby
[19:42:20] samort7: has joined #RubyOnRails
[19:43:03] samort7: Question: Why do we have migrations? Like, I understand what they do, but why do we incrementally change a database schema? Why don't we just have one massive file that lays out what the schema should look like?
[20:00:10] samort7: tbuehlmann, oh, right. So if we have that file, why do we have migrations? Why don't we just adjust schema.rb when we need the schema to change?
[20:02:45] samort7: oh, so for example, if we were to rename a column, we would somehow need to communicate that to the production version.
[20:03:23] samort7: ah, ok. That makes a lot of sense. Thanks!

2018-09-18

[21:25:47] samort7: Ping timeout: 240 seconds

2018-09-17

[01:14:05] samort7: has joined #ruby
[01:14:05] samort7: has joined #RubyOnRails

2018-09-16

[14:36:08] samort7: Read error: Connection reset by peer

2018-09-13

[08:48:25] samort7: Read error: Connection reset by peer
[18:06:30] samort7: has joined #ruby
[18:06:30] samort7: has joined #RubyOnRails

2018-09-12

[02:16:08] samort7: has joined #ruby
[02:16:08] samort7: has joined #RubyOnRails
[02:16:57] samort7: Anyone awake?
[02:22:57] samort7: I have a really noobish question about how forms work: https://codeshare.io/2BjAQK
[02:23:13] samort7: Just not sure why we create a new user object twice
[02:25:02] samort7: Right. So why do we need a user object at all, at that point?
[02:26:19] samort7: sevenseacat: right - form_for creates a hash called user that contains all the entries, right?
[02:26:46] samort7: and that hash exists inside params, I think?
[02:28:44] samort7: ok, and then the form passes that data back to create, where it calls the user_params method to filter it, and passes those filter results to a new user object
[02:29:44] samort7: I guess I am still trying to understand what NeoHamled was saying - how the @user variable in new interacts with the form
[02:32:42] samort7: oh that's pretty neat. Another "rails magic" moment it seems
[02:34:39] samort7: sevenseacat: I just tried that @user.email thing - that's pretty cool!!!
[02:38:40] samort7: sevenseacat: oooh! That makes tons of sense!

2018-09-10

[17:37:28] samort7: has joined #RubyOnRails
[17:37:28] samort7: has joined #ruby
[17:41:48] samort7: Client Quit

2018-09-05

[03:17:25] samort7: has joined #ruby
[03:17:25] samort7: has joined #RubyOnRails
[06:42:42] samort7: Quit: Leaving

2018-09-04

[03:51:00] samort7: Read error: Connection reset by peer
[17:46:56] samort7: has joined #ruby
[17:47:01] samort7: has joined #RubyOnRails
[18:05:38] samort7: Quit: Leaving
[20:35:12] samort7: has joined #ruby
[20:35:13] samort7: has joined #RubyOnRails
[21:41:50] samort7: Quit: Leaving

2018-09-03

[16:46:01] samort7: has joined #ruby
[16:46:01] samort7: has joined #RubyOnRails
[16:46:55] samort7: Can anyone tell me why .map! isn't working here?
[16:46:57] samort7: https://codeshare.io/5MyO7R
[16:47:16] samort7: `Line 43: in `block in max_increase_keeping_skyline': undefined method `map!' for #<Enumerator: [3, 0, 8, 4]:each_with_index> (NoMethodError)`
[16:51:11] samort7: apeiros: I am not sure I understand
[16:51:39] samort7: apeiros: I was googling how to change an array as you iterate through it and all the stack overflow answers said to use map
[16:52:28] samort7: oh, right. That makes sense
[16:52:38] samort7: So how do I change the values as I iterate through them?
[16:55:35] samort7: so the problem was where i was calling .map!
[16:57:09] samort7: apeiros: I think I was thrown off by this question where he calls map __after__ .each_with_index
[16:57:15] samort7: https://stackoverflow.com/questions/4697557/how-to-map-with-index-in-ruby
[16:59:31] samort7: aah, interesting
[17:00:29] samort7: apeiros: I guess I need to read up on what an enumerator is