In my application I have a field where users can enter a URL and then products will be scraped from that URL. I watched "Screen Scraping with Nokogiri", and I created the result I wanted; I put in a URL and the data gets mined.
- How do I implement this into a Rails application?
- Do I put my code into a controller?
- Does Nokogiri work in controllers?
- Do I need to require Nokogiri?
- Do I use a Rake task?
- If I do use a Rake task, how do I put the user-submitted URL in that Rake task? I read on a previous SO post (not sure where) that executing Rake tasks from the controller is a big security no-no.