Sha256: 67974dabfac65f43f41e5fc87f52f157128c0b2472096dc04e5e4fd2f3c473a1

Contents?: true

Size: 640 Bytes

Versions: 12

Compression:

Stored size: 640 Bytes

Contents

module PandaPal::Helpers::RouteHelper
  def lti_nav(options, *rest, &block)
    base_path = Rails.application.routes.named_routes[:panda_pal].path.spec
    raise LtiNavigationInUse.new('PandaPal must be mounted before defining lti_nav routes') if base_path.blank?

    nav, to = options.first
    options[:to] = to
    options.delete nav
    path = "#{base_path}/#{nav.to_s}"

    lti_options = options.delete(:lti_options) || {}
    lti_options[:route_helper_key] = path.split('/').reject(&:empty?).join('_')
    post(path, options.dup, &block)
    get(path, options.dup, &block)
    PandaPal::stage_navigation(nav, lti_options)
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
panda_pal-5.3.6.beta2 lib/panda_pal/helpers/route_helper.rb
panda_pal-5.3.6.beta1 lib/panda_pal/helpers/route_helper.rb
panda_pal-5.3.5 lib/panda_pal/helpers/route_helper.rb
panda_pal-5.3.4 lib/panda_pal/helpers/route_helper.rb
panda_pal-5.3.2 lib/panda_pal/helpers/route_helper.rb
panda_pal-5.3.0 lib/panda_pal/helpers/route_helper.rb
panda_pal-5.2.5 lib/panda_pal/helpers/route_helper.rb
panda_pal-5.2.4 lib/panda_pal/helpers/route_helper.rb
panda_pal-5.2.3 lib/panda_pal/helpers/route_helper.rb
panda_pal-5.2.2 lib/panda_pal/helpers/route_helper.rb
panda_pal-5.2.1 lib/panda_pal/helpers/route_helper.rb
panda_pal-5.2.0 lib/panda_pal/helpers/route_helper.rb