Permalink
Browse files

adjusted widget target path to fit with rails standards

  • Loading branch information...
1 parent ff6d7ca commit 95dc3818c9a5b2bbe101f19157fbbf0af0d4bc40 @kristianmandrup committed Sep 7, 2012
Showing with 6 additions and 3 deletions.
  1. +5 −2 lib/apotomo/widget.rb
  2. +1 −1 lib/generators/apotomo/widget_generator.rb
View
@@ -151,9 +151,12 @@ def render_widget(widget_id, state=:display, *args)
widget = widget_id
else
widget = find_widget(widget_id) or raise "Couldn't render non-existent widget `#{widget_id}`"
- end
-
+ end
+
widget.invoke(state, *args)
+ rescue NameError => e
+ return widget.invoke(:show, *args) if state == :display
+ raise e
end
end
end
@@ -6,7 +6,7 @@ module BasePathMethods
private
def base_path
- File.join('app/widgets', class_path, file_name)
+ File.join('app/widgets', class_path)
end
def js_path

0 comments on commit 95dc381

Please sign in to comment.