Class: RubberRing::RubberRingController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- RubberRing::RubberRingController
show all
- Defined in:
- app/controllers/rubber_ring/rubber_ring_controller.rb
Instance Method Summary
collapse
Instance Method Details
#expire_and_respond(page) ⇒ Object
25
26
27
28
|
# File 'app/controllers/rubber_ring/rubber_ring_controller.rb', line 25
def expire_and_respond(page)
expire_page(params[:page_path])
render :json => {controller: page.controller, action: page.action, content: page.content}
end
|
#load_page_content ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
|
# File 'app/controllers/rubber_ring/rubber_ring_controller.rb', line 8
def load_page_content
page = Page.where(
controller: params[:controller],
action: params[:action],
locale: params[:locale] || I18n.default_locale.to_s
)
@page = page.empty? ? Page.new : page.first
@page.edit_mode = true
@images, @attachments = Util.load_attachments_page(params)
end
|
#set_locale ⇒ Object
20
21
22
23
|
# File 'app/controllers/rubber_ring/rubber_ring_controller.rb', line 20
def set_locale
I18n.locale = params[:locale] || I18n.default_locale
@locale = I18n.locale.to_s
end
|