CraigBryan/property-rental-system

Property lists need to be able to be sorted

Closed this issue · 6 comments

The use case claims they should be sorted by number of rooms and rent.

Will_paginate can do this. I'll take a look.

sorted first by number of rooms? or by rent first? ex: property 1 rent = $100 rooms = 4, property 2 rent = $250 rooms = 3. Is it property 2, 1 or prop 1, 2

IT may be tricky because I'm already sorting by their 'deleted' status. We may be able to jsut tell it to order by deleted first, then by whatever column we want to sort by.

http://stackoverflow.com/questions/3587776/ruby-on-rails-how-do-i-sort-with-two-columns-using-activerecord

I'll push my changes to that stuff so you can work on it. The image zoom will still be broken.

Oh, I think the idea is that the column to order by can be chosen by the user (eg, by clicking the header), but here's what it says:

"If there are more than 25 properties to be shown, the list is paginated and the actor is
allowed to flip through the pages. The list may be sorted by number of rooms, rent."

Okay.. that's not clear at all for me. Maybe we do a group by rent, number of rooms (seems more logical to me then the other way round). We can clarify tomorrow in class

I implemented clickable headers for the columns that will sort the data. I agree the wording is not clear, but I imagine this is what they mean.

Also, we don't have that class tomorrow 👍