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 7565879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:16:14+00:00 2026-05-30T14:16:14+00:00

I currently have a rails app and each user has a profile that has

  • 0

I currently have a rails app and each user has a profile that has videos, photos, etc. Everything works fine but I am unable to separate a profile from another user profile.

Example:
I have two users Jack and bob. Jack profile url is jack.mysite.com and bob profile url is bob.mysite.com. When jack uploads a video and I visit the url jack.mysite.com/videos I would only like to see jack videos and not bob videos and vice versa.

How can I tell rails to only show me a users uploads(videos,photos etc) when visiting their profile url?

  • 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-30T14:16:15+00:00Added an answer on May 30, 2026 at 2:16 pm

    Make sure your videos and other profile related stuff has a belongs_to relation with the user model.

    When you visit a url like jack.site.nl and you want to only show jacks stuff, you need to pass the sub domain as a constraint in your routes and pick up the param in the receiving controller. You should be able to do something like this in your controller:

    user = User.find_by_username(params[:subdomain])
    @videos = Video.where(user_id: user.id)
    

    Checkout one of the subdomain Railscasts for more details
    http://railscasts.com/episodes?utf8=%E2%9C%93&search=subdomain

    When you need to restrict each users data you should checkout http://railscasts.com/episodes/192-authorization-with-cancan

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

Sidebar

Related Questions

I have a Rails 2.3.x app that implements the act_as_authentic in User model and
Currently I have a Rails 2.3 app that is a CMS serving over 100
I have a rails 3 app that displays user submissions in order of how
Currently I have a Rails 3 app that subscribes new users up to MailChimp.
I have a rails app where users share specific kinds of photos. Currently the
I have a rails application where each user has a separate database. (taking Joel
I'm creating a Ruby on Rails app that consists of stories. Each story has
I'm currently writing a Rails app, and hit a somewhat strange quirk. I have
Hello Ruby/Rails/Merb developers! Im currently working on a web project that will have a
Background Currently, I am working on a Rails application. I have different products that

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.