lib/resourcelogic/self.rb in resourcelogic-0.12.4 vs lib/resourcelogic/self.rb in resourcelogic-0.12.5
- old
+ new
@@ -37,10 +37,10 @@
alternate_object, url_params = identify_object_or_params(alternate_object_or_params)
url_object = alternate_object
url_object = object if url_object.nil? && object && !object.new_record?
object_parts = url_object ?
[route_name, url_object] :
- (action == :new || singleton? ? route_name : route_name.to_s.pluralize.to_sym)
+ (action == :new || action.to_s =~ /_new$/ || singleton? ? route_name : route_name.to_s.pluralize.to_sym)
[action] + contexts_url_parts + [object_parts, url_params]
end
def identify_object_or_params(object_or_params)
obj = nil
\ No newline at end of file