Saving Restful routes path in database

Dear all,

I would like to save a restful resource in the database, and display
it as a link on the web page.

I tried saving:
into the path column in the table,

but unfortunately it doesn't work when I display it like this:
<%= link_to 'bar', bar.path %>

Is this possible with rails?

Thank you very much in advance for your help.

Kind regards,

Should be possible. When you call bar_path(1) it just returns a string
like "/bar/1" which you can then save in the database.

Can you clarify what "it doesn't work" means when you try this: <%=
link_to 'bar', bar.path %>. Do you get an error? Does it just not
output what you expect?

That should work for GET requests. If you wanted to link to another
method, you'll have to specify that since it's not part of the path: <
%= link_to 'bar', bar.path, :method => :delete %>

Hi Tim,

Thank you for the response. Currently it display the plain text of the
route method:

instead of:

When I looked in the database it saved as String. Do I need to convert
it into a method?

Sorry for the vague question and thanks heaps for your help.

Kind regards,