Skip to content

Commit

Permalink
Change path.
Browse files Browse the repository at this point in the history
  • Loading branch information
jugyo committed Apr 12, 2009
1 parent 84ec5ad commit fe05e49
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app.rb
Expand Up @@ -144,16 +144,16 @@
end
end

post '/entry/:id/comment' do
@entry = Entry.get(params[:id])
post '/comment' do
@entry = Entry.get(params[:entry_id])
@entry.comments.build(
:name => params[:name],
:email => params[:email],
:url => params[:url],
:body => params[:body]
)
@entry.save
redirect "/entry/#{params[:id]}"
redirect "/entry/#{params[:entry_id]}"
end

get '/login' do
Expand Down
3 changes: 2 additions & 1 deletion themes/default/entry/comments.haml
Expand Up @@ -11,7 +11,8 @@
= h(comment.body).gsub("\n", "<br />\n")

#comment_form
%form{:action=>"/entry/#{entry.id}/comment", :method=>'post'}
%form{:action=>"/comment", :method=>'post'}
%input{:type=>'hidden', :name=>'entry_id', :value=>entry.id}
%table
%tr
%th
Expand Down

0 comments on commit fe05e49

Please sign in to comment.