Class: RedisWebManager::KeysController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- RedisWebManager::KeysController
- Includes:
- Pagy::Backend
- Defined in:
- app/controllers/redis_web_manager/keys_controller.rb
Instance Method Summary collapse
-
#destroy ⇒ Object
DELETE /key/:key.
-
#edit ⇒ Object
GET /key/:key.
-
#index ⇒ Object
GET /keys.
-
#show ⇒ Object
GET /key/:key.
-
#update ⇒ Object
PUT /key/:key.
Instance Method Details
#destroy ⇒ Object
DELETE /key/:key
42 43 44 45 46 47 |
# File 'app/controllers/redis_web_manager/keys_controller.rb', line 42 def destroy key = params[:key].presence redirect_to keys_url if key.nil? action.del(key) redirect_to keys_url end |
#edit ⇒ Object
GET /key/:key
26 27 28 29 30 |
# File 'app/controllers/redis_web_manager/keys_controller.rb', line 26 def edit key = params[:key].presence redirect_to keys_url if key.nil? @key = format_key(key) end |
#index ⇒ Object
GET /keys
12 13 14 15 16 |
# File 'app/controllers/redis_web_manager/keys_controller.rb', line 12 def index @status = info.status @url = connection.id @pagy, @keys = pagy_array(keys) end |
#show ⇒ Object
GET /key/:key
19 20 21 22 23 |
# File 'app/controllers/redis_web_manager/keys_controller.rb', line 19 def show key = params[:key].presence redirect_to keys_url if key.nil? @key = format_key(key) end |
#update ⇒ Object
PUT /key/:key
33 34 35 36 37 38 39 |
# File 'app/controllers/redis_web_manager/keys_controller.rb', line 33 def update old_key = params[:old_name].presence new_name = params[:new_name].presence redirect_to keys_url if old_key.nil? || new_name.nil? action.rename(old_key, new_name) redirect_to keys_url end |