I am new to the whole RESTful idea and I am trying to use it in a new
version of my app.  I might be totally missing the ball here, but this
is what I am trying to do.  I have an application that is 95% read-only
to the public users, with a back end administration available to our
staff (basically a CMS).  I want to create an API so that my users can
get an XML representation of a "widget" based on find criteria..
something like this:

http://myapp.com/widgets/123?height=1&weight=15.

This would return XML for all widgets that had a height 1 and weight 15.
The users would also be able to create widgets (using REST) and some
client apps that run on the cron would have full CRUD access to the
widget resource.

At the same time I have a bunch of custom actions that should not be
RESTful and only available to users that are viewing the app with a
browser.  I could add a bunch of logic to the "show" action, but I think
it would get pretty messy and I like having the action name in the URL
for SEO purposes.  By making the widget a resource, I can't use the
traditional "widgets/myaction" URL, because it tries to use "show"
instead of the action.  I am guessing I can fiddle with the routes and
add my custom actions, but I am wondering if this is bad design?  Should
I approach this a different way?
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to