Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
21 lines (20 sloc) 628 Bytes
<snippet>
<content><![CDATA[def create
@${1:model} = ${2:${1/[[:alpha:]]+|(_)/(?1::\u$0)/g}}.new(params[:$1])
$0
respond_to do |format|
if @$1.save
flash[:notice] = '$2 was successfully created.'
format.html { redirect_to(@$1) }
format.xml { render xml: @$1, status: :created, location: @$1 }
else
format.html { render action: "new" }
format.xml { render xml: @$1.errors, status: :unprocessable_entity }
end
end
end
]]></content>
<tabTrigger>defcreate</tabTrigger>
<scope>meta.rails.controller</scope>
<description>def create - resource</description>
</snippet>