1

My code reads in log files and parses the data. The output gets me something that looks like this:

name: jon
domain: [email protected]
date: 2-12-2012

I have created my database called "databases" And I want to have my parsed data updated in the database without using simply CRUD actions. (I don't want to manually create each log) My question is how would I go about automatically taking the parsed data (after running my code) and having it save and show up in the database.

Thanks

3
  • @MuhammadJunaid Where would I place this code? Commented Aug 26, 2015 at 21:36
  • right after parsing the data Commented Aug 26, 2015 at 21:40
  • @muhammadjunaid sorry for not being clear, I meant to ask which file i place this in. Or if its in the command line Commented Aug 26, 2015 at 22:08

1 Answer 1

1

You can put the code right after the parsing code but you have to create a record first:

name: jon
domain: [email protected]
date: 2-12-2012
model = Model.new
model.update_columns(name: name,domain: domain, date: date)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.