Last active
August 11, 2017 23:35
-
-
Save hoffm/5f6cd746b992a03a0eeb0f9dc57aabaf 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
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