How to assign a rating to a replay?

11 views
Skip to first unread message

Alex Szczuczko

unread,
May 9, 2013, 10:31:57 PM5/9/13
to lagtv-...@googlegroups.com
I'm attempting to implement issue #264[1], however I just can't figure
out how to give a replay a rating on my dev site.

The obvious route of clicking on the stars after posting a comment
doesn't produce any result. I thought maybe the rating was parsed out of
the comment itself, but I've tried all sorts of ways of doing that
without success.

Looking through the the page HTML, there's hidden form elements for
ratings, but they're never made visible. There's some indication of a
JavaScript problem on the pages, with this error showing in the dev
console on load for all of Firefox/Chromium/Midori:

TypeError: $(...).live is not a function @
http://192.168.122.70:3000/assets/lagtv.js?body=1:51

Is there an issue with the JavaScript, or am I just missing something?

Thanks,
Alex

[1] - https://github.com/andypike/lagtv/issues/264

Stuka87

unread,
May 9, 2013, 11:03:10 PM5/9/13
to lagtv-...@googlegroups.com
We can't view your page as thats a private IP ;)

Alex Szczuczko

unread,
May 9, 2013, 11:25:09 PM5/9/13
to lagtv-...@googlegroups.com
Thanks for looking at the thread.

The log line is formatted by Firefox when copying console errors; the
only reason I left the IP part in was because I knew it was private.
lagtv.js, line number 51 and the error message are the important parts
if JavaScript's at fault here.

Would you happen to know if I'm on the right track with rating replays?
Should clicking on the stars be setting the rating?

Andy Pike

unread,
May 10, 2013, 11:29:03 AM5/10/13
to lagtv-...@googlegroups.com
I think the problem is that we haven't locked the version of jQuery that is included when you run bundler. The .live method has been removed from the latest version of jQuery so to fix this we either lock the jQuery gem to 1.9.x or we upgrade to the latest version and refactor the use of .live to the equivalent .on method.

I can help with this if that makes it easy for you :o)

In terms of the feature, we just need to add some validation to enforce a rule that an Analyst can only comment once per replay. The overall score for a replay is the average of all rating per replay. Does that make sense? This validation should probably go in the Comment model off the top of my head.

Cheers

Andy


--
You received this message because you are subscribed to the Google Groups "LagTV Website" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lagtv-websit...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Alex Szczuczko

unread,
May 10, 2013, 6:20:47 PM5/10/13
to lagtv-...@googlegroups.com
I don't much experience with JavaScript, so thanks for spotting the root
cause. My install method (involving the crude workaround of deleting
Gemfile.lock) would have ruined a version lock if one were there. I
should revise my method before I encounter a version problem that's my
fault.

Thanks for the direction on where to start. Looking at the rating stuff
is a bit of a tangent from #264, though I expect I would have
encountered this later when I went to test the implementation.

I'll have a look at Comment as you suggest.

Thanks,
Alex
Reply all
Reply to author
Forward
0 new messages