Appending ruby partial w('<%= characters) to end of file with SED
===

I am trying to add this line to the end a set of files:

    <%= render 'success_guide_menu' %>

All of these files begin with 'school_guide'.

I tried to use the following sed script:

    sed "
    $ a\
    <%= render 'school_guide_menu' %>
    " school_guide*

but I get an error that says

     sed: 1: "$ a\<\%\= render 'schoo ...": extra characters after \ at the end of a command

I have tried to escape the characters with no success and am not really sure what sed is referring to in this error because it dosen't seem to be the files and (I think) it is also reading in the entire string. Help?