add transactions controller

This commit is contained in:
Felix Van der Jeugt 2015-09-08 15:25:54 +02:00
parent f2bc39b2b6
commit 993a54bd46
9 changed files with 50 additions and 0 deletions

View file

@ -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/

View file

@ -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/

View file

@ -0,0 +1,14 @@
class TransactionsController < ApplicationController
def index
@transactions = Transaction.all
end
def new
@transaction = Transaction.new
end
def create
end
end

View file

@ -0,0 +1,2 @@
module TransactionsHelper
end

View file

@ -0,0 +1,3 @@
Oh cool a list of transactions

View file

@ -0,0 +1,3 @@
Hello, new transaction

View file

@ -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".

View file

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe TransactionsController, type: :controller do
end

View file

@ -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