Sha256: 02cb4c8cd73ebcddc432d6c2dc8b1240e862628315805de11b67920861929a3a
Contents?: true
Size: 618 Bytes
Versions: 7
Compression:
Stored size: 618 Bytes
Contents
def create @<%= singular_name %> = @<%= parent_singular_name %>.<%= plural_name %>.build(params[:<%= singular_name %>]) respond_to do |wants| if @<%= singular_name %>.save wants.html do flash[:notice] = "Successfully created <%= name.humanize.downcase %>." redirect_to <%= item_path('url') %> end <%- if options[:ajaxify] %> wants.js <%- end %> else wants.html { render :action => 'new' } <%- if options[:ajaxify] %> wants.js { render :action => 'error' } <%- end %> end end end
Version data entries
7 entries across 7 versions & 1 rubygems