Sha256: a7acdfdbace7aff7a2cbc5166ac4b3578073ccc275313ba1a6a2b6362557220d

Contents?: true

Size: 666 Bytes

Versions: 53

Compression:

Stored size: 666 Bytes

Contents

module PandaPal::Helpers::RouteHelper
  def lti_nav(nav, *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?
    options = nav
    nav, to = options.first
    options[:to] = to
    options.delete nav
    lti_options = options.delete(:lti_options) || {}
    path = "#{base_path}/#{nav.to_s}"
    lti_options[:url] = path.split('/').reject(&:empty?).join('_')
    post path, options, &block
    get path, options, &block
    PandaPal::register_navigation(nav)
    PandaPal::lti_navigation(nav, lti_options)
  end
end

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
panda_pal-5.1.0 lib/panda_pal/helpers/route_helper.rb
panda_pal-5.0.0 lib/panda_pal/helpers/route_helper.rb
panda_pal-5.0.0.beta.4 lib/panda_pal/helpers/route_helper.rb
panda_pal-5.0.0.beta.3 lib/panda_pal/helpers/route_helper.rb
panda_pal-5.0.0.beta.2 lib/panda_pal/helpers/route_helper.rb
panda_pal-5.0.0.beta.1 lib/panda_pal/helpers/route_helper.rb
panda_pal-4.1.0.beta3 lib/panda_pal/helpers/route_helper.rb
panda_pal-4.1.0.beta2 lib/panda_pal/helpers/route_helper.rb
panda_pal-4.0.11 lib/panda_pal/helpers/route_helper.rb
panda_pal-4.0.10 lib/panda_pal/helpers/route_helper.rb
panda_pal-4.0.8 lib/panda_pal/helpers/route_helper.rb
panda_pal-4.0.7 lib/panda_pal/helpers/route_helper.rb
panda_pal-4.0.6 lib/panda_pal/helpers/route_helper.rb
panda_pal-4.0.4 lib/panda_pal/helpers/route_helper.rb
panda_pal-4.0.3 lib/panda_pal/helpers/route_helper.rb
panda_pal-4.0.2 lib/panda_pal/helpers/route_helper.rb
panda_pal-4.0.1 lib/panda_pal/helpers/route_helper.rb
panda_pal-4.0.0 lib/panda_pal/helpers/route_helper.rb
panda_pal-3.2.3 lib/panda_pal/helpers/route_helper.rb
panda_pal-3.2.2 lib/panda_pal/helpers/route_helper.rb