Skip to content

Instantly share code, notes, and snippets.

@GBH
Created October 16, 2012 12:40
Show Gist options
  • Save GBH/3899023 to your computer and use it in GitHub Desktop.
Save GBH/3899023 to your computer and use it in GitHub Desktop.
resources :objects do
put :publish, :on => :member
end
before_filter :load_object
def update
@object.update_attributes!(params[:object])
# ...
end
def publish
@object.toggle(:is_published)
# ...
end
def load_object
@object.find(params[:object_id])
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment