soapbox 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/controllers/application_controller.rb +11 -0
- data/app/controllers/redirects_controller.rb +4 -1
- data/soapbox.gemspec +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
@@ -22,6 +22,17 @@ class ApplicationController < ActionController::Base
|
|
22
22
|
end
|
23
23
|
|
24
24
|
private
|
25
|
+
def render_404(exception = nil)
|
26
|
+
if exception
|
27
|
+
logger.info "Rendering 404 with exception: #{exception.message}"
|
28
|
+
end
|
29
|
+
|
30
|
+
respond_to do |format|
|
31
|
+
format.html { render :file => "#{Rails.root}/public/404.html", :status => :not_found, :layout => false }
|
32
|
+
format.xml { head :not_found }
|
33
|
+
format.any { head :not_found }
|
34
|
+
end
|
35
|
+
end
|
25
36
|
def render_in_template(obj)
|
26
37
|
if (!obj.template.blank? &&
|
27
38
|
FileTest.exists?(Rails.root.join('app', 'views', obj.class.to_s.tableize, 'templates', "#{obj.template}.html.erb")))
|
@@ -1,5 +1,8 @@
|
|
1
1
|
class RedirectsController < ApplicationController
|
2
2
|
def show
|
3
|
-
|
3
|
+
unless Redirect.find_by_source(params[:path]).nil?
|
4
|
+
return redirect_to "/"+Redirect.find_by_source(params[:path]).destination
|
5
|
+
end
|
6
|
+
render_404
|
4
7
|
end
|
5
8
|
end
|
data/soapbox.gemspec
CHANGED
metadata
CHANGED