Closed guilhermesgb closed 12 years ago
I notice I did not say the issue: sometimes the links can be broken as they point to inexisting entities in the database. (Because my implementation is for now assuming their ids are sequential from 1 to the number of entries in database).
I also noticed something else: if there is no results, the search results page should not display the table neither the show, edit and remove links.
I've seen the bugs you are talking about. As for the last one, the showing nothing when there are no results, I have an idea and I will try to make some changes later tonight when I get home again if there is still the same problem.
I'll have to see the code to be able to do anything about the showing of the wrong URLs in different cases.
Nice work on the page, though! Looks a lot better
Nice! About the showing wrong urls, all that needs to be changed is (at lines 50 and 52 of _results.html.erb)
<% identifier = "TableElement" + i.to_s() %>
<tr onclick="setSelectedTableElement(<%= i%>)" id=<%= identifier%>>
From i to the code that retrieves the current listing id. Then, I guess that should work.
Yup just changed the <%= i %> to <%= i.id %> so that it gets the actual id from the database.
Did it work?? It is weird if that worked, shouldn't it be something like " list.id"?
2012/3/24 Adam Eggum < reply@reply.github.com
Yup just changed the <%= i %> to <%= i.id %> so that it gets the actual id from the database.
Reply to this email directly or view it on GitHub:
https://github.com/mswysocki/Madison-Student-Apartment-Finder/issues/6#issuecomment-4671976
Guilherme Santos G. Baptista Graduando em Cincia da Computao pela UFCG LSD - Laboratrio de Sistemas Distribudos
You're right, that's what it is. I just quickly wrote this and forgot about it. It works.
Nice!!
There is one issue I know that may happen sometime: While the results are popped out from the database, I record the possible links using a counter from 1 to number of search results. The problem is that this i should in fact reflect the actual ID in database for a given entry, as this is passed to the /lists/ or /lists//edit.
I was trying to retrieve the id of a listing but I noticed it is not as simple as retrieving its Address or other fields. Any thoughts?