Skip to content

Commit 0a29e8b

Browse files
author
System Administrator
committed
Routes etc. Pretty good place to leave it
1 parent 24a50e9 commit 0a29e8b

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

app/controllers/drafts_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def new
2020
url = params[:draft_url]
2121
d = Draft.new(:url => url, :public_url => Digest::SHA256.new.hexdigest(url).first(7))
2222
d.save
23-
redirect_to "/drafts/compose/#{params[:draft_url]}"
23+
redirect_to "/#{params[:draft_url]}"
2424
end
2525

2626
def save
@@ -70,7 +70,7 @@ def save_review
7070
def refresh_review
7171
Review.find(session[:review_ids][params[:draft_id].to_i]).destroy
7272
session[:review_ids][params[:draft_id].to_i] = nil
73-
redirect_to "/drafts/review/#{params[:public_url]}"
73+
redirect_to "/review/#{params[:public_url]}"
7474
end
7575

7676
def feedback

app/views/drafts/compose.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ var wordCountL10n = {
8686

8787
<div class="wrap">
8888
<div id="icon-edit" class="icon32"></div>
89-
<h2 style="padding-bottom: 6px; margin-bottom: 10px; border-bottom: 1px solid #e6e6e6; font-size: 20px"><strong>Draft away!</strong> <span style="font-size: 18px">Then, when you're ready to share, send friends here &rarr; <span style="font-weight: bold; font-style: normal; text-align: center; width: 250px; font-size: 22px;" id="public_link"><a href="/drafts/review/<%= @drft.public_url %>" target="_blank" style="background-color: #FFFBCC;">draftback.com/review/<%= @drft.public_url %></a></span></span></h2>
89+
<h2 style="padding-bottom: 6px; margin-bottom: 10px; border-bottom: 1px solid #e6e6e6; font-size: 20px"><strong>Draft away!</strong> <span style="font-size: 18px">Then, when you're ready to share, send friends here &rarr; <span style="font-weight: bold; font-style: normal; text-align: center; width: 250px; font-size: 22px;" id="public_link"><a href="/review/<%= @drft.public_url %>" target="_blank" style="background-color: #FFFBCC;">draftback.com/review/<%= @drft.public_url %></a></span></span></h2>
9090
<form name="post" action="post.php" method="post" id="post">
9191
<div id="poststuff" class="metabox-holder" style="margin-top: 0px; padding-top: 0px;">
9292

config/routes.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,7 @@
4040
# consider removing or commenting them out if you're using named routes and resources.
4141
map.connect ':controller/:action/:id'
4242
map.connect ':controller/:action/:id.:format'
43+
map.connect '/:id', :controller => "drafts", :action => "compose"
44+
map.connect '/review/:id', :controller => "drafts", :action => "review"
45+
map.connect '/feedback/:id', :controller => "drafts", :action => "feedback"
4346
end

db/development.sqlite3

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)