diff --git a/app/controllers/character_sheet_sections_controller.rb b/app/controllers/character_sheet_sections_controller.rb index 2340376..24bc5f5 100644 --- a/app/controllers/character_sheet_sections_controller.rb +++ b/app/controllers/character_sheet_sections_controller.rb @@ -7,6 +7,11 @@ class CharacterSheetSectionsController < ApplicationController def index @sections = @character.character_sheet_sections.top_level @editable = ActiveModel::Type::Boolean.new.cast(params[:editable]) + if params[:table_id].present? + @table = Current.user.tables.find(params[:table_id]) + @characters = Current.user.characters.where(table: @table) + render layout: "table" + end end def new diff --git a/app/controllers/characters_controller.rb b/app/controllers/characters_controller.rb index d27d772..0c5ec8f 100644 --- a/app/controllers/characters_controller.rb +++ b/app/controllers/characters_controller.rb @@ -22,11 +22,6 @@ class CharactersController < ApplicationController end def show - if params[:table_id].present? - @table = Current.user.tables.find(params[:table_id]) - @characters = Current.user.characters.where(table: @table) - render layout: "table" - end end def edit diff --git a/app/views/character_sheet_sections/index.html.erb b/app/views/character_sheet_sections/index.html.erb index 2cd199f..1a18d08 100644 --- a/app/views/character_sheet_sections/index.html.erb +++ b/app/views/character_sheet_sections/index.html.erb @@ -3,9 +3,9 @@