Modified:
trunk/ChangeLog
trunk/app/controllers/notes_controller.rb
trunk/config/routes.example.rb
trunk/test/functional/notes_controller_test.rb
Log:
2008-05-17 ARAKI Yasuhiro <a...@debian.org>
* app/controllers/notes_controller.rb (NotesController::noteslist): Back
to use for wrong URI redirect from ?ct=Time.now to ?notice.
* config/routes.example.rb: Change to generate file/URL with flash[:noti
ce]
* test/functional/notes_controller_test.rb (NotesControllerTest::test_pa
rse_nums__1): Apply for these change.
Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog (original)
+++ trunk/ChangeLog Sun May 18 14:38:58 2008
@@ -1,3 +1,11 @@
+2008-05-17 ARAKI Yasuhiro <a...@debian.org>
+
+ * app/controllers/notes_controller.rb (NotesController::noteslist): Back to use for wrong URI redirect from ?ct=Time.now to ?notice.
+
+ * config/routes.example.rb: Change to generate file/URL with flash[:notice]
+ * test/functional/notes_controller_test.rb (NotesControllerTest::test_parse_nums__1): Apply for these change.
+
+
2008-05-16 ARAKI Yasuhiro <a...@debian.org>
* app/controllers/notes_controller.rb (NotesController::indexabc): Change to use for wrong URI redirect ?notice to ?ct=Time.now.to_i.
Modified: trunk/app/controllers/notes_controller.rb
==============================================================================
--- trunk/app/controllers/notes_controller.rb (original)
+++ trunk/app/controllers/notes_controller.rb Sun May 18 14:38:58 2008
@@ -210,8 +210,7 @@
redirect_to :action => "show_date", :year => $1, :month => $2, :day => $3
else
flash[:notice] = "正しく日付を指定してください" unless flash[:notice]
-# redirect_to :action => 'noteslist'#, :notice => flash[:notice]
- redirect_to :action => 'noteslist', :ct => Time.now.to_i
+ redirect_to :action => 'noteslist', :notice => flash[:notice]
end
end
@@ -348,8 +347,7 @@
@articles = Article.find(:all, :conditions => ["article_date >= ? AND article_date < ? AND (articles.hidden IS NULL OR articles.hidden = 0)", @ymd, @ymd1a])
else
flash[:notice] = "正しく日付を指定してください" unless flash[:notice]
-# redirect_to :action => 'noteslist' #, :notice => flash[:notice]
- redirect_to :action => 'noteslist', :ct => Time.now.to_i
+ redirect_to :action => 'noteslist', :notice => flash[:notice]
end
begin
@@ -362,8 +360,7 @@
rescue
logger.info $!
flash[:notice] = "正しく日付を指定してください" unless flash[:notice]
- # redirect_to :action => 'noteslist' #, :notice => flash[:notice]
- redirect_to :action => 'noteslist', :ct => Time.now.to_i
+ redirect_to :action => 'noteslist', :notice => flash[:notice]
end
end
Modified: trunk/config/routes.example.rb
==============================================================================
--- trunk/config/routes.example.rb (original)
+++ trunk/config/routes.example.rb Sun May 18 14:38:58 2008
@@ -9,7 +9,7 @@
map.connect '', :controller => "notes", :action => "noteslist", :page => '1'
map.connect "archives/", :controller => "notes", :action => "noteslist" , :page => '1'
map.connect "archives/index", :controller => "notes", :action => "noteslist" , :page => '1'
-
+ map.connect "archives/noteslist/notice/:notice", :controller => "notes", :action => "noteslist" # r378
map.connect "archives/noteslist", :controller => "notes", :action => "noteslist" , :page => '1'
map.connect "archives/noteslist/page/:page", :controller => "notes", :action => "noteslist", :page => /\d+/
Modified: trunk/test/functional/notes_controller_test.rb
==============================================================================
--- trunk/test/functional/notes_controller_test.rb (original)
+++ trunk/test/functional/notes_controller_test.rb Sun May 18 14:38:58 2008
@@ -164,7 +164,7 @@
def test_parse_nums__1
get :parse_nums, :nums => '200403051'
assert_response 302
- assert_match(/ct=/, @response.headers['Location'])
+ assert_match(/noteslist\/notice\/200403051$/, @response.headers['Location'])
end
def test_parse_nums__2
get :parse_nums, :nums => '20040305'