summaryrefslogtreecommitdiff
path: root/app/controllers/switchboard_entries_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/switchboard_entries_controller.rb')
-rw-r--r--app/controllers/switchboard_entries_controller.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/app/controllers/switchboard_entries_controller.rb b/app/controllers/switchboard_entries_controller.rb
index ef6c72e..32ca9bb 100644
--- a/app/controllers/switchboard_entries_controller.rb
+++ b/app/controllers/switchboard_entries_controller.rb
@@ -8,8 +8,17 @@ class SwitchboardEntriesController < ApplicationController
end
def show
- @switchboard_entry = @switchboard.switchboard_entries.find(params[:id])
- spread_breadcrumbs
+ if @switchboard
+ @switchboard_entry = @switchboard.switchboard_entries.find(params[:id])
+ spread_breadcrumbs
+ else
+ @switchboard_entry = SwitchboardEntry.find(params[:id])
+ end
+
+ respond_to do |format|
+ format.html
+ format.json { render json: @switchboard_entry }
+ end
end
def new