Say, for example, I have this in my db:
id name date
1 Item_1 feb-19
2 Item_2 feb-20
and I want to manipulate it so that the view can output this:
feb-19:
Item1
feb-20:
Say, for example, I have this in my db:
id name date
1 Item_1 feb-19
2 Item_2 feb-20
and I want to manipulate it so that the view can output this:
feb-19:
Item1
feb-20:
Sorry
feb-19:
Item_1
feb-20:
Item_2
How would I go about doing that?
Maybe smth like that:
def list
@examples = Example.find(:all)
end
I forgot to mention smth: the data u wrote I assumed to be part of
“examples” table from your db.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs