title: How can I get data from database in ruby
body: <p>I have database:</p>
  
  <pre><code>class CreateDataintables &lt; ActiveRecord::Migration
    def change
      create_table :windows do |t|
        t.string :window
        t.timestamps
      end
  
       create_table :channels do |t|
        t.integer :channel
        t.integer     :data
        t.belongs_to :window
        t.timestamps  
      end 
  
  
    end
  end
  </code></pre>
  
  <p>I want to read / write data from/to window "test" , channel "1" but don't know what to do. Give me some example code, please .I really need it.</p>