title: Saving the information emailed and processed via Mailgun into my app
body: <p>I have set up Heroku &amp; Railgun in order to be able to take the content from emails and store it. </p>
  
  <p>I've got it to the point that when emails are sent to mailgun, they are forwarded to my app and empty instaces of my messages model are created automatically, however, none of the fields from the email are being stored (despite having a matched schema (eg. from:string subject:string etc)). </p>
  
  <p>My issue is that I can't figure out how to take the contents of a HTTP POST request and process it so that each message is stored with its corresponding information. I can see that it is coming into heroku (via heroku logs), but cannot store it. I'm looking to store at first the following fields:</p>
  
  <ul>
  <li>From </li>
  <li>Subject</li>
  <li>Attachments</li>
  </ul>
  
  <p>At the moment my messages_controller.rb looks like this</p>
  
  <pre><code>    def create
        @message = Message.new(params[:message])
  
        respond_to do |format|
          if @message.save
            format.html { redirect_to @message, notice: 'Message was successfully created.' }
            format.json { render json: @message, status: :created, location: @message }
          else
            format.html { render action: "new" }
            format.json { render json: @message.errors, status: :unprocessable_entity }
          end
        end
      end
  </code></pre>
  
  <p>Any suggestions? </p>
  
  <p>I'm sure its a basic comprehension problem on my part, but I can't seem to find anything that really explains what I'm trying to do here. </p>