title: How can i show all the objects of an Object
body: <p>today I have been struggling to deal with a very simple problem.</p>
  
  <p>I have in my system a model called Sensors and these sensors have_many :value_of_sensors</p>
  
  <p>The value_of_sensors is like the history of each individual sensor, in order to do that i have created in the database a column called sensor_id which saves the id of the sensor </p>
  
  <p>My Question is, every time i go to a specific sensor by going to the ("show") option in my application ( the url changes to sensors/8 ) which is the sensor with the id = 8 , how can i modify my code in the controller index of the value_of_sensor so it takes this id = 8 of the sensor out of the URL and display all the history(value_of_sensor attributes) of the sensor with id = 8. </p>
  
  <p>For now i have tried to use this code in the controller index of value_of_sensor</p>
  
  <pre><code>@value_of_sensors = ValueOfSensor.where(:sensor_id =&gt; current_sensor.id)
  </code></pre>
  
  <p>but it seems that it does not work properly </p>
  
  <p>Can you please help</p>
  
  <p>Thanks in advance!</p>