Class: EasyTokens::TokensController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- EasyTokens::TokensController
- Defined in:
- app/controllers/easy_tokens/tokens_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'app/controllers/easy_tokens/tokens_controller.rb', line 24 def create @token = Token.new(token_params) @token.owner_id = owner_resource.id if @token.save redirect_to @token, notice: 'Token was successfully created.' else render :new end end |
#edit ⇒ Object
21 22 |
# File 'app/controllers/easy_tokens/tokens_controller.rb', line 21 def edit end |
#index ⇒ Object
10 11 12 |
# File 'app/controllers/easy_tokens/tokens_controller.rb', line 10 def index @tokens = Token.all end |
#new ⇒ Object
17 18 19 |
# File 'app/controllers/easy_tokens/tokens_controller.rb', line 17 def new @token = Token.new end |
#show ⇒ Object
14 15 |
# File 'app/controllers/easy_tokens/tokens_controller.rb', line 14 def show end |
#update ⇒ Object
35 36 37 38 39 40 41 |
# File 'app/controllers/easy_tokens/tokens_controller.rb', line 35 def update if @token.update(token_params) redirect_to @token, notice: 'Token was successfully updated.' else render :edit end end |