Merbでconfig/router.rbの中で、リソースのカスタムアクションを追加する方法のメモ。

   1  resource :users,
   2    :collection => {:active => :get},
   3    :member => {:password => :get}

:collectionで指定したアクションは、resource(:users, :active) などのように参照できて、"/users/active" のような感じになります。

:memberで指定したアクションは、resource(@user, :password) などのように参照できて、"/users/1/password" のようなスタイルになります。

posted by Png genki on Mon 20 Apr 2009 at 14:57
Contents
リソースにカスタムアクションを追加する方法のメモ
Comments
瀧内元気: MacOS版は以下にあります * [genki/ViMouse](https://githu... '23-1
dsjf: https://gist.github.com/6bf1bf2c3cbb5eb6e7a7 これ... '13-1
瀧内元気: おお、チェックしてみます。thx! '11-12
overisland: Reeder for iPhone もこの UI を実装していますね。 '11-12
瀧内元気: その情報は見たのですが、以下のサイトによると、現在はまた必要になってるっぽいんですよね。 ... '11-12
Services from s21g
twpro(ツイプロ)
Twitterプロフィールを快適検索
地価2009
土地の値段を調べてみよう
MyRestaurant
自分だけのレストラン手帳
Formula
ブログに数式を埋め込める数式コミュニティ