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 CHANGED
@@ -1 +1 @@
1
- 0.2.1
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
- return redirect_to "/"+Redirect.find_by_source(params[:path]).destination rescue header("HTTP/1.0 404 Not Found");
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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{soapbox}
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Gabe Coyne}, %q{Killit Creative}]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soapbox
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 1
10
- version: 0.2.1
9
+ - 2
10
+ version: 0.2.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Gabe Coyne