A new Rails idea in views and no more controller. maybe better maybe worse, i need help if this is t

Posted by Totty on Stack Overflow See other posts from Stack Overflow or by Totty
Published on 2010-05-06T03:22:51Z Indexed on 2010/05/06 3:28 UTC
Read the original article Hit count: 168

Filed under:

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

© Stack Overflow or respective owner

Related posts about ruby-on-rails