Skip to content

Instantly share code, notes, and snippets.

@dreamr
Created January 2, 2010 15:45
Show Gist options
  • Save dreamr/267531 to your computer and use it in GitHub Desktop.
Save dreamr/267531 to your computer and use it in GitHub Desktop.
## 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