public
Description: Rails Plugin - a RailsEngines-based CMS extension for any Rails project
Homepage: http://6brand.com
Clone URL: git://github.com/JackDanger/simple_pages.git
improved error handling and error messages

git-svn-id: http://svn.6brand.com/projects/plugins/simple_pages@316 
7491b73d-821b-0410-9297-ad1f6b5b4194
studioda (author)
Thu Feb 22 09:36:12 -0800 2007
commit  955231384d2c98280279ab9d7ad2be10620f0292
tree    6135f093492124b835a608858fb8c476ba29e7dc
parent  4533fed5f9f4d2a2c3ee2cab4f6089b54510d402
...
72
73
74
 
 
 
75
76
77
...
72
73
74
75
76
77
78
79
80
0
@@ -72,6 +72,9 @@ class SimplePagesController < ApplicationController
0
            'ActiveRecord::RecordNotFound'
0
         render_404
0
       else
0
+ if exception.message =~ /undefined local variable or method `simple[_a-z]*_page_path'/
0
+ render :text => "You must install this plugin's routes! Add the line 'map.from_plugin :simple_pages' to your config/routes.rb", :layout => true and return
0
+ end
0
         super
0
       end
0
     end
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
...
1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
3
0
@@ -1,19 +1,2 @@
0
 module SimplePagesHelper
0
-
0
- def simple_new_page_path
0
- super
0
- rescue
0
- raise helper_error
0
- end
0
-
0
- def simple_page_path
0
- super
0
- rescue
0
- raise helper_error
0
- end
0
-
0
- def helper_error
0
- "You must install this plugin's routes! Add the line 'map.from_plugin :simple_pages' to your config/routes.rb"
0
- end
0
-
0
 end
0
\ No newline at end of file

Comments

    No one has commented yet.