Reputation: 13
I have two related to each other questions. I need some best practices.
First part.. Im searching best place to put data parser from text area. I do not want to insert that data to database, just read from text area after that compare that with some data and do some action (no any data from database). Where would u place that parsers? I should use helper (for now I use helpers just in view), concerns or just model methods?
Second part.. For example, lets input data looks like:
A B H 0 2
C D R 1 3
E F E 4 9
R H T 1 0
I parse that data from text area, split by column, check regex, if there is 5 cols etc. I need to create list of objects, and where could i create that 'helper' class with fields like first_col, sec_col, third_col, that data will be not saved to database..?
Upvotes: 0
Views: 71
Reputation: 1673
I think it's the job of a service object. You will pass the text to your service, it will work with your param and return the result, anywhere in your app.
Upvotes: 1