Looks like the problem is that you are trying to call @page.versions[params[:version].to_i]
with the id of your version object, but @page.versions is just a collection and expect an index unrelated to the id of the version object.
Either of these solutions should work:
Version.find(params[:version])
Or
@page.versions.find(params[:version])