Update to rails 4.
Change attr_asssesbile to permit_params.
use end_of_association_chain instead of resource