• 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

The main reason of which I was felt in love with Merb is it uses same context for controller and view. By sharing same context, view_helpers and instance variables become simple. You just use them in controller then you can use them in view by same manner. But as you know, Rails3 doesn't.

The reason Rails3 doesn't is probably for caching. If the view has many outer variables that affects its result, the cache key tends to be very complicated. In the manner of Rails3, we can use both action caching and partial caching easily. Because the all variables used in view are clear and small.

But in these days, I am doubting the use of those caching. Now we don't use browsers that has no capability of JavaScript. In addition, Google treats Ajax pages for indexing well. Haven't you ever seen the URI that has '#!'? That's for it. So now, the most of pages can be provided as static html with dynamic JSON. They are combined by JavaScript. There's few situations that the action caching and the partial caching go well.

In conclusion, I think the context should be shared between view and controller so that we can use view helpers simply.

posted by Png genki on Wed 12 Jan 2011 at 09:07

Comments:

or Preview
Social Bookmarks
  • Delicious
  • B_entry1878
  • Clip_16_12_w
Services from s21g
twpro(ツイプロ)
Twitterプロフィールを快適検索
地価2009
土地の値段を調べてみよう
MyRestaurant
自分だけのレストラン手帳
Formula
ブログに数式を埋め込める数式コミュニティ