Ordering refactored: Made everything RESTful.

This commit is contained in:
benni 2011-06-19 15:30:33 +02:00
parent 45e0048490
commit eb4705857b
19 changed files with 340 additions and 222 deletions

View file

@ -2,8 +2,8 @@
# TODO: When to use class or module. It seems this could also be a Foodsoft-class?
module Foodsoft
mattr_accessor :env, :config, :database
CONFIGS = YAML.load(File.read(RAILS_ROOT + "/config/app_config.yml"))
DATABASES = YAML.load(File.read(RAILS_ROOT + "/config/database.yml"))
CONFIGS = YAML.load(File.read(File.join(Rails.root, "/config/app_config.yml")))
DATABASES = YAML.load(File.read(File.join(Rails.root, "/config/database.yml")))
class << self
def env=(env)
@ -15,7 +15,7 @@ module Foodsoft
end
end
# Initial load the default config and database from rails environment
Foodsoft.env = RAILS_ENV
Foodsoft.env = Rails.env
# Set action mailer default host for url generating
url_options = {

View file

@ -39,7 +39,9 @@ Foodsoft::Application.routes.draw do
end
end
match '/ordering/myOrders' => 'ordering#myOrders', :as => 'my_orders'
resources :group_orders, :controller => 'ordering', :path => 'ordering' do
get :archive, :on => :collection
end
match '/ordering' => 'ordering#index', :as => 'ordering'
############ Foodcoop orga