title: Assigning model field value with dynamic field in Rails
body: <p>Suppose I have a variable <em>param</em> that represents a field name in an ActiveRecord model.</p>
  
  <p>I want to set the field to a specific value.</p>
  
  <p>I know there are 2 ways of doing it (might be more), but my question is what's the difference between these 2 if any? </p>
  
  <p>Are there any gotchas I should keep in mind or can I use both ways interchangeably?</p>
  
  <p>1) Method 1</p>
  
  <pre><code>a = Article.find(3)
  a[param] = "value"
  a.save
  </code></pre>
  
  <p>2) Method 2</p>
  
  <pre><code>a = Article.find(3)
  a.send("#{param}=", "value")
  a.save
  </code></pre>