Created
January 2, 2010 15:45
-
-
Save dreamr/267531 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Bid controller | |
actions: create | |
views: new, form (partial including the form) | |
## Pictures controller | |
actions: index, new, create, edit, update, destroy | |
views: same ^^ | |
## Implementation | |
# pictures/1/show view renders the _form partial from app/views/bids/ | |
# that partial probably just has the current bid amount, a form field with +5 cents or something, and a button | |
# the form in _form should point to bids/new and the failing action of that should render the /pictures/1/bids/new form that also includes the _form partial | |
# your routes would look like this: | |
map.resources :pictures do |route| | |
route.resources :bids | |
end | |
map.resources :bids | |
# The route to the bid controller would be | |
pictures_bids_path(picture_obj) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment