Class: NewsmastMastodon::Api::V1::RelaysController
- Inherits:
-
Api::BaseController
- Object
- Api::BaseController
- NewsmastMastodon::Api::V1::RelaysController
- Defined in:
- app/controllers/newsmast_mastodon/api/v1/relays_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'app/controllers/newsmast_mastodon/api/v1/relays_controller.rb', line 8 def create @relay = Relay.find_or_initialize_by(relay_params) unless @relay.persisted? @relay.save @relay.enable! end head 200 end |
#destroy ⇒ Object
18 19 20 21 |
# File 'app/controllers/newsmast_mastodon/api/v1/relays_controller.rb', line 18 def destroy @relay.destroy render_empty end |