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

Version Path
forge-cli-0.1.10 lib/forge/app/controllers/forge/video_feeds_controller.rb
forge-cli-0.1.9 lib/forge/app/controllers/forge/video_feeds_controller.rb
forge-cli-0.1.8 lib/forge/app/controllers/forge/video_feeds_controller.rb
forge-cli-0.1.7 lib/forge/app/controllers/forge/video_feeds_controller.rb
forge-cli-0.1.6 lib/forge/app/controllers/forge/video_feeds_controller.rb
forge-cli-0.1.5 lib/forge/app/controllers/forge/video_feeds_controller.rb
forge-cli-0.1.4 lib/forge/app/controllers/forge/video_feeds_controller.rb
forge-cli-0.1.3 lib/forge/app/controllers/forge/video_feeds_controller.rb
forge-cli-0.1.2 lib/forge/app/controllers/forge/video_feeds_controller.rb
forge-cli-0.1.1 lib/forge/app/controllers/forge/video_feeds_controller.rb
forge-cli-0.1.0 lib/forge/app/controllers/forge/video_feeds_controller.rb
forge-cli-0.0.18 lib/forge/app/controllers/forge/video_feeds_controller.rb
forge-cli-0.0.17 lib/forge/app/controllers/forge/video_feeds_controller.rb
forge-cli-0.0.16 lib/forge/app/controllers/forge/video_feeds_controller.rb
forge-cli-0.0.15 lib/forge/app/controllers/forge/video_feeds_controller.rb
forge-cli-0.0.14 lib/forge/app/controllers/forge/video_feeds_controller.rb
forge-cli-0.0.13 lib/forge/app/controllers/forge/video_feeds_controller.rb
forge-cli-0.0.12 lib/forge/app/controllers/forge/video_feeds_controller.rb
forge-cli-0.0.11 lib/forge/app/controllers/forge/video_feeds_controller.rb
forge-cli-0.0.10 lib/forge/app/controllers/forge/video_feeds_controller.rb