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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:21:11+00:00 2026-06-01T03:21:11+00:00

I have a site nearing structural completion. Essentially, it’s made up of Users and

  • 0

I have a site nearing structural completion. Essentially, it’s made up of Users and Photos. However, Photos have a LOT of HABTM relationships, most of which are different kinds of tags, and others being categories, collections, etc…

My client would like to be able to have a conditional CMS based off the content being viewed for different promotional purposes or whatnot. For example, if a user is browsing the Category “Leprechauns”, he may want to show html content about St. Patrick’s Day or something. He may even want to easily include the browing user’s name, if available. In which case, it’d be nice to have some sort of templating system. The part that makes this tricky is that these are small blocks of HTML for something like a 300×300 space in the sidebar and is NOT the primary content.

I’ve looked into refinery, but it seems to be too much of a complete solution. I’ve also thought about building in from scratch, but I don’t know where to begin with treating dynamically generated pages (such as a new Category) as a recognizable object in Rails. I’d like to keep it more global than a slew of HABTM relationships, but it’s looking like that might be where I’m heading. Ideally, he’d be able to make some HTML and check off “I’d like this to show on x and y Category page and b and z Collection page and for the tag Foo and for the tag bar as well as on my homepage”

Any suggestions? I’m open to finding a gem or getting a solid start on a homebrew.

UPDATE

I’m thinking of setting up some models Like the following:

cms_contents
============
id:integer
contents:text
timestamps

cms_associations
================
id:integer
cms_content_id:integer
model_id:integer
record_id:integer #optional
secondary_model_id:integer #optional
secondary_record_id:integer #optional

models
======
id:integer
name:string

Where:

  • cms_content would contain the HTML.
  • cms_associations would be an ActiveRecord model using has_many, :through
  • models would contain a the models the CMS content could be associated with
  • if record_id is not given, it associates with the model index
  • if record_id is given, it associated with the record of the provided model with that
    id
  • if secondary information is given, a combination is created for other many to many
    relationships

eg:

User has_many :photos
Browsing Photos for User(10)
model_id => #User model Id
record_id => 10
secondary_model_id => #Photo model id

So you could customize the content for browsing photos for specific users such as featured users or companies that may pay for advertising.

Any thoughts on this structure?

  • 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-06-01T03:21:12+00:00Added an answer on June 1, 2026 at 3:21 am

    It’s almost as if the almighty Ryan Bates is looking out for me, but the latest Railscast is on CopyCopter, which does exactly what I’m looking for, and runs as a separate app, so I don’t have to worry about bogging down my main app. I suggest anyone who finds this to watch the screencast, as it seems pretty impressive.

    http://railscasts.com/episodes/336-copycopter?autoplay=true

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

Sidebar

Related Questions

My site have a number of different persons each representing different diseases. I made
I have a site , and I want to prevent my users to log
I have the site and it renders ok, even in IE. However in Opera
I have a site where users upload movies (MP4, FLV, OGV). I need a
I have a site I made really fast that uses floats to display different
I have an asp.net website that is nearing release. The site deals with business
I have site which uses $(selector).load(path) function in more than 300 pages. Now my
I Have site change.is, where right side menu & search bar in header is
I have site I am working on and the images take forever to load,
For example I have site http://localhost/site In IIS I set that 404 error causes

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.