Permalink
Browse files

added description

  • Loading branch information...
1 parent 03da475 commit ef6e96f1d06f755be58acc3eaee341960fb2372b @rkononov rkononov committed Sep 10, 2012
Showing with 18 additions and 2 deletions.
  1. +18 −2 README.md
View
@@ -15,10 +15,26 @@ This example show how to work with iron_worker under Rails environment
A:Better to place workers in rails_root/workers dir like in example [worker dir](https://github.com/iron-io/iron_worker_rails_example/tree/master/workers)
-2. Q:How to use ActionMailer in worker?
+2. Q:How to upload workers?
- A: Do following steps:
+ A:You could upload workers from many places:
+ * initializer [iron_worker](https://github.com/iron-io/iron_worker_rails_example/blob/master/config/initializers/iron_worker.rb#L4)
+ * rake task
+ * controller/model - [controller](https://github.com/iron-io/iron_worker_rails_example/blob/master/app/controllers/codes_controller.rb#L8)
+
+3. Q:How to use ActionMailer in worker?
+
+ A: Follow next steps:
* merge mailer and template in [.worker file](https://github.com/iron-io/iron_worker_rails_example/blob/master/workers/simple_mailer_worker.worker)
+ * send connection details as parameter [mailer details](https://github.com/iron-io/iron_worker_rails_example/blob/master/app/controllers/custom_examples_controller.rb#L6)
* configure mailer in worker - [init_mailer](https://github.com/iron-io/iron_worker_rails_example/blob/master/workers/simple_mailer_worker.rb#L7)
* [send email](https://github.com/iron-io/iron_worker_rails_example/blob/master/workers/simple_mailer_worker.rb#L29)
+4. Q:How to use Models in worker?
+
+ A: Follow next steps:
+ * merge models in [.worker file](https://github.com/iron-io/iron_worker_rails_example/blob/master/workers/simple_mailer_worker.worker)
+ * send connection details as parameter [database details](https://github.com/iron-io/iron_worker_rails_example/blob/master/app/controllers/custom_examples_controller.rb#L6)
+ * configure database connection in worker - [setup_database](https://github.com/iron-io/iron_worker_rails_example/blob/master/workers/simple_mailer_worker.rb#L16)
+ * [use model](https://github.com/iron-io/iron_worker_rails_example/blob/master/workers/simple_mailer_worker.rb#L29)
+

0 comments on commit ef6e96f

Please sign in to comment.