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

Version Path
twilson63-nifty-generators-0.3.2 rails_generators/nifty_nested_scaffold/templates/actions/create.rb
twilson63-nifty-generators-0.3.3 rails_generators/nifty_nested_scaffold/templates/actions/create.rb
twilson63-nifty-generators-0.3.4 rails_generators/nifty_nested_scaffold/templates/actions/create.rb
twilson63-nifty-generators-0.3.5 rails_generators/nifty_nested_scaffold/templates/actions/create.rb
twilson63-nifty-generators-0.3.6 rails_generators/nifty_nested_scaffold/templates/actions/create.rb
twilson63-nifty-generators-0.3.7 rails_generators/nifty_nested_scaffold/templates/actions/create.rb
twilson63-nifty-generators-0.3.8 rails_generators/nifty_nested_scaffold/templates/actions/create.rb