We recommend to use our integration with CarrierWave or Attachinary. With CarrierWave, you'll be able to simply use something like:
<%= form_for model do |f| %>
...
<%= f.upload_field :image %>
<% end %>
and everything else will be happening behind the scenes for you without any additional coding to do, as demonstrated in the sample project I shared previously.
If you still wish to do the coding on your end, then you can do something like the following:
<%= form_for model, html: {multipart: true} do |f| %>
...
<%= upload_field_tag :image %>
<% end %>
then in your controller:
def create
Cloudinary::Uploader.upload params[:image]
...
end