1 # Handles dealing with slideshows
3 # We use make_resourceful to create most of the
4 # RESTful actions of the controller. We use a custom
5 # new action because it behaves a little different,
6 # but otherwise the actions are generated by
8 class ShowsController < ApplicationController
9 in_place_edit_for :show, :title
14 # These are the only actions we need for now
15 actions :show, :edit, :destroy
17 # The slideshow needs to use the S5 layout
18 response_for(:show) { render :layout => false }
19 # We want to avoid the index URL
20 response_for(:destroy) do
21 set_default_flash :notice, "The show was deleted."
22 set_default_redirect home_path
26 # Avoid loading shows if we don't use them
27 def index; redirect_to home_path; end
29 # This behaves a little special
31 # See SongsController#new
33 @show = current_model.create(:title => 'Untitled')
34 redirect_to edit_show_path(@show)
37 # Assigns new positions to all the songs in
40 # This should be called from an Ajax request.
42 current_model.find(params[:id]).order! params[:songs_list]
43 render :nothing => true
47 # Make everything hang off the current user
49 # See SongsController#current_model