From e466ad4113f895338a2a1a4a8e37b2ef78a96c1d Mon Sep 17 00:00:00 2001 From: Timothy Joo Date: Fri, 7 Sep 2018 15:57:26 -0500 Subject: [PATCH] Build out view with api info --- app/controllers/welcome_controller.rb | 7 +++++++ app/views/index.html.erb | 27 ++++++++++++++++++++++++++ app/views/layouts/application.html.erb | 14 +++++++++++++ config/routes.rb | 2 +- 4 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 app/controllers/welcome_controller.rb create mode 100644 app/views/index.html.erb create mode 100644 app/views/layouts/application.html.erb diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb new file mode 100644 index 0000000..e82f18e --- /dev/null +++ b/app/controllers/welcome_controller.rb @@ -0,0 +1,7 @@ +class WelcomeController < ApplicationController + + def index + + end + +end diff --git a/app/views/index.html.erb b/app/views/index.html.erb new file mode 100644 index 0000000..aefff63 --- /dev/null +++ b/app/views/index.html.erb @@ -0,0 +1,27 @@ +Welcome to Acme API. + +The URI for posting a payment is '/api/v1/subscriptions' + +We've provided a sample POST request body for an idea on how to format your JSON POST Request + + +Sample POST Request body + +{ + "customer": { + "first_name": "Jim", + "last_name": "Jones", + "address": "2120 Wimbeldon Court", + "city": "Modesto", + "state": "CA", + "zip": 95355 + }, + "amount": "4900", + "card_number": "42424242424242420", + "cvv": "123", + "expiration_month": "01", + "expiration_year": "2024", + "zip_code": "11754", + "plan_id": 2 + +} diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb new file mode 100644 index 0000000..8f46d67 --- /dev/null +++ b/app/views/layouts/application.html.erb @@ -0,0 +1,14 @@ + + + + Acme API + <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %> + <%= javascript_include_tag "application", "data-turbolinks-track" => true %> + <%= csrf_meta_tags %> + + + +<%= yield %> + + + diff --git a/config/routes.rb b/config/routes.rb index 348c0db..83f0832 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,6 @@ Rails.application.routes.draw do # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html - root :to => 'home#index' + root :to => 'welcome#index' namespace :api do namespace :v1 do resources :subscriptions, only: [:create, :show]