Class: FrontEnd::PageController

Inherits:
FrontEndController
  • Object
show all
Defined in:
app/controllers/front_end/page_controller.rb

Instance Method Summary collapse

Instance Method Details

#root_redirectObject



21
22
23
24
25
# File 'app/controllers/front_end/page_controller.rb', line 21

def root_redirect
  if "/#{Dust.config.root}" == request.fullpath
    redirect_to root_url, :status => 301
  end
end

#searchObject



17
18
19
# File 'app/controllers/front_end/page_controller.rb', line 17

def search
  @results = (params[:query].present? ? Dust::Block.search(params[:query]) : [])
end

#showObject



5
6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/front_end/page_controller.rb', line 5

def show
  @page = Dust::Page.find_by_filename(params[:filename])
  @contact = Dust::Contact.new

  if @page == nil
    raise Exceptions::PageNotFound
  end

  rescue Exceptions::PageNotFound
    render :file => "#{Rails.root}/public/404.html", :layout => false, :status => 404
end