Lets say I have a blog and inside of that blog I have blog posts(ie. all belong to "resources :posts"). The only difference that those blog posts are not going to be generated by users with the use of form_for helper but automatically by rails.
I'll try to make a simple example to make it clear...
Lets say My blog app is able to scrape YouTube and everyday it scrapes it to check what is the most viral video of the day. Then it would go and create a blog post automatically without me or other users actually typing in anything inside of the forms to create a post.
Lets say on the first day my blog app scrapes YouTube and retrieves: 1)url of the video to embed on the page 2)title, for the first ever post. My question is how would I pass this information to posts_controller.rb to create a new post, so that if say I go to http://ift.tt/1KhsPQi it would show me the first post.
I apologize if I am not expressing myself clearly enough since I am a Rails newb.
Aucun commentaire:
Enregistrer un commentaire