Class: NetworkController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- NetworkController
- Defined in:
- app/controllers/network_controller.rb
Overview
Common parts for working with Comunit network
Direct Known Subclasses
Network::CampaignsController, Network::CandidatesController, Network::PoliticalForcesController, Network::PostsController, Network::RegionsController, Network::SitesController, Network::UsersController
Instance Method Summary collapse
-
#amend ⇒ Object
put /comunit/:table_name/:id/amend.
-
#create ⇒ Object
post /network/.
-
#pull ⇒ Object
put /comunit/:table_name/:uuid.
-
#update ⇒ Object
patch /network//:id.
Instance Method Details
#amend ⇒ Object
put /comunit/:table_name/:id/amend
40 41 42 43 44 45 46 |
# File 'app/controllers/network_controller.rb', line 40 def amend if @handler.amend(params[:id]) head :no_content else head :unprocessable_entity end end |
#create ⇒ Object
post /network/
10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/network_controller.rb', line 10 def create @handler.data = params.require(:data).permit! @entity = @handler.create_local if @entity.persisted? render :show, status: :created else render 'shared/forms/check', status: :bad_request end end |
#pull ⇒ Object
put /comunit/:table_name/:uuid
31 32 33 34 35 36 37 |
# File 'app/controllers/network_controller.rb', line 31 def pull if @handler.pull(params[:uuid]) head :no_content else head :unprocessable_entity end end |
#update ⇒ Object
patch /network//:id
21 22 23 24 25 26 27 28 |
# File 'app/controllers/network_controller.rb', line 21 def update @handler.data = params.require(:data).permit! if @handler.update_local head :no_content else head :bad_request end end |