Skip to content

Methods inside messages delimited with <<-MESSAGE aren't escaped #3

Description

@SandNerd

This method in Devise code provides an example where FastMethodSource.source_for(DeviseController.instance_method(:assert_is_devise_resource!)) returns only this part:

  def assert_is_devise_resource! #:nodoc:
    unknown_action! <<-MESSAGE unless devise_mapping
Could not find devise mapping for path #{request.fullpath.inspect}.
This may happen for two reasons:

1) You forgot to wrap your route inside the scope block. For example:

  devise_scope :user do
    get "/some/route" => "some_devise_controller"
  end

Similar delimeters have the same problem. This can especially be problematic for methods containing class_eval <<-RUBY which I've seen quite often.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions