2

I am trying to create API using Grape gem for rails, but when I am trying to use force_ssl in my application controller, It gives me error "No function found force_ssl".

I know this issue is occurring because Grape removes lot of modules from rails, but I am unable to figure out which module I have to include to use force_ssl function. However, force_ssl can be used only for complete app or for some function, but in Grape API , we are not defining functions, we are defining URL based upon Rest API , so how can we use force_ssl in Grape API ?

My environment: ruby 2.1.5p273 , Rails 4.2.1, grape 0.11.0

tech spartans
  • 370
  • 6
  • 22

1 Answers1

0

I wound up going with https://github.com/tobmatth/rack-ssl-enforcer and ignoring certain paths. I don't know if that would work for your case, but it's worth a look.

aNoble
  • 7,033
  • 2
  • 37
  • 33