じぶんメモ

プログラミングのメモ、日常のメモとか。

2016-02-05から1日間の記事一覧

Railsで独自のアクションをルーティングに加える

railsにはリソースベースのルーティングで、 index, new, create, show, edit, update, destroyが用意されている。 resources :posts 独自のアクションをルーティングに追加する方法 # これだとposts/:id(hogehoge)とみなされる get 'posts/hogehoge' => 'po…