- development.rb
- Demo::Application.configure do
- config.cache_classes = false
- config.whiny_nils = true
- config.consider_all_requests_local = true
- config.action_view.debug_rjs = true
- config.action_controller.perform_caching = true
- config.action_mailer.raise_delivery_errors = true
- config.action_mailer.delivery_method = :smtp
- config.action_mailer.smtp_settings = {
- # private
- }
- config.active_support.deprecation = :log
- config.action_dispatch.best_standards_support = :builtin
- config.session_store :active_record_store
- config.action_mailer.default_url_options = { :host => "localhost:3000" }
- end
- production.rb
- Demo::Application.configure do
- config.cache_classes = true
- config.consider_all_requests_local = false
- config.action_controller.perform_caching = true
- config.action_dispatch.x_sendfile_header = "X-Sendfile"
- config.cache_store = :mem_cache_store, "localhost"
- config.serve_static_assets = false
- config.action_mailer.smtp_settings = {
- # private
- }
- config.action_mailer.default_url_options = { # private }
- config.i18n.fallbacks = true
- config.active_support.deprecation = :notify
- end
- routes.rb partial:
- namespace 'accounting' do
- resource :requisitions, :only => [:show] do
- collection do
- get 'filter'
- end
- end
- resource :purchase_orders, :only => [:show]
- resource :accounts_payable, :only => [:show]
- resource :payment_requests, :only => [:show, :update]
- resource :general_ledger, :only => [:show]
- resource :permissions, :only => [:update]
- resources :payment_objects do
- collection do
- get 'filter'
- post 'permissions'
- end
- member do
- match 'approve'
- match 'decline'
- end
- resources :items do
- member do
- get 'receive' => 'items#received_form'
- post 'receive' => 'items#process_received_form'
- end
- resources :receiving_records, :only => [:create, :new]
- end
- resources :files
- resources :comments do
- collection do
- post 'process' => 'comments#create'
- end
- end
- resource :payment_schedule, :only => :show
- end
- end
- app/controllers/comments_controller.rb:
- class CommentsController < ApplicationController
- before_filter :load_resource, :except => :spellchecker
- before_filter :comment_owner_check, :only => [:edit, :update]
- # GET /instructions/:instruction_id/comments
- # GET /requisitions/:requisition_id/comments
- #
- # Loads the content tab for Comment's Instruction.
- def index
- if @resource.class == Instruction
- @create_url = comments_path(:instruction_id => @resource)
- @discard_url = discard_draft_path(:instruction_id => @resource.id, :user_id => current_user.id)
- @draft = current_user.draft.where(:instruction_id => @resource.id).last
- elsif @resource.class == PaymentObject
- @create_url = accounting_payment_object_comments_path(@resource)
- @draft = current_user.draft.where(:payment_object_id => @resource.id).last
- end
- @comment = @resource.comment.new
- @comments = @resource.comment
- if @draft
- @comment.content = @draft.content
- end
- if request.xhr?
- render :layout => false
- end
- end
- end
- error:
- from production:
- Started GET "/accounting/payment_objects/205/comments?_=1311567558808" for 218.103.118.132 at Mon Jul 25 12:19:23 +0800 2011
- ActionController::RoutingError (uninitialized constant Accounting::CommentsController):
- from development (same request):
- Started GET "/accounting/payment_objects/206/comments?_=1311582674088" for 127.0.0.1 at 2011-07-25 16:31:14 +0800
- Processing by CommentsController#index as
- Parameters: {"_"=>"1311582674088", "payment_object_id"=>"206"}
- User Load (0.4ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 ORDER BY name ASC LIMIT 1
- SQL (0.2ms) SELECT COUNT(*) FROM `companies` WHERE `companies`.`id` = 1
- Company Load (0.2ms) SELECT `companies`.* FROM `companies` WHERE `companies`.`id` = 1 ORDER BY name ASC LIMIT 1
- Permission Load (0.5ms) SELECT `permissions`.* FROM `permissions` WHERE `permissions`.`subject_id` = 1 AND (`permissions`.user_id = 1)
- PaymentObject Load (0.5ms) SELECT `payment_objects`.* FROM `payment_objects` WHERE `payment_objects`.`id` = 206 AND (`payment_objects`.company_id = 1) ORDER BY id DESC LIMIT 1
- Draft Load (0.3ms) SELECT `drafts`.* FROM `drafts` WHERE `drafts`.`payment_object_id` = 206 AND (`drafts`.user_id = 1) ORDER BY drafts.id DESC LIMIT 1
- Comment Load (0.5ms) SELECT `comments`.* FROM `comments` WHERE (`comments`.payment_object_id = 206)
- Rendered comments/index.html.erb (4.3ms)
- Completed 200 OK in 562ms (Views: 7.0ms | ActiveRecord: 3.2ms)
- 1.8.7 development:
- [2011-07-25 16:37:29] INFO WEBrick 1.3.1
- [2011-07-25 16:37:29] INFO ruby 1.8.7 (2010-04-19) [i686-darwin10.4.0]
- [2011-07-25 16:37:29] INFO WEBrick::HTTPServer#start: pid=14738 port=3000
- Started GET "/accounting/payment_objects/206/items?_=1311583059577" for 127.0.0.1 at Mon Jul 25 16:37:39 +0800 2011
- Processing by Accounting::ItemsController#index as
- Parameters: {"payment_object_id"=>"206", "_"=>"1311583059577"}
- User Load (0.3ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 ORDER BY name ASC LIMIT 1
- SQL (0.3ms) SELECT COUNT(*) FROM `companies` WHERE `companies`.`id` = 1
- Company Load (0.7ms) SELECT `companies`.* FROM `companies` WHERE `companies`.`id` = 1 ORDER BY name ASC LIMIT 1
- Permission Load (0.4ms) SELECT `permissions`.* FROM `permissions` WHERE `permissions`.`subject_id` = 1 AND (`permissions`.user_id = 1)
- PaymentObject Load (0.3ms) SELECT `payment_objects`.* FROM `payment_objects` WHERE `payment_objects`.`id` = 206 AND (`payment_objects`.company_id = 1) ORDER BY id DESC LIMIT 1
- CACHE (0.0ms) SELECT `companies`.* FROM `companies` WHERE `companies`.`id` = 1 ORDER BY name ASC LIMIT 1
- PaymentObjectItem Load (0.7ms) SELECT `payment_object_items`.* FROM `payment_object_items` WHERE (`payment_object_items`.payment_object_id = 206) ORDER BY item ASC
- Rendered accounting/items/index.html.erb (38.3ms)
- Completed 200 OK in 303ms (Views: 64.8ms | ActiveRecord: 202.1ms)