1
因此,這是錯誤我拿到之後我試圖上傳我的視頻獲取與紅寶石視頻錯誤on Rails的4應用
這是我的展後
<%= video_tag @post.video.url(:medium), controls: true, style: "max-width: 100%;" %>
<p>
<strong>Description:</strong>
<%= @post.description %>
</p>
<% if @post.user == current_user %>
<%= link_to 'Edit', edit_post_path(@post) %>
<% end %>|
<%= link_to 'Back', posts_path %>
這是我的後期型號
class Post < ActiveRecord::Base
belongs_to :user
has_attached_file :video, styles: {
:medium => {
:geometry => "640x480",
:format => 'mp4'
},
:thumb => { :geometry => "160x120", :format => 'jpeg', :time => 10}
}, :processors => [:transcoder]
validates_attachment_content_type :video, content_type: /\Avideo\/.*\Z/
end
我很好奇,如果有人遇到過這個,我很喜歡如果我能得到任何關於如何解決這個問題的幫助。我正在使用回形針av-transcoder gem,ffmpeg和paperclip gem。如果需要的話
這是帖子控制器I可以添加任何詳細信息,如果這有助於
def index
@posts = Post.all
end
def show
end
def new
@post = current_user.posts.build
end
def edit
end
def create
@post = current_user.posts.build(post_params)
if @post.save
redirect_to @post, notice: 'Post was successfully created.'
else
render :new
end
end
def update
if @post.update(post_params)
redirect_to @post, notice: 'Post was successfully updated.'
else
render :edit
end
end
def destroy
@post.destroy
redirect_to posts_url
end
private
def set_post
@post = Post.find_by(id: params[:id])
end
def correct_user
@post = current_user.posts.find_by(id: params[:id])
redirect_to posts_path, notice: "Not authorized to edit this post" if @post.nil?
end
def post_params
params.require(:post).permit(:description, :video)
end
end
你可以打開您的控制檯,看看是否有任何錯誤? – Uzbekjon
@Uzbekjon我拉起了我的瀏覽器控制檯,但沒有顯示任何東西。我不知道你是否意味着滑軌控制檯,儘管 –
是瀏覽器控制檯。你能否看到添加'video'標記的呈現HTML?讓我們看看是否有任何問題... – Uzbekjon