Class: Forge::HelpTopicsController

Inherits:
ForgeController show all
Defined in:
lib/forge/app/controllers/forge/help_topics_controller.rb

Instance Method Summary collapse

Methods inherited from ForgeController

#get_menu_items, #load_help, #set_crumbs, #set_title, #uses_ckeditor

Methods inherited from ApplicationController

#app_init

Instance Method Details

#indexObject



3
4
5
6
7
8
9
# File 'lib/forge/app/controllers/forge/help_topics_controller.rb', line 3

def index
  @help_topics = HelpTopic.order(:title).group(:title, :id)
  respond_to do |format|
    format.js { render :layout => false }
    format.html { }
  end
end

#searchObject



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/forge/app/controllers/forge/help_topics_controller.rb', line 19

def search
  @page_title = "Searching Help for: #{params[:q]}"
  q = params[:q] ? params[:q] : ""
  @help_topics = HelpTopic.where(
    "LOWER(content) LIKE :q OR LOWER(title) LIKE :q",
    {:q => q.downcase}
  )
  respond_to do |format|
    format.js { render :layout => false }
  end
end

#showObject



11
12
13
14
15
16
17
# File 'lib/forge/app/controllers/forge/help_topics_controller.rb', line 11

def show
  @help_topic = HelpTopic.where(:slug => params[:slug]).first
  respond_to do |format|
    format.js { render :layout => false }
    format.html { }
  end
end