Hi I am uploading the video from my rails app. For this I am using carrierwave gem.
I am referring this tutorial for it.
But when I tried to upload the video from my computer by using Browse button it is not allowing me to browse. When I checked in the firebug I have getting this type of error
"NetworkError: 404 Not Found - http://localhost:3000/videos/uploadify.swf?preventswfcaching=1393936089114"
I tried to solve it but I didn't get any solution for it.
Here is my videos controller
class VideosController < ApplicationController
def index
end
def show
@video = Video.find(params[:id])
end
def new
@video = Video.new(video_params)
end
def create
@video = Video.new(video_params)
if @video.save
render :nothing => true
else
render :nothing => true, :status => 400
end
end
private
def video_params
params.require(:video).permit(:attachment, :zencoder_output_id, :processed, :video, :meta_info) if params[:gallery]
end
end
model - video.rb
class Video < ActiveRecord::Base
belongs_to :gallery
mount_uploader :video, VideoUploader
end
uploader file
class VideoUploader < CarrierWave::Uploader::Base
include CarrierWave::Video
storage :file
def store_dir
"videos/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
process encode_video: [:mp4, resolution: "200x200"]
def extension_white_list
%w(avi mov mkv mpg mpeg mp4 m4v flv)
end
end
I am using rails 4 and ruby 2.1.0