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!