# -*- encoding : utf-8 -*-
class Admin::HomePagesController < ApplicationController
  	before_filter :authenticate_admin!
	layout "admin"

	navigation :home_pages
	
	def show
		@home = Home.find(params[:id])
  	end

	def edit
		@home = Home.find(params[:id])
	end
	
	
	def update
		@home = Home.find(params[:id])
		
		if @home.update_attributes(params[:home])
			flash[:notice] = "Les promotions ont bien été modifiées."

			respond_to do |format|
				format.js
			end

		else
			respond_to do |format|
				format.js { render :action => :edit}
			end		
		end
	end
	

end
