Permalink
Browse files

Rails 2.x compatibility.

  • Loading branch information...
1 parent 1bd802d commit 5fd1f928a0ee1f31f413794b8569505ac072f814 @fredwu committed Aug 7, 2010
Showing with 10 additions and 3 deletions.
  1. +0 −1 README.md
  2. +1 −1 Rakefile
  3. +1 −1 app/views/inherited_resources/_form.html.erb
  4. +1 −0 init.rb
  5. +7 −0 lib/inherited_resources_views/action_view.rb
View
@@ -25,7 +25,6 @@ If you are confused about the difference to some other similarly named projects,
## Dependencies
-* **Rails 3.0+**
* [Inherited Resources](http://github.com/josevalim/inherited_resources)
## Installation
View
@@ -32,7 +32,7 @@ begin
s.email = "ifredwu@gmail.com"
s.homepage = "http://github.com/fredwu/inherited_resources_views"
s.authors = ["Fred Wu"]
- s.add_dependency("inherited_resources", ">= 1.1")
+ s.add_dependency("inherited_resources", ">= 1.0")
end
Jeweler::GemcutterTasks.new
rescue LoadError
@@ -1,5 +1,5 @@
<table>
-<%= form_for(resource) do |f| %>
+<%- form_for(resource) do |f| %>
<% if resource.errors.any? %>
<tr>
<td colspan="2">
View
@@ -0,0 +1 @@
+require "inherited_resources_views"
@@ -14,6 +14,13 @@ def find(path, prefix = nil, partial = false, details = {}, key = nil)
rescue ::ActionView::MissingTemplate
super(path, "inherited_resources", partial, details, key)
end
+
+ def find_template(original_template_path, format = nil, html_fallback = true)
+ super
+ rescue ::ActionView::MissingTemplate
+ original_template_path.sub!(/^[\w]+/, "inherited_resources")
+ super
+ end
end
end
end

0 comments on commit 5fd1f92

Please sign in to comment.