Class: Pwb::WelcomeController

Inherits:
ApplicationController show all
Defined in:
app/controllers/pwb/welcome_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

default_url_options, #set_locale, #set_theme_path

Instance Method Details

#indexObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/controllers/pwb/welcome_controller.rb', line 7

def index
  @page = Pwb::Page.find_by_slug "home"
  @page_title = @current_agency.company_name
  # @content_to_show = []

  if @page.present?
    if @page.page_title.present?
      @page_title = @page.page_title + ' - ' + @current_agency.company_name.to_s
    end

    @properties_for_sale = Prop.for_sale.visible.order('highlighted DESC').limit 9
    @properties_for_rent = Prop.for_rent.visible.order('highlighted DESC').limit 9

    # @search_defaults = params[:search].present? ? params[:search] : {}

    return render "pwb/welcome/index"
  else
    return render "pwb/page_not_found"
  end
end