Class: Workarea::Api::Admin::NavigationTaxonsController
Instance Method Summary
collapse
#current_user, #sort_direction, #sort_field
Instance Method Details
#bulk ⇒ Object
290
291
292
293
294
295
296
297
|
# File 'app/controllers/workarea/api/admin/navigation_taxons_controller.rb', line 290
def bulk
@bulk = Api::Admin::BulkUpsert.create!(
klass: Navigation::Taxon,
data: params[:navigation_taxons].map(&:to_h)
)
head :no_content
end
|
#create ⇒ Object
113
114
115
116
117
118
119
120
|
# File 'app/controllers/workarea/api/admin/navigation_taxons_controller.rb', line 113
def create
@navigation_taxon = Navigation::Taxon.create!(params[:navigation_taxon])
respond_with(
{ navigation_taxon: @navigation_taxon },
{ status: :created,
location: navigation_taxon_path(@navigation_taxon) }
)
end
|
#destroy ⇒ Object
299
300
301
302
|
# File 'app/controllers/workarea/api/admin/navigation_taxons_controller.rb', line 299
def destroy
@navigation_taxon.destroy
head :no_content
end
|
#index ⇒ Object
102
103
104
105
106
107
108
109
110
111
|
# File 'app/controllers/workarea/api/admin/navigation_taxons_controller.rb', line 102
def index
@navigation_taxons = Navigation::Taxon
.all
.by_updated_at(starts_at: params[:updated_at_starts_at], ends_at: params[:updated_at_ends_at])
.by_created_at(starts_at: params[:created_at_starts_at], ends_at: params[:created_at_ends_at])
.order_by(sort_field => sort_direction)
.page(params[:page])
respond_with navigation_taxons: @navigation_taxons
end
|
#show ⇒ Object
252
253
254
|
# File 'app/controllers/workarea/api/admin/navigation_taxons_controller.rb', line 252
def show
respond_with navigation_taxon: @navigation_taxon
end
|
#update ⇒ Object
256
257
258
259
|
# File 'app/controllers/workarea/api/admin/navigation_taxons_controller.rb', line 256
def update
@navigation_taxon.update_attributes!(params[:navigation_taxon])
respond_with navigation_taxon: @navigation_taxon
end
|