Sha256: b87ce8a05f1266b5599226abbeeea1b50f6a1e607b77cf5ebffd8d1a0ecb8b9b
Contents?: true
Size: 1.16 KB
Versions: 24
Compression:
Stored size: 1.16 KB
Contents
class Forge::VideoFeedsController < ForgeController load_and_authorize_resource def index respond_to do |format| format.html { @videos = VideoFeed.paginate(:per_page => 10, :page => params[:page]) } format.js { @videos = VideoFeed.where("title LIKE ?", "%#{params[:q]}%") render :partial => "video", :collection => @videos } end end def new flash[:notice] = VideoFeed.import_videos(MySettings.video_feed_source) redirect_to forge_video_feeds_path end def edit @video = VideoFeed.find(params[:id]) end def create @video = VideoFeed.new(params[:video_feed]) if @video.save flash[:notice] = 'VideoFeed was successfully created.' redirect_to(forge_video_feeds_path) else render :action => "new" end end def update if @video.update_attributes(params[:video_feed]) flash[:notice] = 'VideoFeed was successfully updated.' redirect_to(forge_video_feeds_path) else render :action => "edit" end end def publish @video.update_attributes(:published => @video.published? ? false : true) redirect_to forge_video_feeds_path end end
Version data entries
24 entries across 24 versions & 1 rubygems