Class: Admin::TaxonomiesController
- Inherits:
-
BaseController
- Object
- BaseController
- Admin::TaxonomiesController
- Defined in:
- app/controllers/admin/taxonomies_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'app/controllers/admin/taxonomies_controller.rb', line 16 def create @taxonomy = Taxonomy.new(params[:taxonomy]) if @taxonomy.save redirect_to edit_admin_taxonomy_url(@taxonomy), :notice => "Successfully created taxonomy." else render :action => 'new' end end |
#destroy ⇒ Object
39 40 41 42 43 |
# File 'app/controllers/admin/taxonomies_controller.rb', line 39 def destroy @taxonomy = Taxonomy.find(params[:id]) @taxonomy.destroy redirect_to admin_taxonomies_url, :notice => "Successfully destroyed taxonomy." end |
#edit ⇒ Object
25 26 27 28 |
# File 'app/controllers/admin/taxonomies_controller.rb', line 25 def edit @taxonomy = Taxonomy.find(params[:id]) @tree = root_tree(@taxonomy) end |
#index ⇒ Object
4 5 6 |
# File 'app/controllers/admin/taxonomies_controller.rb', line 4 def index @taxonomies = Taxonomy.all end |
#new ⇒ Object
12 13 14 |
# File 'app/controllers/admin/taxonomies_controller.rb', line 12 def new @taxonomy = Taxonomy.new end |
#show ⇒ Object
8 9 10 |
# File 'app/controllers/admin/taxonomies_controller.rb', line 8 def show @taxonomy = Taxonomy.find(params[:id]) end |
#update ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'app/controllers/admin/taxonomies_controller.rb', line 30 def update @taxonomy = Taxonomy.find(params[:id]) if @taxonomy.update_attributes(params[:taxonomy]) redirect_to admin_taxonomies_url, :notice => "Successfully updated taxonomy." else render :action => 'edit' end end |