Sha256: f4b086a8a64624eb50f2e955f08c5efd485fd5302dbc1035587d8c4389c8151c

Contents?: true

Size: 636 Bytes

Versions: 4

Compression:

Stored size: 636 Bytes

Contents

  def update
    
    @<%= singular_name %> = @<%= parent_singular_name %>.<%= plural_name %>.find(params[:id])
    respond_to do |wants|
      if @<%= singular_name %>.update_attributes(params[:<%= singular_name %>])
        wants.html do
          flash[:notice] = "Successfully updated <%= name.humanize.downcase %>."
          redirect_to <%= item_path('url') %>
        end
        <%- if options[:ajaxify] %>
        wants.js
        <%- end %>
      else
        wants.html { render :action => 'edit' }
        <%- if options[:ajaxify] %>
        wants.js { render :action => 'error' }
        <%- end %>
      end
    end
  end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
twilson63-nifty-generators-0.3.2 rails_generators/nifty_nested_scaffold/templates/actions/update.rb
twilson63-nifty-generators-0.3.3 rails_generators/nifty_nested_scaffold/templates/actions/update.rb
twilson63-nifty-generators-0.3.4 rails_generators/nifty_nested_scaffold/templates/actions/update.rb
twilson63-nifty-generators-0.3.5 rails_generators/nifty_nested_scaffold/templates/actions/update.rb