this ought to be @mediafiles = Mediafile.find(params[:id]), as this controller would be used to edit an existing mediafile, it should load that mediafile.