Getting started with the rails gem

Archived from the Transloadit support forum. Originally posted on October 7, 2013; details may be outdated, see our docs for current behavior. Original thread

I’m trying to set up transloadit on my rails app using the rails-sdk gem. I’m new to this so I’m stuck on step1 (it seems).

I added the gem to the gemfile
I ran bundle install
Then rails g transloadit:install

I added this to my transloadit.yml file for dev and prod
jquery_sdk_version: ‘latest’
auth:
key : ‘xxx…’
secret : ‘xxx…’
duration: 1800 # 30 minute validity period for signed upload forms

templates:
s3_store: ‘xxx…’

# template defined inline
image_resize:
steps:
resize:
robot : ‘/image/resize’
width : 320
height: 200

I then added the following to my app/views/shares/new.html.erb
<%= form_for Share.new, :html => { :id => ‘share’ } do |f| %>
<%= transloadit :thumb %>
<%= f.label :file, ‘File to upload’ %>
<%= f.file_field :file %>
<%= f.submit %>
<% end %>
<%= transloadit_jquerify :upload, :wait => true %>

I then added the following to the Shares controller
include Transloadit::Rails::ParamsDecoder

My template looks something like this

{
"steps": {
"thumb": {
"robot": "/image/resize",
"width": "75",
"height": "75",
"resize_strategy": "pad",
"background": "#000000"
},
"export": {
"robot": "/s3/store",
"key": "REDACTED",
"secret": "REDACTED",
"bucket": "xxx..."
}
}
}

I get the following error when I navigate to the new shares page: undefined method `process_in_background’ for #<Class:0x007fcdb2c9f068> and sometimes
undefined method `key?’ for nil:NilClass

Any ideas of where I’m going wrong?

Are you using the `delayed_paperclip` gem? This appears to be an issue related to it (and not, I think with the Rails SDK). Without a full stack trace and more information, though, I can’t really give you any better information.

https://github.com/jstorimer/delayed_paperclip/issues/52
https://github.com/jstorimer/delayed_paperclip/issues/49

Hey Grant,

did you see Stephen’s reply above?

Kind regards,
Tim

Co-Founder Transloadit
@tim_kos

I am going to close this ticket for now. Please feel free to reopen it again if you have further questions.

Kind regards,
Tim

Co-Founder Transloadit
@tim_kos