Iam a beginner in rails 3.
I want to create a simple App.
In this App, user is asked to enter a number.The App will return the value stored at that number.
In this case, i have a model Number.
It has say 100 numbers.The numbers are randomly entered.There’s no order.
Now, user enters 12
The App should return the number at position 10.But, the position of numbers is not fixed.A number at position 10 may be at position 20 later.
But, App shud always display the value at user entered position.i.e., if user enters 10, App should display value at position 10.
Something like obj[i].value in java.
Any opinions? 🙂
If you can afford to fetch all the records, you can do something like
If you only want to fetch that particular record (skip i-1 records), you can do