Martyn

Activity Graph

Page 1 of 1

2016-07-15

[20:36:53] Martyn: has joined #RubyOnRails
[20:56:31] Martyn: Ping timeout: 244 seconds

2016-06-29

[08:20:56] Martyn: Read error: Connection reset by peer

2016-06-26

[16:13:59] Martyn: has joined #RubyOnRails

2016-05-24

[16:44:41] Martyn: Ping timeout: 250 seconds

2016-05-21

[16:38:03] Martyn: has joined #RubyOnRails

2016-05-01

[23:00:25] Martyn: Quit: Textual IRC Client: www.textualapp.com

2016-04-30

[15:59:52] Martyn: Quit: My Mac has gone to sleep. ZZZzzz…
[21:32:07] Martyn: has joined #RubyOnRails

2016-04-29

[14:23:18] Martyn: has joined #RubyOnRails

2016-04-26

[18:16:46] Martyn: has joined #RubyOnRails
[19:22:36] Martyn: Ping timeout: 246 seconds

2016-04-21

[20:36:16] Martyn: has joined #RubyOnRails
[21:50:18] Martyn: Quit: Textual IRC Client: www.textualapp.com

2016-04-05

[14:17:39] Martyn: has joined #RubyOnRails
[21:35:16] Martyn: Ping timeout: 264 seconds

2016-04-03

[21:50:03] Martyn: Quit: Textual IRC Client: www.textualapp.com

2016-04-01

[11:39:09] Martyn: Quit: My Mac has gone to sleep. ZZZzzz…
[14:17:12] Martyn: has joined #RubyOnRails

2016-03-31

[16:30:53] Martyn: has joined #RubyOnRails

2016-03-30

[06:32:30] Martyn: has joined #RubyOnRails
[14:42:31] Martyn: Ping timeout: 252 seconds
[17:33:46] Martyn: has joined #RubyOnRails
[18:12:33] Martyn: Quit: Textual IRC Client: www.textualapp.com

2016-03-22

[04:38:00] Martyn: Ping timeout: 244 seconds

2016-03-19

[16:50:26] Martyn: Read error: No route to host
[19:38:29] Martyn: has joined #RubyOnRails

2016-03-18

[19:12:17] Martyn: has joined #RubyOnRails

2016-03-10

[14:49:41] Martyn: Quit: Textual IRC Client: www.textualapp.com

2016-03-09

[15:59:33] Martyn: has joined #RubyOnRails

2016-02-16

[15:53:04] Martyn: Ping timeout: 256 seconds

2016-02-13

[00:19:47] Martyn: has joined #RubyOnRails

2016-02-12

[23:53:32] Martyn: Read error: No route to host

2016-01-23

[06:47:59] Martyn: Quit: Textual IRC Client: www.textualapp.com

2016-01-22

[19:22:03] Martyn: has joined #RubyOnRails

2016-01-12

[00:36:42] Martyn: Quit: Textual IRC Client: www.textualapp.com
[00:46:31] Martyn: has joined #RubyOnRails
[14:21:13] Martyn: Quit: Textual IRC Client: www.textualapp.com

2016-01-11

[21:26:07] Martyn: has joined #RubyOnRails

2016-01-07

[02:27:20] Martyn: has joined #RubyOnRails
[02:27:37] Martyn: I need a bit of help debugging an application.
[02:28:47] Martyn: https://github.com/walkeriniraq/twitarr/blob/master/app/controllers/forums_controller.rb
[02:29:14] Martyn: in "new_post" on the URL I just linked, forum = Forum.find(params[:forum_id])
[02:29:37] Martyn: BUT .. when the code is actually executed, I get a server 500 error, and the following error in the debugger log
[02:30:31] Martyn: Mongoid::Errors::InvalidFind (
[02:30:32] Martyn: Calling Document.find with nil is invalid.
[02:30:59] Martyn: And it's true ... if I print the parameters, there is no evidence that forum_id was passed in
[02:32:01] Martyn: I don't like having to format my queries as whole programs
[02:32:13] Martyn: <-- SQL guy, even SQLite is better than mongodb to me
[02:33:44] Martyn: Thing is, I'm pretty sure it shoudln't be "nil"
[02:33:57] Martyn: Let me imgur you a screenshot of the interface --- there -should- be an ID, I think
[02:34:13] Martyn: I think more the latter than the former
[02:34:34] Martyn: <-- learning Ruby/Rails .. the developer of this app is taking a year off ... but I'm in over my head debugging this issue
[02:35:36] Martyn: http://imgur.com/req1LO8
[02:35:56] Martyn: brycesenz : I think so --- rails routes?
[02:36:02] Martyn: or the contents of routes.rb?
[02:37:15] Martyn: http://pastebin.ubuntu.com/14426659/
[02:37:55] Martyn: I'll get the rake routes .. one sec
[02:38:44] Martyn: http://pastebin.ubuntu.com/14426669/
[02:38:52] Martyn: The second paste is a snippet of rake routes
[02:39:47] Martyn: okay, so the developer left this half-connected.
[02:40:08] Martyn: or it's supposed to be nil, which would make FailBit's suggestion correct?
[02:40:22] Martyn: I did .. but isn't a POST different from a PUT?
[02:41:21] Martyn: Okay, so what I'm looking at is an incomplete implementation by the original developer ...
[02:42:13] Martyn: Radar : In the code https://github.com/walkeriniraq/twitarr/blob/master/app/controllers/forums_controller.rb ... it breaks because params(:forum_id) is not set
[02:46:13] Martyn: Radar : I tried modifying the forums_controller.rb to use "id" insted of "forum_id" .. but the problem is that I don't understand what I'm trying to fix
[02:47:25] Martyn: Okay .. so I'm not ruby/rails conversant yet on the difference .. what is a member block, what is a collection block?
[02:47:44] Martyn: I'd like to understand not just how to fix it, but why it's fixed
[02:48:22] Martyn: bookmarked
[02:48:57] Martyn: okay, so I need to get "new_post" out of the collection block
[02:49:53] Martyn: brycesenz : Makes complete sense ... so I need to keep it inside that resources block?
[02:50:57] Martyn: ie... member do
[02:51:03] Martyn: post 'new_post'
[02:52:15] Martyn: and then I should modify the forum_controller.rb to use id instead of forum_id
[02:52:35] Martyn: new_post_forum POST /forums/:id/new_post(.:format) forums#new_post
[02:54:23] Martyn: ActionController::RoutingError (No route matches [POST] "/forums/new_post"):
[02:54:37] Martyn: since it's now forums/id/new_post, it did break, yes
[02:54:54] Martyn: brycesenz : That means editing the coffee files, yes?
[02:56:12] Martyn: three directories
[02:56:44] Martyn: home only has index.html
[02:56:58] Martyn: layouts has three .erb files ( application.html.erb login.html.erb static.html.erb )
[02:57:17] Martyn: user has four .erb files ( create_user.html.erb forgot_password.html.erb login_page.html.erb security_question.html.erb )
[02:58:19] Martyn: It appears in : assets/javascripts/controllers/forums_controller.js.coffee
[02:58:27] Martyn: The entire app is in github, yes
[02:58:45] Martyn: it is also present in assets/javascripts/models/forum.js.coffee
[02:59:14] Martyn: and has one line in router.js.coffee : assets/javascripts/router.js.coffee: @route 'new_post', { path: ':id/new' }
[03:00:36] Martyn: http://pastebin.ubuntu.com/14426772/
[03:00:44] Martyn: Those are all I could find with grep -r
[03:01:04] Martyn: Hey, that's better than me .. I don't know Ember at -all-
[03:04:01] Martyn: and leave the route as "forum_id" in the other code...
[03:04:55] Martyn: updated rake routes, and starting rails
[03:06:45] Martyn: I am already on a new branch and tag .. but I don't have commit access to the github yet
[03:06:57] Martyn: They are working on it
[03:08:45] Martyn: brycesenz : Just started it .. will try to make a post now
[03:10:17] Martyn: http://pastebin.ubuntu.com/14426818/
[03:10:23] Martyn: Doesn't seem to have worked -- as far as adding a new post
[03:10:34] Martyn: But I'm no longer getting an /error/ per se
[03:11:29] Martyn: http://imgur.com/oNe62Cz
[03:11:48] Martyn: But it goes back to the page, no update takes place ... if I go back a level and re-enter the forum, there is no new post under the original one
[03:12:18] Martyn: so, wrong route?
[03:13:37] Martyn: http://10.211.55.22:3000/#/forums/thread/568d91d52cd9ba46c0000001/0
[03:14:32] Martyn: This is the page source of that page : http://pastebin.ubuntu.com/14426844/
[03:19:57] Martyn: brycesenz : Again, thank you immensely for your assistance.
[03:21:12] Martyn: The intent, I think, is to be able to add a new forum post after the initial forum is created
[03:21:31] Martyn: so it needs forum_id of the original post .. so that it can add another post in that forum
[03:22:37] Martyn: http://imgur.com/oNe62Cz
[03:22:44] Martyn: That's the one
[03:22:48] Martyn: I'll capture the URL as well, one sec
[03:23:24] Martyn: http://imgur.com/9QTQkVM
[03:23:30] Martyn: There .. URL, page, and inspector
[03:32:22] Martyn: Ping timeout: 272 seconds
[03:33:34] Martyn: @route 'new_post', { path: ':id/new_post' }
[03:33:38] Martyn: changing the hbs file
[03:34:34] Martyn: yep, changed
[03:34:42] Martyn: starting rails
[03:35:50] Martyn: Hmm .. now nothing happens when I click "Post"
[03:36:09] Martyn: I'm going to print a git diff for you to see what's been changed so far
[03:36:11] Martyn: Npe, no action
[03:37:15] Martyn: http://pastebin.ubuntu.com/14426982/
[03:37:36] Martyn: that should be helpful
[03:39:22] Martyn: hold on -- I see an error
[03:39:55] Martyn: I had a debug line in app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb
[03:42:37] Martyn: nope, nothing changed
[03:42:41] Martyn: I'll give you a valid diff though
[03:43:27] Martyn: current diff : http://pastebin.ubuntu.com/14427013/
[03:44:41] Martyn: change detail.hbs?
[03:44:51] Martyn: or the router.js.coffee?
[03:46:05] Martyn: <button class="btn" {{action 'new'}}>Post</button> -- right?
[03:48:12] Martyn: Well, that earns a WTF
[03:48:16] Martyn: -- nothing -- happened
[03:48:24] Martyn: When I click the button, bupkis
[03:49:40] Martyn: I did create a new forum, to make sure that still works
[03:49:46] Martyn: http://imgur.com/yqPSjTC
[03:51:46] Martyn: @route 'new_post', { path: ':id/new_post' }
[03:51:46] Martyn: @route 'page', { path: ':page' }
[03:51:46] Martyn: @route 'page', { path: '/' }
[03:51:46] Martyn: @resource 'forums', ->
[03:51:48] Martyn: @route 'detail', { path: 'thread/:id/:page'}
[03:51:48] Martyn: @route 'detail', { path: 'thread/:id' }
[03:51:50] Martyn: @route 'new'
[03:51:55] Martyn: sorry -- bad cut/paste
[03:52:40] Martyn: restarting rails
[03:53:25] Martyn: That did something
[03:53:44] Martyn: We're back to getting a response -- but not the right one
[03:54:05] Martyn: http://pastebin.ubuntu.com/14427105/
[03:54:40] Martyn: It hits the "create" path, not the new_post one
[03:55:07] Martyn: http://10.211.55.22:3000/#/forums/thread/568de02c2cd9baab94000001/0
[03:57:59] Martyn: changed hbs file, restarting rails
[03:58:34] Martyn: changing it, disables the button
[03:58:40] Martyn: ember I guess depends on the "new" vs "new_post"
[03:58:46] Martyn: it has a meaning inside of Ember
[04:00:10] Martyn: forum.id or forum_id?
[04:01:18] Martyn: i.e. Twitarr.Forum.new_post(@get('forum.id'), @get('new_post'), @get('photo_ids')).then (response) => ??
[04:01:37] Martyn: not in quotes, I assume
[04:01:43] Martyn: get(forum.id) then?
[04:03:06] Martyn: bsamson : Okay -- did you see the pastebin I put in with all the changes I've made so far?
[04:03:15] Martyn: Because I may have to reverse some to make what you did work
[04:03:39] Martyn: reverting to HEAD, one moment
[04:04:48] Martyn: Reverted to HEAD
[04:04:51] Martyn: changed the one line
[04:04:54] Martyn: restarting RAILS
[04:05:46] Martyn: bsamson : Changed the one line -- but bupkis?
[04:06:16] Martyn: - Twitarr.Forum.new_post(@get('id'), @get('new_post'), @get('photo_ids')).then (response) =>
[04:06:17] Martyn: + Twitarr.Forum.new_post(@get('forum.id'), @get('new_post'), @get('photo_ids')).then (response) =>
[04:06:37] Martyn: --- a/app/assets/javascripts/controllers/forums_controller.js.coffee
[04:06:38] Martyn: +++ b/app/assets/javascripts/controllers/forums_controller.js.coffee
[04:06:41] Martyn: All other changes were reverted
[04:06:49] Martyn: the new_post is back in the controller block
[04:08:17] Martyn: bsamson : Ideas?
[04:09:07] Martyn: none .. just nothing happens
[04:09:38] Martyn: Let me re-clone the repo
[04:09:43] Martyn: I did a git reset HEAD
[04:09:51] Martyn: which should have put us in the same place
[04:10:09] Martyn: rails server -b 0.0.0.0
[04:10:09] Martyn: martin@Twit-arr:~/twitarr$ !rails
[04:10:42] Martyn: Ooo ... that's a nice live screencap ... what application do you use for that?
[04:14:33] Martyn: running rake routes
[04:14:37] Martyn: checking, then running rails again
[04:14:45] Martyn: I'm having an odd issue getting rails started
[04:14:48] Martyn: one moment
[04:16:12] Martyn: I installed the Ember inspector as well into Chrome
[04:16:16] Martyn: Thank you for all your help!
[04:16:34] Martyn: So the -only- thing you changed in the repo was that one line?
[04:27:26] Martyn: bsamson : FIXED. Thank you :)
[04:27:35] Martyn: Once I rolled back the location code, this all works nicely
[04:30:15] Martyn: Tbanks ... I'll go read up tomorrow morning
[04:30:34] Martyn: I need to understand -why- forum.id works
[04:31:00] Martyn: I can see the how .. that makes sense ... but the change from id -> forum.id seems like a small, but significant slip-up
[04:31:17] Martyn: I also had to roll-back the whole "location" thing int he codebase ... I'm surprised it ran at ALL for you
[04:31:34] Martyn: because when I installed the code, I got blocked with a server error
[04:32:09] Martyn: I'm surprised you were able to get it to work from the HEAD position ... did you have to do anything vis-a-vie location?
[04:33:04] Martyn: I had to roll back commit :: git revert 25c0c0deb86da2e9c5f1d4fe1e64c76c6830529a
[04:33:06] Martyn: Yeah, I also commented out the call to location
[04:33:23] Martyn: then rolled back the entire location commit in my repo -- it's unfinished code, and it does't belong there
[04:33:28] Martyn: it's half-implemented
[04:33:35] Martyn: goodnight, and thank you again
[04:46:34] Martyn: Quit: Textual IRC Client: www.textualapp.com