Skip to content

Commit

Permalink
Certainly broke password protected articles
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Lecavelier committed Oct 16, 2013
1 parent 2c4d517 commit 84b93ec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions TODO.txt
@@ -0,0 +1 @@
Fix password protection, which is certainly totally broken
13 changes: 8 additions & 5 deletions app/views/articles/_password_form.html.erb
@@ -1,12 +1,15 @@
<div id='content-<%= article.id %>'>
<p>This post is password protected. Please fill in your password or login to view the content</p>
<%= remote_form_for(:articles, article,
<%= form_for(article, {
:remote => true,
:url => { :controller => 'articles', :action => 'check_password'},
:update => "content-#{article.id}") do |f| %>
:update => "content-#{article.id}"}) do |f| %>
<%= password_field(:article, :password) %>
<input type='hidden' name='article[id]' value='<%= article.id %>' />
<%= submit_to_remote('check_password', _('Submit') + '!',
:update => "content-#{article.id}",
:url => {:controller => 'articles', :action => 'check_password'}) %>
<%= submit_tag(_('Submit') + '!', name: 'check_password')
# :remote => true,
# :update => "content-#{article.id}",
# :url => {:controller => 'articles', :action => 'check_password'})
%>
<% end %>
</div>

0 comments on commit 84b93ec

Please sign in to comment.