yasnippet/extras/imported/rails-mode/Controllers/Create controller class.yasnippet

16 lines
318 B
Plaintext

# -*- mode: snippet -*-
# key: cla
# contributor: Translated from TextMate Snippet
# name: Create controller class
## condition: "source.ruby"
# --
class ${1:Model}Controller < ApplicationController
before_filter :find_${2:model}
$0
private
def find_${2}
@$2 = ${3:$1}.find(params[:id]) if params[:id]
end
end