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?