Skip to content

Instantly share code, notes, and snippets.

@HeroicEric
Created October 31, 2011 16:33
Show Gist options
  • Select an option

  • Save HeroicEric/1327910 to your computer and use it in GitHub Desktop.

Select an option

Save HeroicEric/1327910 to your computer and use it in GitHub Desktop.
post '/:id/interactions' do |id|
@screenshot = Screenshot.get(id)
@interaction = @screenshot.interactions.new(params[:interaction])
if @screenshot.save
flash[:info] = "The new interaction was added to your screenshot!"
redirect '/screenshots/' + id.to_s + '/edit'
else
flash.now[:error] = "Something was wrong. Try again."
haml :'screenshots/new'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment