In the middle of adding custom theme supports. Skin_pictures table added to store...
[selectricity-live] / app / controllers / election_controller.rb
index 571b93628e7e916f2dd4e2228e91c02729c5344d..becba6b161d7cc9781b6c2cc365ecfdd3adad2f9 100644 (file)
@@ -62,6 +62,11 @@ class ElectionController < ApplicationController
   
   def update_general_information
     @election = Election.find(params[:id])
   
   def update_general_information
     @election = Election.find(params[:id])
+    
+    if params[:skin_picture]
+      add_theme
+    end
+    
     if @election.update_attributes(params[:election])
       flash[:notice] = 'Election was successfully updated.'
       redirect_to :action => 'show', :id => @election
     if @election.update_attributes(params[:election])
       flash[:notice] = 'Election was successfully updated.'
       redirect_to :action => 'show', :id => @election
@@ -69,7 +74,12 @@ class ElectionController < ApplicationController
       render :action => 'edit'
     end
   end
       render :action => 'edit'
     end
   end
-
+  
+  def add_theme
+    debugger
+    skin_picture = SkinPicture.new(params[:skin_picture])
+    skin_picture.save
+  end
 
   def show
     @sidebar_content = render_to_string :partial => 'progress',
 
   def show
     @sidebar_content = render_to_string :partial => 'progress',

Benjamin Mako Hill || Want to submit a patch?