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
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'app/controllers/cp_oraclecloud/ssh_keys_controller.rb', line 19 def create SshKey @ssh_key = SshKey.new(ssh_key_params) if @ssh_key.save flash[:notice] = "SSH Key has been created." redirect_to cp_oraclecloud_ssh_keys_path else flash.now[:alert] = "SSH Key has not been created." render "new" end end |
#destroy ⇒ Object
36 37 38 39 40 41 42 |
# File 'app/controllers/cp_oraclecloud/ssh_keys_controller.rb', line 36 def destroy @ssh_key @ssh_key.destroy flash[:notice] = "SSH Key has been deleted." redirect_to cp_oraclecloud_ssh_keys_path end |
#edit ⇒ Object
32 33 34 |
# File 'app/controllers/cp_oraclecloud/ssh_keys_controller.rb', line 32 def edit @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 = policy_scope(SshKey) 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 |
#show ⇒ Object
15 16 17 |
# File 'app/controllers/cp_oraclecloud/ssh_keys_controller.rb', line 15 def show @ssh_key end |
#update ⇒ Object
44 45 46 47 48 49 50 51 52 53 |
# File 'app/controllers/cp_oraclecloud/ssh_keys_controller.rb', line 44 def update @ssh_key if @ssh_key.update_attributes(ssh_key_params) flash[:notice] = "SSH Key has been updated." redirect_to cp_oraclecloud_ssh_keys_path else flash.now[:alert] = "SSH Key has not been updated." render "edit" end end |