I'm trying to automate my database population with sample objects, so I use rake tasks. I would like to use some data from other website pages. I created txt file with url list from where that information supposed to be read and ran into problem: I don't know how to make requests outside from rake task. I need to get response, extract some selectord as RSPEC allows to do. Thank you, guys!
Asked
Active
Viewed 247 times
1 Answers
0
For custom rake tasks, you can always create your own plugin. Refer rails guide - plugins section. In the plugin, you can use get method to get the data from an external URL. Refer ActionDispatch::Integration::RequestHelpers methods for the details. You can add your own extraction logic and seed the database.

Salil
- 9,534
- 9
- 42
- 56
-
thank you very much!look forward to try this though it will need some time to make out concreet realization: I'm tooo newbee ))) – Roaring Stones May 07 '12 at 04:57
-
generators mentioned in the reference you provided isn't work for Rails 3.1. Is the way of plugin programming changed? – Roaring Stones May 23 '12 at 08:07