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
#build ⇒ Object
20
21
22
23
24
25
26
27
28
29
30
|
# File 'app/controllers/rubber_ring/rubber_ring_controller.rb', line 20
def build
Build.run!(request)
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
|
#publish ⇒ Object
32
33
34
35
36
37
38
39
40
|
# File 'app/controllers/rubber_ring/rubber_ring_controller.rb', line 32
def publish
begin
Publish.assets!
rescue Errno::EACCES
flash.now[:error] =
'Rubber Ring is trying to copy files on to path which is not writable.
Please tell developers to check publish.yml file.'
end
end
|
#respond(page) ⇒ Object
47
48
49
|
# File 'app/controllers/rubber_ring/rubber_ring_controller.rb', line 47
def respond(page)
render :json => {controller: page.controller, action: page.action, content: page.content}
end
|
#set_locale ⇒ Object
42
43
44
45
|
# File 'app/controllers/rubber_ring/rubber_ring_controller.rb', line 42
def set_locale
I18n.locale = params[:locale] || I18n.default_locale
@locale = I18n.locale.to_s
end
|