summaryrefslogtreecommitdiff
path: root/lib/generators/nifty/scaffold/templates/actions/create.rb
blob: 8365f0b76e58d31cba82c0bbfae597d3f8ed9bf5 (plain)
1
2
3
4
5
6
7
8
  def create
    @<%= instance_name %> = <%= class_name %>.new(params[:<%= instance_name %>])
    if @<%= instance_name %>.save
      redirect_to <%= item_url %>, :notice => t('<%= plural_name %>.controller.successfuly_created')
    else
      render :new
    end
  end