summaryrefslogtreecommitdiff
path: root/app/controllers/switchboards_controller.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-25 10:26:49 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-04-03 22:09:33 +0200
commit877364c24ef9c7954f0e193456bb3f2d39169977 (patch)
tree67ccc220fc9a98300356855f0c9e3b6f13d37223 /app/controllers/switchboards_controller.rb
parent595e5f9d32c9dda8f7b6c0dd5e7e4fba4693eca4 (diff)
First try
Diffstat (limited to 'app/controllers/switchboards_controller.rb')
-rw-r--r--app/controllers/switchboards_controller.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/controllers/switchboards_controller.rb b/app/controllers/switchboards_controller.rb
index c499c69..8ceb96d 100644
--- a/app/controllers/switchboards_controller.rb
+++ b/app/controllers/switchboards_controller.rb
@@ -3,8 +3,16 @@ class SwitchboardsController < ApplicationController
authorize_resource :switchboard, :through => :user
def index
+ if @user.nil?
+ @user = current_user
+ end
@switchboards = @user.switchboards
spread_breadcrumbs
+
+ respond_to do |format|
+ format.html
+ format.json { render json: @switchboards }
+ end
end
def show
@@ -14,6 +22,11 @@ class SwitchboardsController < ApplicationController
@switchboard = @user.switchboards.find(params[:id])
@switchboard_entries = @switchboard.switchboard_entries
spread_breadcrumbs
+
+ respond_to do |format|
+ format.html
+ format.json { render json: @switchboard }
+ end
end
def new