I wanted to populate the DB with (name,data) pairs based on some rules.
I have created a scaffold with name and data as attributes. In the
controller file under the def for index, i have changed the line
@data_pairs = DataPair.all to
@data_pairs = DataPair.get_all_pairs
and in the corresponding models file i have defined this function
i get an error undefined method 'name' for ".":String
in line -> <td><%=data_pair.name %></td>
Im a beginner in ROR. Can someone help me out ?