Class: ForgeController
Direct Known Subclasses
Forge::AssetsController, Forge::BannersController, Forge::CommentsController, Forge::CountriesController, Forge::DispatchesController, Forge::EventsController, Forge::GalleriesController, Forge::HelpTopicsController, Forge::IndexController, Forge::OrdersController, Forge::PagesController, Forge::PostCategoriesController, Forge::PostsController, Forge::ProductCategoriesController, Forge::ProductsController, Forge::SalesController, Forge::SettingsController, Forge::SubscriberGroupsController, Forge::SubscribersController, Forge::TaxRatesController, Forge::UsersController, Forge::VideoFeedsController, Forge::VideosController
Instance Method Summary
collapse
#app_init
Instance Method Details
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/forge/app/controllers/forge_controller.rb', line 18
def
routes = Rails.application.routes.routes
inspector = ActionDispatch::Routing::RoutesInspector.new(routes)
formatter = ActionDispatch::Routing::ConsoleFormatter.new
controllers = inspector.format(formatter).split("\n").select do |route|
route.match('forge')
end.map do |route|
route.gsub(/.*\)\s+/,'').gsub("forge/","").gsub(/#.*/, "")
end
@menu_items = controllers.reject {|c| c == "index"}.uniq!
end
|
#load_help ⇒ Object
14
15
16
|
# File 'lib/forge/app/controllers/forge_controller.rb', line 14
def load_help
@help_slug = "#{params[:controller].split('/')[1]}_#{params[:action]}"
end
|
#set_crumbs ⇒ Object
32
33
34
35
|
# File 'lib/forge/app/controllers/forge_controller.rb', line 32
def set_crumbs
@controller_crumb = params[:controller]
@action_crumb = params[:action]
end
|
#set_title ⇒ Object
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/forge/app/controllers/forge_controller.rb', line 37
def set_title
case params[:action]
when "new", "create"
@page_title = "New #{params[:controller].gsub('forge/', '').singularize.humanize} - Forge".titleize
when "edit", "update"
@page_title = "Edit #{params[:controller].gsub('forge/', '').singularize.humanize} - Forge".titleize
else
@page_title = params[:controller].gsub('forge/', '').humanize.titleize + " - Forge"
end
@page_title = "Forge" if params[:controller].gsub('forge/', '') == "index"
end
|
#uses_ckeditor ⇒ Object
10
11
12
|
# File 'lib/forge/app/controllers/forge_controller.rb', line 10
def uses_ckeditor
@uses_ckeditor = true
end
|