shirishkz / nimble-scraper-app

A web scraper app using Nokogiri that extracts relevant data from Google Search.
https://nimble-scraper-app.herokuapp.com/
MIT License
1 stars 1 forks source link

Too fat controllers #3

Open olivierobert opened 6 years ago

olivierobert commented 6 years ago

The method show in WordsController is doing too many things.

words_controller_rb_-_shirish_-___volumes_workspace__candidates-tests_shirish_

As a best practice keep controllers thin with limited logic. Think of controllers as simple coordinators which delegate all heavy lifting to models or other objects e.g. services, factories...

Tip: a controller method should not instantiate more than 1 or 2 variables (@). Use rubocop as it will help you to follow Ruby conventions.

shirishkz commented 6 years ago

I've fix this now, most of the "scraping" logic is at the model, where once the file is uploaded, the scraping also starts and stores in the same table.