title: Using asset_path in Rails console
body: <p>In my <code>Character</code> model I have added:</p>
  
  <p><strong>character.rb</strong></p>
  
  <pre><code>before_save do
    self.profile_picture_url = asset_path('icon.png')
  end
  </code></pre>
  
  <p>However, for all the Characters that already exist in the database, their <code>profile_picture_url</code> is <code>nil</code>. I therefore want to enter the console and iterate through all of them and set it. In the console I tried:</p>
  
  <pre><code>Character.find_each do |c|
    c.profile_picture_url = asset_path('icon.png')
  end
  </code></pre>
  
  <p>But this gives the error:</p>
  
  <pre><code>NoMethodError: undefined method `asset_path' for main:Object
  </code></pre>
  
  <p>I hope I have adequately communicated what I am trying to achieve. Where am I going wrong?</p>