Skip to content

Instantly share code, notes, and snippets.

@petrokoriakin
Created November 29, 2012 20:30
Show Gist options
  • Save petrokoriakin/4171702 to your computer and use it in GitHub Desktop.
Save petrokoriakin/4171702 to your computer and use it in GitHub Desktop.
Grape Congig
# config/initializers/grape.rb
module AppstackGrapeEndpointSetup
extend ActiveSupport::Concern
module ClassMethods
include Rails.application.routes.url_helpers
def default_url_options
{host: ::Rails.application.config.action_mailer.default_url_options[:host]}
end
end
end
module Grape
class Endpoint
include Rails.application.routes.url_helpers
default_url_options[:host] = ::Rails.application.config.action_mailer.default_url_options[:host]
end
class Entity
include AppstackGrapeEndpointSetup
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment