When saving our Video object we get a no method vide_url error when trying to redirect to the video#watch action and view the object
Admin/Video/Controller
def create
@video = Video.create(user: User.first, title: params['title'], description: params['description'], file: params['video']['file'])
redirect_to @video
end
Video/Controller
def index
@videos = Video.page(params[:page]||1)
end
def watch
@video = Video.find_by!(id: params[:id])
end
Routes
get "video/index"
get "video/watch/:id" => 'video#watch'
namespace :admin do
resources :video
resources :playlist
end
Any idea what is going on? Is it because we are using custom routes for the videos?