diff --git a/app/assets/javascripts/bullseye.js.erb b/app/assets/javascripts/bullseye.js.erb index d060094..f226770 100644 --- a/app/assets/javascripts/bullseye.js.erb +++ b/app/assets/javascripts/bullseye.js.erb @@ -38,6 +38,8 @@ this.Bullseye = { break; } + controller = controller.replace('/', '-'); + if (this.targets[controller] && this.targets[controller][action]) { this.targets[controller][action].apply(this.context); } diff --git a/lib/bullseye/find_parts.rb b/lib/bullseye/find_parts.rb index e6f0cca..81ac774 100644 --- a/lib/bullseye/find_parts.rb +++ b/lib/bullseye/find_parts.rb @@ -11,7 +11,7 @@ module Bullseye end def parts - @source.split('/') + @parts ||= @source.split('/') end class PartFinder diff --git a/lib/bullseye/tilt/bullseye_template.rb b/lib/bullseye/tilt/bullseye_template.rb index 37a4f46..3dd1dbe 100644 --- a/lib/bullseye/tilt/bullseye_template.rb +++ b/lib/bullseye/tilt/bullseye_template.rb @@ -15,7 +15,7 @@ module Bullseye end def evaluate(scope, locals, &block) - @source = scope.logical_path[1..-1] + @source = scope.logical_path.gsub(%r{^[^/]*/}, '') <<-JS Bullseye.target('#{controller}', #{actions.to_json}, function() {