Shalom Rabbi Bloomenstiel,
Under which mitzvah did Ruth glean the fields of Boaz? She is not harvesting but she is picking the left over grains.
There was a mitzvah for Boaz to leave behind any forgotten grain for the poor and indigent. This is the mitzvah of shik’khah – see. Lev. 19:9.
How does it fit into the Talmudic law of workers being allowed to eat some produce as they harvest it.
Different law. Here, the grain was left behind (or intentionally abandoned, as Boaz seems to have done) for the sake of the poor. She was allowed to take of that grain on account that it was free for the taking. Since she was not working the fields of Boaz, she was not entitled to take as an employee.