Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7440899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:55:25+00:00 2026-05-29T10:55:25+00:00

1 — What do I have: User model and Social Networks Model A user

  • 0

1 — What do I have:

  • User model and Social Networks Model
  • A user can have many social networks and a social network belongs to a user
  • I store the token, uid and name of the social network (and the user id) in the social networks table.

2 — What do I want:

I want a logged in user to be able to go to ‘/socialnetworks’ and get a list of all the social networks that he has linked (those that are in the social network table with a token different that nil) and all those social networks that he has not linked but the app supports. For each active social network, the user will be able to unlink it if it’s linked and link it if it’s unliked.

3 — How I have thought of doing this:

I’ve been thinking on doing this in a RESTful way but I believe it confuses me the fact that I don’t want to show the same information for each social network . For example, for Facebook I might want to show the picture profile and first name, and for Twitter I might want to show the number of followers and the number of people the user is following. In any case, what I have thought on doing:

In the index action I will have callers to different builders for each social network. So, for example I could have the following:

def index
 @facebook_object = SocialNetworks.get_facebook_object
 @twitter_object = SocialNetworks.get_twitter_object
end

In the index template I have thought on doing something like:

render facebook_template
render twitter_template

Which would render the different partials for the given objects or if they don’t exist they would show the “link to the X social network” button.

So my question is: How could I improve this design to make it more RESTful and at the same time strong to future changes or addition of new social networks?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:55:26+00:00Added an answer on May 29, 2026 at 10:55 am

    You could use nested resources if you want to be RESTFul.

    You can also keep one template for rendering your social network object, and keep the logic of rendering a dedicated or a generic template in it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I basically have the classic many to many model. A user, an award, and
So to start, I have an array of XML files. These files need to
Basically, is there a way to write a.children('.outer').children('.inner') without the intermediate selector? I can't
I have set of xml elements like this: <item code=<HTML_CODE> /> For example: <items>
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
&mdash; or &#8212; Is there a difference between these? Is one better-supported than the
I'm using a DatePicker ( org.apache.wicket.extensions.yui.calendar.DatePicker — Javadoc ) in a form. The form
I have a fairly mundane piece jQuery that toggles a div's visibility when a
I can drag the event but I can't drop it. I mean I can
We have different types of hyphens/dashes (in some text) populated in db. Before comparing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.