Class: LadyJosephine::EditorController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- LadyJosephine::EditorController
- Defined in:
- app/controllers/lady_josephine/editor_controller.rb
Instance Method Summary collapse
Instance Method Details
#ping ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/controllers/lady_josephine/editor_controller.rb', line 4 def ping if @resource = find_resource result = {ping: {}} if @resource.ping(current_user, params[:update] == "force") @resource.save result[:ping][:state] = "OK" else result[:ping][:state] = "CONFLICT" end result[:ping][:ping_date] = @resource.ping_date result[:ping][:user_id] = @resource.ping_user.try :id result[:ping][:user_name] = @resource.ping_user.try :name render json: result end end |
#version ⇒ Object
22 23 24 25 26 |
# File 'app/controllers/lady_josephine/editor_controller.rb', line 22 def version if @resource = find_resource render json: @resource end end |