Skip to content

Commit

Permalink
Merge pull request #4 from yang70/patch-2
Browse files Browse the repository at this point in the history
Use alert messages for invalid captcha
  • Loading branch information
mjhea0 committed Mar 13, 2016
2 parents 6a1d63b + 42ba727 commit c46579b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app.rb
Expand Up @@ -44,7 +44,7 @@ def title
erb :"posts/create"
end
post "/posts" do
halt(401, "invalid captcha") unless captcha_pass?
redirect "posts/create", :error => 'Invalid captcha' unless captcha_pass?
@post = Post.new(params[:post])
if @post.save
redirect "posts/#{@post.id}", :notice => 'Congrats! Love the new post. (This message will disappear in 4 seconds.)'
Expand Down

0 comments on commit c46579b

Please sign in to comment.