RMcNeely / rails-assessment

0 stars 0 forks source link

Re: Ajax Version: Implement prev/next controller actions #2

Open aviflombaum opened 8 years ago

aviflombaum commented 8 years ago

Add a previous and next action in your controllers that can determine the previous and next assessment based on the current one's ID or Slug using a SQL query so that it's less fickle than incrementing a primary key.

You could also make the /assessments/ url support a query string parameter, like /assessments?current_id=gitlab&direction=prev vs /assessments?current_id=gitlab&direction=next and actually just have the assessments index controller action handle this functionality...

RMcNeely commented 8 years ago

Starting with commit 3a53ccc added in API endpoints for assessments#next and assessments#prev to the AssesmentController. You can find matching methods for Assessment to query an assessment in order.

aviflombaum commented 8 years ago

Hey Ryan, if you link to a #2 issue or a commit 3a53ccc GitHub will auto link them so don't put them in code fences. Easier for me to click on a link then browse the commit.

aviflombaum commented 8 years ago

left some comments on the commit. Try to open PRs because that will make it easier for you to manage the comments. If a PR was associated to this issue we'd see those comments here too.

RMcNeely commented 8 years ago

7