Class: CpOraclecloud::SshKeysController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- CpOraclecloud::SshKeysController
- Defined in:
- app/controllers/cp_oraclecloud/ssh_keys_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
def show authorize @ssh_key end.
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
def show authorize @ssh_key end
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/controllers/cp_oraclecloud/ssh_keys_controller.rb', line 19 def create SshKey @ssh_key = SshKey.new(ssh_key_params) if @ssh_key.valid? ssh_key = SshKey.create(ssh_key_params) flash[:notice] = "SSH Key has been created." redirect_to cp_oraclecloud_admin_path else flash.now[:alert] = "SSH Key has not been created." render "new" end end |
#destroy ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'app/controllers/cp_oraclecloud/ssh_keys_controller.rb', line 37 def destroy @ssh_key #@ssh_key.destroy SshKey.delete(@ssh_key.id) flash[:notice] = "SSH Key has been deleted." redirect_to cp_oraclecloud_admin_path end |
#edit ⇒ Object
33 34 35 |
# File 'app/controllers/cp_oraclecloud/ssh_keys_controller.rb', line 33 def edit #authorize @ssh_key end |
#index ⇒ Object
5 6 7 8 |
# File 'app/controllers/cp_oraclecloud/ssh_keys_controller.rb', line 5 def index SshKey @ssh_keys = SshKey.all end |
#new ⇒ Object
10 11 12 13 |
# File 'app/controllers/cp_oraclecloud/ssh_keys_controller.rb', line 10 def new SshKey @ssh_key = CpOraclecloud::SshKey.new end |
#update ⇒ Object
46 47 48 49 50 51 52 53 54 55 |
# File 'app/controllers/cp_oraclecloud/ssh_keys_controller.rb', line 46 def update @ssh_key if @ssh_key.update(ssh_key_params) flash[:notice] = "SSH Key has been updated." redirect_to cp_oraclecloud_admin_path else flash.now[:alert] = "SSH Key has not been updated." render "edit" end end |