Sha256: 734287c74fb1a5697030e7e9847380a05d8c5937240140358d767ef764f331e3
Contents?: true
Size: 652 Bytes
Versions: 1
Compression:
Stored size: 652 Bytes
Contents
# POST /<%= plural_name %> # POST /<%= plural_name %>.xml def create @<%= singular_name %> = <%= class_name %>.new(params[:<%= singular_name %>]) respond_to do |format| if @<%= singular_name %>.save flash[:notice] = '<%= class_name.titleize %> was successfully created.' format.html { redirect_to(<%= item_path('url') %>) } format.xml { render :xml => @<%= singular_name %>, :status => :created, :location => @<%= singular_name %> } else format.html { render :new } format.xml { render :xml => @<%= singular_name %>.errors, :status => :unprocessable_entity } end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
iain-pizza-generators-0.1.3 | rails_generators/pizza_scaffold/templates/actions/create.rb |