Class: FreeText::TextsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- FreeText::TextsController
- Defined in:
- app/controllers/free_text/texts_controller.rb
Instance Method Summary collapse
- #aloha_config ⇒ Object
- #hash_to_string(hash) ⇒ Object
- #tab_to_string(tab) ⇒ Object
-
#update ⇒ Object
before_filter FreeText.authentication.call.
Instance Method Details
#aloha_config ⇒ Object
15 16 17 18 |
# File 'app/controllers/free_text/texts_controller.rb', line 15 def aloha_config @settings = FreeText.settings.to_s @repositories = hash_to_string(FreeText.getRepositories.call) end |
#hash_to_string(hash) ⇒ Object
24 25 26 |
# File 'app/controllers/free_text/texts_controller.rb', line 24 def hash_to_string(hash) hash.to_s.gsub("=>", ": ").html_safe end |
#tab_to_string(tab) ⇒ Object
20 21 22 |
# File 'app/controllers/free_text/texts_controller.rb', line 20 def tab_to_string(tab) tab.to_s.html_safe end |
#update ⇒ Object
before_filter FreeText.authentication.call
5 6 7 8 9 10 11 12 13 |
# File 'app/controllers/free_text/texts_controller.rb', line 5 def update editables = params["editables"] editables.each do |e| datas = e[1] editable_text = FreeText::Text.find_by_key_and_locale(datas["key"], datas["locale"]) editable_text.update_attribute("content", datas["content"]) end render :json => {:success => true} end |