some fixes for controller names

This commit is contained in:
John Bintz 2012-09-21 21:05:27 -04:00
parent 051766915f
commit 72881189e8
4 changed files with 5 additions and 3 deletions

View File

@ -38,6 +38,8 @@ this.Bullseye = {
break; break;
} }
controller = controller.replace('/', '-');
if (this.targets[controller] && this.targets[controller][action]) { if (this.targets[controller] && this.targets[controller][action]) {
this.targets[controller][action].apply(this.context); this.targets[controller][action].apply(this.context);
} }

View File

@ -9,7 +9,7 @@ module Bullseye
end end
def parts def parts
@source.split('/') @parts ||= @source.split('/')
end end
class PartFinder class PartFinder

View File

@ -15,7 +15,7 @@ module Bullseye
end end
def __bullseye_controller def __bullseye_controller
@__bullseye_controller || controller_path @__bullseye_controller || controller_path.gsub('/', '-')
end end
end end
end end

View File

@ -15,7 +15,7 @@ module Bullseye
end end
def evaluate(scope, locals, &block) def evaluate(scope, locals, &block)
@source = scope.logical_path[1..-1] @source = scope.logical_path.gsub(%r{^[^/]*/}, '')
<<-JS <<-JS
Bullseye.target('#{controller}', #{actions.to_json}, function() { Bullseye.target('#{controller}', #{actions.to_json}, function() {