example/map.rb in georgi-shinmun-0.3.2 vs example/map.rb in georgi-shinmun-0.3.3
- old
+ new
@@ -20,11 +20,15 @@
render 'index.rxml'
end
post '/comments' do
post = find_by_path(params['path'])
- post_comment(post, params)
- render '_comments.rhtml', :comments => comments_for(post)
+ if params['preview']
+ render '_comments.rhtml', :comments => [Shinmun::Comment.new(params)]
+ else
+ post_comment(post, params)
+ render '_comments.rhtml', :comments => comments_for(post)
+ end
end
get '/assets/javascripts\.js' do
render_javascripts
end