# -*- encoding : utf-8 -*-
class Admin::HomeBlocksController < ApplicationController
	before_filter :authenticate_admin!
	load_and_authorize_resource
	

  def show
  end

  def edit
	@home_block = HomeBlock.find(params[:id])
	params[:resource => "home_block"]
  end

  def update
	@home_block = HomeBlock.find(params[:id])

	

	if @home_block.update_attributes(params[:home_block])
		flash[:notice] = "Le bloc a bien été modifié."

		respond_to do |format|
			format.js
		end

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

end
