Browse Source

WIP | Louis | Adding client receipts

master
Loos 10 years ago
parent
commit
67ae0bf04b
  1. 1
      Gemfile
  2. 4
      Gemfile.lock
  3. 20
      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 'pry-rails'
gem 'better_errors' gem 'better_errors'
gem 'assert_difference' gem 'assert_difference'
gem 'binding_of_caller'
# Uncomment this line on OS X. # Uncomment this line on OS X.
gem 'growl', '1.0.3' gem 'growl', '1.0.3'

4
Gemfile.lock

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

20
app/controllers/clients_controller.rb

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

4
app/controllers/freecyclery_controller.rb

@ -13,4 +13,8 @@ class FreecycleryController < ApplicationController
@available_bikes = Bike.available_for_freecyclery @available_bikes = Bike.available_for_freecyclery
end end
def receipt
@client = Client.find(params[:client_id])
end
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 :volunteers
resources :agencies resources :agencies
resources :clients resources :clients do
get 'receipt' => 'freecyclery#receipt'
end
get 'closed_applications' => 'freecyclery#closed_applications' get 'closed_applications' => 'freecyclery#closed_applications'
get 'ready_for_pickup' => 'freecyclery#ready_for_pickup' get 'ready_for_pickup' => 'freecyclery#ready_for_pickup'

4
notes.txt

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

Loading…
Cancel
Save