This is probably a "noob" question.
My plans is to use Shrine to handle xml file uploads in a
rails app I'm working on. I'm stuck at the very end of the "Quick Start" section of Shrine's
README.md guide. After I submit the form with the (xml) attachment, I'm expecting to see a hash in the
:xml_data column, but I'm getting nil. I'm using pry to do this from the controller action the form is submitted to. And I've double checked that all my steps match the guide. I realize this is not much info go off of, so I'll provide all the steps I've followed. I can definitely send code if it is helpful.
The table I'm adding the attachments to is the Uploads table.
Using Rails 4.2.5, Ruby 2.2.5
Here is what I've done:
1. Added the shrine gem and ran bundle - no issues here.
2. Added the the initializer - in config/initializers/shrine.rb (just copied and pasted from the guide and changed the plugin from sequel to :activerecord)
3. Created a migration to add a text column called :xml_data to my Upload table and ran it - no issues there. Schema looked correct afterwards. Restarted server.
4. Added an XmlUploader class than inherits from Shrine - I created this in a file called xml_uploader.rb under models
5. Added Include XmlUploader[:xml] within my Upload class (inherits from ActiveRecord::Base)
6. Added the hidden field to my upload form. I noticed that both the hidden field and the exposed field have the same name in the guide (:image), so I followed suit and named both of mine :xml. I also tried naming the hidden one something different (:xml_file) just to see if it made any difference and it didn't, so I put it back.
What am I missing here? Ideas?
-Kathleen