Skip to content

Instantly share code, notes, and snippets.

@hoffm
Last active August 11, 2017 23:35
Show Gist options
  • Save hoffm/5f6cd746b992a03a0eeb0f9dc57aabaf to your computer and use it in GitHub Desktop.
Save hoffm/5f6cd746b992a03a0eeb0f9dc57aabaf to your computer and use it in GitHub Desktop.
class StoryBooleansController < BaseController
def create
update_story(story_boolean => true)
end
def destroy
update_story(story_boolean => false)
end
private
def update_story(attributes)
story = Story.find(params[:story_id])
story.update!(attributes)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment