diff options
Diffstat (limited to 'app/controllers/switchboards_controller.rb')
-rw-r--r-- | app/controllers/switchboards_controller.rb | 13 |
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 |