Sha256: 8b91306c6f550c56ed14f6505ac17a85ab3279de18896cfae8561499dd22f159

Contents?: true

Size: 1002 Bytes

Versions: 11

Compression:

Stored size: 1002 Bytes

Contents

module Cell
  # Allows using many Rails gem in your cells outside of a Rails environment.
  class Rails
    module HelperAPI
      module InternalHelpers
        def protect_against_forgery? # used in form_tag_helper.rb:651
          false
        end
        
        def _routes # FIXME: where is this set in rails?
          self.class._routes
        end
      end
      
      extend ActiveSupport::Concern
      
      module ClassMethods
        attr_accessor :_routes
        
        def helper_modules
          [_helpers, InternalHelpers]
        end
        
        def view_context_class
          super
          @view_context_class._routes = _routes
          @view_context_class
        end
        
        def action_methods
          # DISCUSS: we have to overwrite this to avoid a stupid dependency in AbstractController::UrlFor where _routes.named_routes.helper_names is accessed.
          public_instance_methods(true).map { |x| x.to_s }
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
cells-3.11.3 lib/cell/rails/helper_api.rb
cells-3.11.2 lib/cell/rails/helper_api.rb
cells-3.11.1 lib/cell/rails/helper_api.rb
cells-3.11.0 lib/cell/rails/helper_api.rb
cells-3.10.1 lib/cell/rails/helper_api.rb
cells-3.10.0 lib/cell/rails/helper_api.rb
cells-3.9.1 lib/cell/rails/helper_api.rb
cells-3.9.0 lib/cell/rails/helper_api.rb
cells-3.8.8 lib/cell/rails/helper_api.rb
cells-3.8.7 lib/cell/rails/helper_api.rb
cells-3.8.6 lib/cell/rails/helper_api.rb