Q:

Rails allow :new, :show, but not :edit

I'm building a trivia app where each user can answer a daily trivia question exactly one time.  I can see using the :new action to answer the question and the :show action to show how the user answered, but I want the URLs to be the same.
So I want the same URL (http://example.com/daily_question) to render either :new if the user is just arriving for the first time today or :show if the user has already answered the daily question.  What's the easiest way to accomplish that?

A:

By default, the show and new action cannot give the same url, because show expects an 'id' to be in the url and new action expect the word 'new' at the end of the url.
If you need the same url, do not force it on the show or new action. Just create your own custom method in the controller then, and match it in the routes.

