Sha256: e5c5105cd69799b0beabf4fa6766bcb89c759bd406a7b5be5c5e3d6c215193e2

Contents?: true

Size: 323 Bytes

Versions: 2

Compression:

Stored size: 323 Bytes

Contents

  def create
    @<%= singular_name %> = <%= class_name %>.new(params[:<%= singular_name %>])
    if @<%= singular_name %>.save
      flash[:notice] = t('flash_notice_successfully_created', :model => <%=class_name%>.human_name)
      redirect_to <%= item_path('url') %>
    else
      render :action => 'new'
    end
  end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
splendeo-generators-0.2.1 rails_generators/splendeo_scaffold/templates/actions/create.rb
splendeo-generators-0.2.0 rails_generators/splendeo_scaffold/templates/actions/create.rb