Class: Plum::Cp::TaxonomiesController
- Inherits:
-
BaseController
- Object
- ApplicationController
- ApplicationController
- BaseController
- Plum::Cp::TaxonomiesController
- Defined in:
- app/controllers/plum/cp/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
19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/plum/cp/taxonomies_controller.rb', line 19 def create @taxonomy = current_site.taxonomies.build(taxonomy_params) if @taxonomy.save redirect_to "#{cp_prefix}/taxonomies/#{@taxonomy.id}", notice: "Taxonomy created" else render :new, status: :unprocessable_entity end end |
#destroy ⇒ Object
40 41 42 43 |
# File 'app/controllers/plum/cp/taxonomies_controller.rb', line 40 def destroy @taxonomy.destroy redirect_to "#{cp_prefix}/taxonomies", notice: "Taxonomy deleted" end |
#edit ⇒ Object
29 30 |
# File 'app/controllers/plum/cp/taxonomies_controller.rb', line 29 def edit end |
#index ⇒ Object
7 8 9 |
# File 'app/controllers/plum/cp/taxonomies_controller.rb', line 7 def index @taxonomies = current_site.taxonomies.order(:name) end |
#new ⇒ Object
15 16 17 |
# File 'app/controllers/plum/cp/taxonomies_controller.rb', line 15 def new @taxonomy = current_site.taxonomies.build end |
#show ⇒ Object
11 12 13 |
# File 'app/controllers/plum/cp/taxonomies_controller.rb', line 11 def show @terms = @taxonomy.terms.ordered end |
#update ⇒ Object
32 33 34 35 36 37 38 |
# File 'app/controllers/plum/cp/taxonomies_controller.rb', line 32 def update if @taxonomy.update(taxonomy_params) redirect_to "#{cp_prefix}/taxonomies/#{@taxonomy.id}", notice: "Taxonomy updated" else render :edit, status: :unprocessable_entity end end |