diff --git a/app/assets/javascripts/transactions.coffee b/app/assets/javascripts/transactions.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/transactions.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/transactions.scss b/app/assets/stylesheets/transactions.scss new file mode 100644 index 0000000..c402390 --- /dev/null +++ b/app/assets/stylesheets/transactions.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the transactions controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/transactions_controller.rb b/app/controllers/transactions_controller.rb new file mode 100644 index 0000000..afbe1fa --- /dev/null +++ b/app/controllers/transactions_controller.rb @@ -0,0 +1,14 @@ +class TransactionsController < ApplicationController + + def index + @transactions = Transaction.all + end + + def new + @transaction = Transaction.new + end + + def create + end + +end diff --git a/app/helpers/transactions_helper.rb b/app/helpers/transactions_helper.rb new file mode 100644 index 0000000..36098d1 --- /dev/null +++ b/app/helpers/transactions_helper.rb @@ -0,0 +1,2 @@ +module TransactionsHelper +end diff --git a/app/views/transactions/index.html.erb b/app/views/transactions/index.html.erb new file mode 100644 index 0000000..5deca3c --- /dev/null +++ b/app/views/transactions/index.html.erb @@ -0,0 +1,3 @@ + +Oh cool a list of transactions + diff --git a/app/views/transactions/new.html.erb b/app/views/transactions/new.html.erb new file mode 100644 index 0000000..2621d4c --- /dev/null +++ b/app/views/transactions/new.html.erb @@ -0,0 +1,3 @@ + +Hello, new transaction + diff --git a/config/routes.rb b/config/routes.rb index c800bae..2c34218 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -5,6 +5,8 @@ Rails.application.routes.draw do root to: 'high_voltage/pages#show', id: "landing" + resources :transactions, only: [:new, :index, :create] + # The priority is based upon order of creation: first created -> highest priority. # See how all your routes lay out with "rake routes". diff --git a/spec/controllers/transactions_controller_spec.rb b/spec/controllers/transactions_controller_spec.rb new file mode 100644 index 0000000..c95f401 --- /dev/null +++ b/spec/controllers/transactions_controller_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe TransactionsController, type: :controller do + +end diff --git a/spec/helpers/transactions_helper_spec.rb b/spec/helpers/transactions_helper_spec.rb new file mode 100644 index 0000000..f29b78f --- /dev/null +++ b/spec/helpers/transactions_helper_spec.rb @@ -0,0 +1,15 @@ +require 'rails_helper' + +# Specs in this file have access to a helper object that includes +# the TransactionsHelper. For example: +# +# describe TransactionsHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# expect(helper.concat_strings("this","that")).to eq("this that") +# end +# end +# end +RSpec.describe TransactionsHelper, type: :helper do + pending "add some examples to (or delete) #{__FILE__}" +end