Tôi có một số cài đặt email trong development.rb mà tôi muốn truy cập trong bộ điều khiển của mình.Nhận cài đặt môi trường trong bộ điều khiển đường ray
Settings trong development.rb
là:
config.notify_submited_transaction = '[email protected],[email protected]'
config.notify_approved_transaction = '[email protected]'
Trong điều khiển của tôi/hành động tôi đang cố gắng này:
@to = Rails.env.notify_submited_transaction
@subject = 'AM - Vendor Submitted Transaction'
AmMailer.vendor_submited_transaction(@to, @subject, current_user).deliver
này mặc dù kết quả do lỗi:
undefined method `notify_submited_transaction'
Tôi không chắc chắn làm thế nào để có được giá trị cấu hình tôi đã thiết lập.
Cảm ơn bạn đã được trợ giúp.
Điều này có thể trùng lặp với http://stackoverflow.com/questions/592554/best-way-to-create-custom-config-options-for-my-rails-app và http: //stackoverflow.com/questions/1450285/how-to-define-custom-configuration-variables-in-rails – Ernest