On May 28, 2009, at 12:25 AM, Roy Wright wrote:
> Howdy, > > Got an app started where I'm trying to get RESTful routes working > but have an issue on create. The code works fine when accessed from > a browser (:html) but not when using restclient. > > Here's what I think are the relevant code and logs: > http://gist.github.com/119032 > > What has me confused is that when using rest, I create a record and > redirect to show it, but it's not there, then if I issue another > show command it is there. Is there anything different that has to > be done for rest routes? Finally figured this one out. The resource(*args) generates the url string (ex: /commands/1) which does not include the format. So needed to append the format something like: show_resource = rest_resource(@parent, @resource) # append the format if it's available show_resource += ".#{params[:format]}" unless params[:format].blank? redirect show_resource Have fun, Roy --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "merb" group. To post to this group, send email to merb@googlegroups.com To unsubscribe from this group, send email to merb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/merb?hl=en -~----------~----~----~----~------~----~------~--~---