Return the board to the rails and store it

I know that it could sound an “easy-question” but I am new in rails and I don’t know if I am structuring correctly my app.

My app is “easy” it has to connect a webpage and collect all JPG links and store the links in a database.

In my “model folder” I have defined my functions:

class JPG div", :items  => Scraper.define {
          process "div.thumb>a", :link => "@href"

        }
        result :items
      end

      uri = URI.parse(URI.encode(web))
      return scraper.scrape(uri)
    end
  end

As you can see the function main_web
returns an array.

Well my question is “easy”. If I want to call the function and to storage the information in the database, how do I have to do it?

I don’t want to show the information in the screen I only want to storage the data in the database but from where do I have to do the call? view? or controller?

Hello, buddy!责编内容来自:Hello, buddy! (源链) | 更多关于

阅读提示:酷辣虫无法对本内容的真实性提供任何保证,请自行验证并承担相关的风险与后果!
本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 后端存储 » Return the board to the rails and store it

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录