Sha256: f76c630646a67de6e00ed44fc9494d6b147b169cdd2922ab899e76dd3e20c8d8

Contents?: true

Size: 586 Bytes

Versions: 20

Compression:

Stored size: 586 Bytes

Contents

class Admin::TaxonomiesController < Admin::BaseController
  resource_controller
  
  create.wants.html {redirect_to edit_admin_taxonomy_url(@taxonomy)}
  update.wants.html {redirect_to collection_url}
  
  create.after do
    taxon = Taxon.new(:name => @taxonomy.name, :taxonomy_id => @taxonomy.id, :position => 1 )
    taxon.save
  end
  
  update.after do
    taxon = @taxonomy.taxons.find_by_parent_id(nil)
    taxon.name = @taxonomy.name
    taxon.save
  end
  
  edit.response do |wants|
    wants.html
    wants.js do
      render :partial => 'edit.html.erb'
    end
  end

 
end

Version data entries

20 entries across 20 versions & 3 rubygems

Version Path
kdmny-spree-0.0.1 app/controllers/admin/taxonomies_controller.rb
spree-enriquez-0.9.4 app/controllers/admin/taxonomies_controller.rb
spree-0.9.4 app/controllers/admin/taxonomies_controller.rb
spree-0.9.3 app/controllers/admin/taxonomies_controller.rb
spree-0.9.2 app/controllers/admin/taxonomies_controller.rb
spree-0.9.1 app/controllers/admin/taxonomies_controller.rb
spree-0.9.0 app/controllers/admin/taxonomies_controller.rb
spree-0.8.4 app/controllers/admin/taxonomies_controller.rb
spree-0.8.5 app/controllers/admin/taxonomies_controller.rb
spree-0.4.1 app/controllers/admin/taxonomies_controller.rb
spree-0.4.0 app/controllers/admin/taxonomies_controller.rb
spree-0.5.0 app/controllers/admin/taxonomies_controller.rb
spree-0.6.0 app/controllers/admin/taxonomies_controller.rb
spree-0.5.1 app/controllers/admin/taxonomies_controller.rb
spree-0.7.1 app/controllers/admin/taxonomies_controller.rb
spree-0.7.0 app/controllers/admin/taxonomies_controller.rb
spree-0.8.0 app/controllers/admin/taxonomies_controller.rb
spree-0.8.1 app/controllers/admin/taxonomies_controller.rb
spree-0.8.2 app/controllers/admin/taxonomies_controller.rb
spree-0.8.3 app/controllers/admin/taxonomies_controller.rb