class DashboardController < ApplicationController

  def error404
    @page = Flatpage.find_by_url('/' + params[:path].join('/'))
    # render :text => params[:path].join('/'), :status => 404
    # render :text => params[:path].join('/')    
    if @page.blank?
      render :text => 'not found', :status => 404
    else
      render :text => @page.url
    end
  end
  
  def index
    @posts = Post.find(:all, :order => 'created_at DESC', :conditions => ["status = 'published'"])
    respond_to do |format|
      format.html # index.html.erb
      format.js
    end
  end

end