module Strongbolt::Controllers::UrlHelpers

Creates the url helpers without the 'strongbolt_' prefix, that both Strongbolt views and the app views can use

It's not very nice like that but would be too complicated to do like Devise for now…

Constants

URLS

Public Class Methods

create_url_helper(url, scope = nil) click to toggle source

Creates the url helpers for the specific url and scope

# File lib/strongbolt/controllers/url_helpers.rb, line 17
      def self.create_url_helper(url, scope = nil)
        %i[path url].each do |path_or_url|
          class_eval <<-URL_HELPERS
            def #{scope.present? ? "#{scope}_" : ''}#{url}_#{path_or_url} *args
              send(:main_app).send("#{scope.present? ? "#{scope}_" : ''}strongbolt_#{url}_#{path_or_url}", *args)
            end
          URL_HELPERS
        end
      end