Class: Adeia::TokensController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Adeia::TokensController
- Defined in:
- app/controllers/adeia/tokens_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'app/controllers/adeia/tokens_controller.rb', line 16 def create @token = Token.new(token_params) if @token.save redirect_to tokens_path, success: t('adeia.tokens.create.success') else render 'new' end end |
#destroy ⇒ Object
36 37 38 39 |
# File 'app/controllers/adeia/tokens_controller.rb', line 36 def destroy @token.destroy redirect_to tokens_path, success: t('adeia.tokens.destroy.success') end |
#edit ⇒ Object
25 26 |
# File 'app/controllers/adeia/tokens_controller.rb', line 25 def edit end |
#index ⇒ Object
7 8 9 10 |
# File 'app/controllers/adeia/tokens_controller.rb', line 7 def index @table = TokenTable.new(self, @tokens) @table.respond end |
#new ⇒ Object
12 13 14 |
# File 'app/controllers/adeia/tokens_controller.rb', line 12 def new @token = Token.new(is_valid: true) end |
#update ⇒ Object
28 29 30 31 32 33 34 |
# File 'app/controllers/adeia/tokens_controller.rb', line 28 def update if @token.update_attributes(token_params) redirect_to tokens_path, success: t("adeia.tokens.update.success") else render 'edit' end end |