I have a question about what is regarded as good practice in the
context of RESTful Rails interfaces.

I have a Subscribers Controller with "index" and "new" (and other)
actions. In routes.rb I define resource-based routing with
"map.resources :subscribers".

In my index view I have a button_to that points to
"new_subscriber_path". Since the button generates a POST request,
which doesn't match any resource-based routes, I also have
"map.connect ':controller/:action'" in routes.rb to ensure that the
request goes to the intended "new"action.

This does exactly what I want it to, but it seems a little awkward to
have defined RESTful routes, and in this particular case to not use
one because of a UI design choice I've made (a button instead of a
link). Should this be viewed as a limitation in the way Rails supports
REST, or is there a different way I should be doing this?

Mark.

--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to