fixed relationships and controller so now works. Initial problem with using Rails 4.0