Class: Auth::ClientsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Auth::ClientsController
- Defined in:
- app/controllers/auth/clients_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /clients.
-
#destroy ⇒ Object
response status of 404 or 204 is ok.
-
#edit ⇒ Object
GET /clients/1/edit.
-
#index ⇒ Object
GET /clients.
-
#new ⇒ Object
GET /clients/new.
-
#show ⇒ Object
GET /clients/1.
-
#update ⇒ Object
response code of 204 is ok.
Methods inherited from ApplicationController
#authenticate_resource!, #build_model_from_params, #check_for_create, #check_for_destroy, #check_for_update, #from_bson, #from_view, #get_model_class_name, #instantiate_classes, #not_found
Instance Method Details
#create ⇒ Object
POST /clients
42 43 44 |
# File 'app/controllers/auth/clients_controller.rb', line 42 def create render :nothing => true, :status => 200 end |
#destroy ⇒ Object
response status of 404 or 204 is ok. 404 means client doesnt exist 204 means it was destroyed. DELETE /clients/1
71 72 73 74 75 |
# File 'app/controllers/auth/clients_controller.rb', line 71 def destroy @client.destroy #redirect_to clients_url, notice: 'Client was successfully destroyed.' respond_with(status: 200) end |
#edit ⇒ Object
GET /clients/1/edit
36 37 38 39 |
# File 'app/controllers/auth/clients_controller.rb', line 36 def edit ## edit should show forms for adding an app id. ## design the form. end |
#index ⇒ Object
GET /clients
18 19 20 |
# File 'app/controllers/auth/clients_controller.rb', line 18 def index render :nothing => true, :status => 200 end |
#new ⇒ Object
GET /clients/new
30 31 32 33 |
# File 'app/controllers/auth/clients_controller.rb', line 30 def new #@client = Client.new render :nothing => true, :status => 200 end |
#show ⇒ Object
GET /clients/1
23 24 25 |
# File 'app/controllers/auth/clients_controller.rb', line 23 def show respond_with @client end |
#update ⇒ Object
response code of 204 is ok. anything else means fail. PATCH/PUT /clients/1
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'app/controllers/auth/clients_controller.rb', line 49 def update @client.redirect_urls << client_params[:add_redirect_url] if client_params[:add_redirect_url] @client.app_ids << BSON::ObjectId.new.to_s if client_params[:add_app_id] @client.versioned_update({"redirect_urls" => 1, "app_ids" => 1}) if @client.op_success? render "show" else render "edit" end end |