From 877364c24ef9c7954f0e193456bb3f2d39169977 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Mon, 25 Mar 2013 10:26:49 +0100 Subject: First try --- app/controllers/switchboard_entries_controller.rb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'app/controllers/switchboard_entries_controller.rb') 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 -- cgit v1.2.3