Browse Source

WIP | Louis | Adding client receipts

master
Loos 10 years ago
parent
commit
67ae0bf04b
  1. 1
      Gemfile
  2. 4
      Gemfile.lock
  3. 12
      app/controllers/clients_controller.rb
  4. 4
      app/controllers/freecyclery_controller.rb
  5. 1
      app/views/freecyclery/receipt.html.haml
  6. 4
      config/routes.rb
  7. 4
      notes.txt

1
Gemfile

@ -23,6 +23,7 @@ group :test, :development do
gem 'pry-rails'
gem 'better_errors'
gem 'assert_difference'
gem 'binding_of_caller'
# Uncomment this line on OS X.
gem 'growl', '1.0.3'

4
Gemfile.lock

@ -33,6 +33,8 @@ GEM
better_errors (1.1.0)
coderay (>= 1.0.0)
erubis (>= 2.6.6)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
bootstrap-sass (2.3.2.0)
sass (~> 3.2)
builder (3.1.4)
@ -52,6 +54,7 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.6.3)
debug_inspector (0.0.2)
devise (3.2.4)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
@ -192,6 +195,7 @@ DEPENDENCIES
assert_difference
bcrypt-ruby (= 3.1.2)
better_errors
binding_of_caller
bootstrap-sass (= 2.3.2.0)
capybara (= 2.1.0)
devise

12
app/controllers/clients_controller.rb

@ -19,22 +19,18 @@ class ClientsController < ApplicationController
def create
@client = Client.new(client_params)
respond_to do |format|
if @client.save
format.html { redirect_to @client, notice: 'Client was successfully created.' }
redirect_to @client, notice: 'Client was successfully created.'
else
format.html { render action: 'new' }
end
render action: 'new'
end
end
def update
respond_to do |format|
if @client.update(client_params)
format.html { redirect_to @client, notice: 'Client was successfully updated.' }
redirect_to @client, notice: 'Client was successfully updated.'
else
format.html { render action: 'edit' }
end
render action: 'edit'
end
end

4
app/controllers/freecyclery_controller.rb

@ -13,4 +13,8 @@ class FreecycleryController < ApplicationController
@available_bikes = Bike.available_for_freecyclery
end
def receipt
@client = Client.find(params[:client_id])
end
end

1
app/views/freecyclery/receipt.html.haml

@ -0,0 +1 @@
KITTENS

4
config/routes.rb

@ -11,7 +11,9 @@ Bikedb::Application.routes.draw do
resources :volunteers
resources :agencies
resources :clients
resources :clients do
get 'receipt' => 'freecyclery#receipt'
end
get 'closed_applications' => 'freecyclery#closed_applications'
get 'ready_for_pickup' => 'freecyclery#ready_for_pickup'

4
notes.txt

@ -9,6 +9,7 @@ Reports
Number of bikes donated according to agency. (Graph?)
Average bike price for year.
assign a bike from the available freecyclery bikes page
mark as picked up from the ready for pickup page
validations around parameters that break site if incomplete
@ -24,4 +25,7 @@ refactor index - move unsold bikes to model
make ‚recyclery‘ its own view folder, controller, etc.
add a request-a-feature feature
add pics of bikes for sale
add recyclery logos & bike memorabilia pics all over app

Loading…
Cancel
Save