I subscribe to several Dribbble RSS feeds from which I'm constantly clicking through to shot pages. I can never remember which feed I'm coming from (Following v. Everyone) and it drives me crazy that I have to click through to the user page to tell whether I'm already following the owner of a shot I like. So ...
We've added a convenience to shot pages to show following status and follow/unfollow without having to navigate to the player page. Having said that - if you're unfamiliar with a player but like what you see, check them out!
Nerdly addendum: The follow helper worked out of the box (box?) when dropped into the page. (Well, with some styling from Mr. Bits.) Modularity FTW!
Yes yes and yes! Thanks you kind sir. Im was finding the back and forth clicks to see my follow status of other players quite tiresome. Glad I wasn't the only one :)
@Dave I probably exaggerated the awesomeness of what's going on, but I'm always happy (read: relieved) when something just works. We have a follow_prompt Rails helper method and simply called it from the new page and it spit out a working follow button.
Ingredients are JavaScript, a partial containing the follow form markup and use of standard Rails associations wrapped by a User.follows?(other_user) method. But the key is using unobtrusive JavaScript that simply attaches the ajax behavior to any occurrence of the follow button markup. So wherever it appears (quite a few places now, styled per context by the Fantastic Mr. Bits), it works. No rocket science, but anything I don't have to code again pleases me.
16 Responses
Pro
Rich Thornett
I subscribe to several Dribbble RSS feeds from which I'm constantly clicking through to shot pages. I can never remember which feed I'm coming from (Following v. Everyone) and it drives me crazy that I have to click through to the user page to tell whether I'm already following the owner of a shot I like. So ...
We've added a convenience to shot pages to show following status and follow/unfollow without having to navigate to the player page. Having said that - if you're unfamiliar with a player but like what you see, check them out!
Nerdly addendum: The follow helper worked out of the box (box?) when dropped into the page. (Well, with some styling from Mr. Bits.) Modularity FTW!
over 1 year ago
Pro
Josh Hemsley
Yes yes and yes! Thanks you kind sir. Im was finding the back and forth clicks to see my follow status of other players quite tiresome. Glad I wasn't the only one :)
over 1 year ago
Pro
Rich Thornett
Sorry, I should add that this isn't pushed just yet. But it will be soon.
over 1 year ago
Pro
Josh Hemsley
lol I noticed that VERY quickly :)
over 1 year ago
Pro
Mackey Saturday
Thanks Rich! I'm super excited for this. Great idea!
over 1 year ago
Pro
Andrew Cornett
Love it dude
over 1 year ago
Pro
Henry Moran
Fantastic feature Rich!
over 1 year ago
Pro
Gert Jan Lodder
Great feature Rich!
over 1 year ago
Pro
Rich Thornett
Ok, now it's pushed. Hope you find it useful.
over 1 year ago
Awesome!
over 1 year ago
Way cool. Did you just set up a `current_user.is_following` scope? Or is there a `follow_helper.rb` that i don't know about :)
over 1 year ago
Pro
Rich Thornett
@Dave I probably exaggerated the awesomeness of what's going on, but I'm always happy (read: relieved) when something just works. We have a follow_prompt Rails helper method and simply called it from the new page and it spit out a working follow button.
Ingredients are JavaScript, a partial containing the follow form markup and use of standard Rails associations wrapped by a User.follows?(other_user) method. But the key is using unobtrusive JavaScript that simply attaches the ajax behavior to any occurrence of the follow button markup. So wherever it appears (quite a few places now, styled per context by the Fantastic Mr. Bits), it works. No rocket science, but anything I don't have to code again pleases me.
over 1 year ago
jQuery.live()?
over 1 year ago
Pro
Rich Thornett
@Chris Yes. $('.follow-prompt a').live('click', ...);
over 1 year ago
That's how I would do it, so that means it's the right way.
over 1 year ago
Pro
Ethan Geyer
Rich, I'm loving this. Thanks for your work!
over 1 year ago