The loss at Malleny Park was Ayr's first in 2012/13 and they made sure there was no repeat at home, coming out on top 51-5.
Ayr were 10-0 up at half-time with tries by centre Robbie Fergusson and winger Craig Gossman. After the break Gossman got a second and hooker Hayden Wisnewski, replacement Sylvain Diez, fellow substitute Gordon Reid (2), centre Richard Dalgleish and full-back Grant Anderson all scored tries. Scrum-half Peter Jericevich converted three. Grammar's score was a try by replacement Sam Knudson.
Edinburgh Accies edged out Boroughmuir 18-15 at Raeburn Place. The visitors went 3-0 up early on. 'Muir extended their lead to 10-0 in the 28th minute with a good team move giving full-back Damien Hoyland space to run in from 50 metres.
Accies hit back just before the break with a try by centre Nyle Godsmark and it was 10-10 on 51 minutes when prop Alex Allan touched down.
'Muir winger Redha Guedroudj went over, but a try by Dan Teague and a drop-goal by Ruairidh Bonner secured the Accies victory.
Heriot's and Currie drew 27-27 at Goldenacre. The visitors led 13-9 at the interval, with a try by Adam Hinds and eight points kicked by Jamie Forbes to three penalties by stand-off Graham Wilson.
A 68th-minute converted try by Jonny Gray put Currie 27-22 up, but with four minutes to go Heriot's Russell Nimmo secured a share of the spoils.