Class: Refinery::ApplicationController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Refinery::ApplicationController
- Includes:
- AuthenticatedSystem, Crud
- Defined in:
- vendor/plugins/refinery/lib/refinery/application_controller.rb
Direct Known Subclasses
Instance Method Summary collapse
- #admin? ⇒ Boolean
- #error_404 ⇒ Object
- #from_dialog? ⇒ Boolean
- #home_page? ⇒ Boolean
- #just_installed? ⇒ Boolean
- #local_request? ⇒ Boolean
- #wymiframe ⇒ Object
Methods included from Crud
Instance Method Details
#admin? ⇒ Boolean
39 40 41 |
# File 'vendor/plugins/refinery/lib/refinery/application_controller.rb', line 39 def admin? controller_name =~ /^admin\// end |
#error_404 ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'vendor/plugins/refinery/lib/refinery/application_controller.rb', line 13 def error_404 if (@page = Page.("^/404$", :include => [:parts, :slugs])).present? # render the application's custom 404 page with layout. render :template => "/pages/show", :status => 404 else # fallback to the default 404.html page. render :file => Rails.root.join("public", "404.html"), :layout => false, :status => 404 end end |
#from_dialog? ⇒ Boolean
35 36 37 |
# File 'vendor/plugins/refinery/lib/refinery/application_controller.rb', line 35 def from_dialog? params[:dialog] == "true" or params[:modal] == "true" end |
#home_page? ⇒ Boolean
23 24 25 |
# File 'vendor/plugins/refinery/lib/refinery/application_controller.rb', line 23 def home_page? action_name == "home" and controller_name == "pages" end |
#just_installed? ⇒ Boolean
31 32 33 |
# File 'vendor/plugins/refinery/lib/refinery/application_controller.rb', line 31 def just_installed? !User.exists? end |
#local_request? ⇒ Boolean
27 28 29 |
# File 'vendor/plugins/refinery/lib/refinery/application_controller.rb', line 27 def local_request? ENV["RAILS_ENV"] == "development" or request.remote_ip =~ /(::1)|(127.0.0.1)|((192.168).*)/ end |
#wymiframe ⇒ Object
43 44 45 |
# File 'vendor/plugins/refinery/lib/refinery/application_controller.rb', line 43 def wymiframe render :template => "/wymiframe", :layout => false end |