boot from a ubuntu LiveCD and in terminal type (i assume you havent separately made a partition to mount /boot into):
sudo fdisk -l to identify the device name of your linux partition. usually it is /dev/sdax where x is a number.
sudo mount /dev/sdax /mnt (replace x with the number you identified from fdisk -l)
sudo grub-install --boot-directory=/mnt/boot /dev/sda (note that it is only /dev/sda)
reboot and now you will be able to get into your installed ubuntu. in ubuntu, goto terminal and type
sudo update-grub
NOTE: it might be hda or anything else instead of sda