class Www::ContactMessagesController < WwwController

  def create
    @contact_message = ContactMessage.new(params[:contact_message])
    @page = Page.find(Config[:www][:contact_page_id])
    
    respond_to do |format|
      if @contact_message.save
        format.html { redirect_to www_page_path(@page), :flash => :success }
        format.json { render json: @contact_message, status: :created, location: @contact_message }
      else        
        format.html { render 'www/pages/show' }
        format.json { render json: @contact_message.errors, status: :unprocessable_entity }
      end
    end
  end

end
