I'm just in the process of getting video uploading in my app using pandastream, but i can't wrap my head around this attr_accessible rails 3 stuff that isn't in rails 4. I know it has something to do with strong params, but as to what to pass into the code is confusing me, thanks, here's some snippets.
Here's my video model.
class Video < ActiveRecord::Base
validates_presence_of :panda_video_id
def panda_video
@panda_video ||= Panda::Video.find(panda_video_id)
end
end
And Video controller.
class VideosController < ApplicationController
def show
@video = Video.find(params[:id])
@original_video = @video.panda_video
@h264_encoding = @original_video.encodings["h264"]
end
def new
@video = Video.new(video_params)
end
def create
@video = Video.create!(params[:video])
redirect_to :action => :show, :id => @video.id
end
def video_params
params.require(:video).permit(:panda_video_id, :video)
end
end
I had a similar issue. I restructured the form to pass the information to the controller in a slightly different way. I was able to set everything up as follows:
VideoController
video/new.html.erb