Linking

  • Nov 01, 2012
  • 3 Comments
I've decided to call the system I'm working on "linking". I think that for every permutation of things I want to connect, "linking" or "sending a link" can be an appropriate description, and that way the concept of "sharing" items isn't overloaded between uploading to the website and connecting items on the website. The possible scenarios are as follows:
  • World to challenge (FishWorld is related to UnderwaterChallenge, but can't be entered in the challenge because it's not built off of the challenge template.)
  • World to world (The world ThroughTheWoods continues the story that began in the world OverTheRiver, so we want to connect them.)
  • World to user ("Suzie, welcome to the LG community!")
  • Challenge to challenge (Anyone interested in UnderwaterChallenge might also be interested in DeepSeaChallenge, so we link them to publicize both.)
  • Challenge to world (Sam noticed that Frodo made the world RingsAreCool, and thought the challenge JourneyToMountDoom might interest him, so Sam wants to link the challenge to the related world.)
  • Challenge to user (Mark found the challenge "JumpOverTheMoon" and knows that Maureen likes cows, so he wants to share a link to the challenge with her in case she's interested.)
  • User to user (Harry thinks Dumbledore just keeps making the coolest worlds, so he wants to show Ron, and thus sends Ron a link to Dumbldore.)
I also want to allow a user to link an item (world, challenge, user) to more than one recipient, but only if the recipients are all users. This has the "group message" feel, and would save time if you wanted to send a particular item to a bunch of people, or even just to a few friends to whom the item would be interesting. However, being able to link a world to a ton of challenges, or some such, feels more like a mechanism for spamming, and that's not something I want to encourage.
 
I've now started coding the linking system. It's got a model, controller, set of fixtures, etc., although it's not especially visible yet in terms of actually appearing on the webpages. I started by trying to model the functionality after that of tags and reports, since I eventually want the links to work with lightboxes. I got the link option on the world show page up to the point where when you mouse over, the url looks as it should compared to the ones for tags and reports, but it doesn't work when you click on it. I think this has something to do with the lightbox_tip IDs.

Since I couldn't get it working with the lightboxes, I took a detour and worked on getting actions to work, since I believe that's how notifications are created. I've got the action model coded up to deal with an item of the Link type. I think I've dealt with the cases for all the polymorphism, since both a link's item and recipient can be of type world, challenge, or user. I then reconfigured the option on the world show page to try to get the link to work the way likes work, such that I could test the actions, but that's not quite working. Various forays into online tutorials have me convinced that the problem is that the controller is choosing the "index" action instead of the "create" action, but I've tried explicitly setting the action to use the POST method (the wise internet-dwellers seem to think that the difference between "index" and "create" is respectively using the GET and POST methods) and it still goes the "index" route. I checked the routes in the config folder, and the ones for Links match the ones for Reports, which I imagine is a good thing. I couldn't find any for Likes. So overall, progress is being made, code has come into existence, and I've tentatively decided on language.

In other news, Jordana put the drastically simplified version of magic sort on the test website, so that's exciting. She also mentioned to me that Scratch essentially gives their users both "featured" worlds and "suggested" worlds but in two separate groups. The problem with magic sort in its more complex version is that all the comparisons and collection reconfiguration make the sorting very slow. Part of that is splicing a fixed number of new and featured worlds into the beginning of the already-deemed-interesting worlds. Separating out the types of recommended worlds might help get a more complex version of magic sort site-ready, such that it doesn't slow everything down. Food for thought.

Comments

  • kyle

    kyle said:

    <p>I think the linking makes a lot of sense. As far as the routes go, you might want to debug or use wireshark to see why it's not honoring your route. These tools usually make quick work of these types of problems.</p>

    Posted on Nov 02, 2012
  • jordana

    jordana said:

    <p>I will help with lightboxes next week if you like.</p>

    Posted on Nov 02, 2012
  • caitlin

    caitlin said:

    <p>I really like the generality of this - it seems to allow a lot of things to happen with one very simple mechanic.</p>

    Posted on Nov 02, 2012

Log In or Sign Up to leave a comment.