Skip to content

Instantly share code, notes, and snippets.

@davedkg
Created June 1, 2017 19:02
Show Gist options
  • Save davedkg/af5600030c605e47e2523d581c03b998 to your computer and use it in GitHub Desktop.
Save davedkg/af5600030c605e47e2523d581c03b998 to your computer and use it in GitHub Desktop.
params do
optional :data, type: Hash do
requires :text, type: String, desc: 'idea_article_snippet.text'
end
end
patch do
if current_idea_article_snippet.update(idea_article_snippet_params(params[:data]))
present :data, V1::Entities::IdeaArticleSnippet.represent(current_idea_article_snippet, only: params[:data].keys)
else
error!(current_idea_article_snippet.errors)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment