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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:26:21+00:00 2026-05-14T22:26:21+00:00

Hy, I was thinking that all my website will have use of cells, using

  • 0

Hy,

I was thinking that all my website will have use of cells, using the known plugin cell for rails, so this is my idea:

A table that contains 3 fields: id, view_name and layout. the layout will be a serialized hash.
When a request is made, the layout field is requested and then in the view, default layout, will be unserialized the layout var, that looks like this:
@layout[:sidecol][:gallery] = {… some params for it…};
@layout[:maincol][:comments] = {..params…};

In the <% #ruby code to render the cells in the @layout[:sidecol] %> will be some ruby code that will loop over the @layout[:sidecol] and render all cells in it. the same occurs in the maincol div.

What do you think?

Positive in my opinion:
More modular
controller is used only for post
easy change of structure
easier to implement some kind of traking to see diferences on what layout is better or not.

Negative:
not found yet

EDIT:

1) The request comes, is calculated the view name.

2) Load from the database the layout field that corresponds to the view name. (this will be cached, and will be updated only when changes are made. I intend to use this way, because I will need to test the layout. 33% layout1, 33% layout2 and 33% other layout. So will be used a random number to choose the view layout.)

3) The layout field contains: first subdivision is the name of the div to be created, then in each one will be more components, named cells in this case, that will be instanced in the application controller, because will be repeated for all get requests.

4) In the view will be created the divs and will be rendered in each one the cells defined.

5) The cell will make the request to the db and load the data.

6) The cell will then render the HTML and is ready to go!

  • 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-14T22:26:21+00:00Added an answer on May 14, 2026 at 10:26 pm

    So… in discussing MVC, you should understand that the controller layer is probably the most critical of any of the layers for actually accomplishing tasks. The controller layer is intended for actually getting any work done within your framework.

    There are ways to abandon monolithic MVC as your primary pattern, for example, building a set of services which communicate with each other, but even there, that’s mainly abandoning monoliths, since you can push the MVC pattern down into each component.

    With regard to your specific proposal, storing layout data, which seldom changes between requests, in your DB is an unnecessary performance hit. Having to drag the layout from your DB out, unserialize it and run it will require you either to set up a caching framework, or to do crazy DB scaling.

    Incidentally Rails3 and Merb (and i think even Rails2) are sufficiently modular in the controller layer, that they don’t really care where your layout/templating/view stuff comes from. If you really want, you can just tell them to render a string.

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

Sidebar

Related Questions

I am thinking of writing a PHP extension library that will use the memcached
I'm planning a website which will use huge schematics, that is, raster images that
First of all; I'm aware that this question is strange and I will probably
Possible Duplicate: PHP take all combinations I'm thinking of making something in PHP that
Thinking that the answer to this is pretty obvious but here it goes: When
I was thinking that I would have two tables for mysql. One for storing
I was thinking that at the top of my partial I would have something
Am I correct in thinking that that Python doesn't have a direct equivalent for
Am I correct in thinking that if I have a WCF OperationContract takes in
Background: I have a website that has been built with ASP.NET 2.0 and is

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.