Class: StaticController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#display_uservoice_sso, #render_facebook_like, #render_facebook_sdk, #render_twitter

Instance Method Details

#faqObject



10
11
12
# File 'app/controllers/static_controller.rb', line 10

def faq
  @title = t('static.faq.title')
end

#guidelinesObject



2
3
4
# File 'app/controllers/static_controller.rb', line 2

def guidelines
  @title = t('static.guidelines.title')
end

#guidelines_tipsObject



6
7
8
# File 'app/controllers/static_controller.rb', line 6

def guidelines_tips
  @title = t('static.guidelines_tips.title')
end

#sitemapObject



19
20
21
22
23
24
25
26
# File 'app/controllers/static_controller.rb', line 19

def sitemap
  # TODO: update this sitemap to use new homepage logic
  @home_page    ||= Project.includes(:user, :category).visible.limit(6).all
  @expiring     ||= Project.includes(:user, :category).visible.expiring.not_expired.order("(projects.expires_at), created_at DESC").limit(3).all
  @recent       ||= Project.includes(:user, :category).visible.not_expiring.not_expired.where("projects.user_id <> 7329").order('created_at DESC').limit(3).all
  @successful   ||= Project.includes(:user, :category).visible.successful.order("(projects.expires_at) DESC").limit(3).all
  return render 'sitemap'
end

#thank_youObject



14
15
16
17
# File 'app/controllers/static_controller.rb', line 14

def thank_you
  backer = Backer.find session[:thank_you_backer_id]
  redirect_to [backer.project, backer]
end