Still learning RoR, sometimes I'll see an example use of a library in plain Ruby that has require 'my_library'
.
When we're in Ruby on Rails, are we able to do require
? Or does everything have to be included in the gemfile (which I guess both installs and requires the library).
In particular I'm trying to call a API:
class MyModel < ActiveRecord::Base
has_many :other_models
def get_score
require 'rest_client'
response = RestClient.post 'https://sender.blockspring.com/api/blocks/da289f59df228ac4e89cebdfc9aa41fd?api_key=fe5cf0d86af27c086ab5cd4d0eab6641', { items_as_json_string: '[{"time_since_post_in_hours": 5, "upvote_count": 22}, {"time_since_post_in_hours": 3, "upvote_count": 502}]' }
end
end