hi, I've a rails app I am working on. However, when I update a post instead of displaying the update the page is blank and that post no longer appears on the homepage (which contains all posts)
phaul: so I should only list one has_many association? I've this for comments as well in the same Class. I am trying to provide the user access. Per the association docs https://guides.rubyonrails.org/images/has_many_through.png
why is it okay to use to_s method to print out a class when .to_s is already a Ruby method? Shouldn't this kind of thing be avoided? Would it not be similar to creating a method called puts? def puts, print etc.?
orbyt_: I see. That's interesting. So convention is to always name this method to_s? I could never use inspect for the method name?
is inspect not simply used for debugging? and .to_s the preferred or accepted method? O_o
orbyt_: I read an accepted response on StackOverflow that stated inspect is for debugging and to_s is the acceptable method
hello, I am creating am method to assign a random number to a value when iterating. however, I want to break out of the loop then resume to ensure all elements have different values. how can i do this?
apeiros_ phaul something like this https://repl.it/repls/YouthfulGreenyellowCharactermapping nothing with arrays. I want to assign random ids to each user while iterating. but if I iterate at once all users will get the same random number. I need a way to break and continue so this does not happen