title: How to use Jbuilder to save output for later
body: <p>I want to save json into a database field for later use.  How should I go about that with Jbuilder? </p>
  
  <p>I want to use an item's show template, passing in the object, @item to save the output for that Item into the database for later use.  </p>
  
  <p>I got some output with the following code:</p>
  
  <pre><code>view_paths = Rails::Application::Configuration.new(Rails.root).paths["app/views"]
  av_helper = ActionView::Base.new view_paths
  include Rails.application.routes.url_helpers
  @job = Job.find(239)
  output = av_helper.render(file: '/api/jobs/show.jbuilder', locals: {:@job =&gt; @job})
  </code></pre>
  
  <p>How can I render the saved json directly from the controller?</p>
  
  <p>Add this for the action code in the controller</p>
  
  <pre><code>def show
     @job = Job.find(params[:id])    
     render :inline =&gt; @job.json_output 
  end
  </code></pre>