Class: PandaPal::LtiV1P0Controller
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- PandaPal::LtiV1P0Controller
- Defined in:
- app/controllers/panda_pal/lti_v1_p0_controller.rb
Instance Method Summary collapse
Instance Method Details
#launch ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'app/controllers/panda_pal/lti_v1_p0_controller.rb', line 7 def launch current_session_data.merge!({ lti_version: 'v1p0', lti_launch_placement: params[:launch_type], launch_params: params.to_unsafe_h, }) redirect_with_session_to(:"#{LaunchUrlHelpers.launch_route(params[:launch_type])}_url", route_context: main_app) end |
#tool_config ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/controllers/panda_pal/lti_v1_p0_controller.rb', line 17 def tool_config if PandaPal.lti_environments.empty? render plain: 'Domains must be set in lti_environments' return end platform = PandaPal..delete(:platform) || 'canvas.instructure.com' request_url = "#{request.scheme}://#{request.host_with_port}" case platform when 'canvas.instructure.com' xml_config = LtiXml::CanvasPlatform.new(platform, request_url, main_app) when 'bridgeapp.com' xml_config = LtiXml::BridgePlatform.new(platform, request_url, main_app) else render plain: 'platform must be set under lti_options' return end render xml: xml_config.xml end |