aboutsummaryrefslogtreecommitdiffstats
path: root/actionwebservice
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2007-10-15 08:59:48 +0000
committerMichael Koziarski <michael@koziarski.com>2007-10-15 08:59:48 +0000
commitff4f90c81ad00241040c0c2ae2be1b937abfa063 (patch)
tree3157ea8127e278ed2990fddc450e610de98c2f96 /actionwebservice
parent3397d971ffbeb3870d4223fabcb85cd97a9d79a9 (diff)
downloadrails-ff4f90c81ad00241040c0c2ae2be1b937abfa063.tar.gz
rails-ff4f90c81ad00241040c0c2ae2be1b937abfa063.tar.bz2
rails-ff4f90c81ad00241040c0c2ae2be1b937abfa063.zip
Simple changes to bring AWS up to date with view_paths and render :text. Tests still fail though. [Koz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7916 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionwebservice')
-rw-r--r--actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb6
-rw-r--r--actionwebservice/lib/action_web_service/scaffolding.rb8
-rw-r--r--actionwebservice/test/scaffolded_controller_test.rb2
3 files changed, 8 insertions, 8 deletions
diff --git a/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb b/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb
index f240dbe904..f9995197a0 100644
--- a/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb
+++ b/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb
@@ -41,7 +41,7 @@ module ActionWebService # :nodoc:
allowed_methods = self.class.web_service_api ? (self.class.web_service_api.allowed_http_methods || []) : [ :post ]
allowed_methods = allowed_methods.map{|m| m.to_s.upcase }
if !allowed_methods.include?(method)
- render_text("#{method} not supported", "500 #{method} not supported")
+ render :text => "#{method} not supported", :status=>500
return
end
exception = nil
@@ -101,7 +101,7 @@ module ActionWebService # :nodoc:
message = "Exception raised"
backtrace = ""
end
- render_text("Internal protocol error: #{message}#{backtrace}", "500 Internal Protocol Error")
+ render :text => "Internal protocol error: #{message}#{backtrace}", :status => 500
end
end
@@ -158,7 +158,7 @@ module ActionWebService # :nodoc:
log_error(e) unless logger.nil?
end
when :post
- render_text('POST not supported', '500 POST not supported')
+ render :text => 'POST not supported', :status => 500
end
end
diff --git a/actionwebservice/lib/action_web_service/scaffolding.rb b/actionwebservice/lib/action_web_service/scaffolding.rb
index 1ffe4eba77..f94a7ee916 100644
--- a/actionwebservice/lib/action_web_service/scaffolding.rb
+++ b/actionwebservice/lib/action_web_service/scaffolding.rb
@@ -109,15 +109,15 @@ module ActionWebService
customized_template = "\#{self.class.controller_path}/#{action_name}/\#{action}"
default_template = scaffold_path(action)
if template_exists?(customized_template)
- content = @template.render_file(customized_template)
+ content = @template.render :file => customized_template
else
- content = @template.render_file(default_template, false)
+ content = @template.render :file => default_template
end
@template.instance_variable_set("@content_for_layout", content)
if self.active_layout.nil?
- render_file(scaffold_path("layout"))
+ render :file => scaffold_path("layout")
else
- render_file(self.active_layout, "200 OK", true)
+ render :file => self.active_layout
end
end
diff --git a/actionwebservice/test/scaffolded_controller_test.rb b/actionwebservice/test/scaffolded_controller_test.rb
index db73be17e3..722007cc99 100644
--- a/actionwebservice/test/scaffolded_controller_test.rb
+++ b/actionwebservice/test/scaffolded_controller_test.rb
@@ -5,7 +5,7 @@ ActionController::Routing::Routes.draw do |map|
map.connect ':controller/:action/:id'
end
-ActionController::Base.view_load_paths = [ '.' ]
+ActionController::Base.view_paths = [ '.' ]
class ScaffoldPerson < ActionWebService::Struct
member :id, :int