Permalink
Browse files

fix js naming

  • Loading branch information...
1 parent 1607f57 commit 9856a543da8d05a7799a9e16ae86cf8b36794e42 @kristianmandrup committed Sep 10, 2012
Showing with 6 additions and 3 deletions.
  1. +4 −1 lib/generators/apotomo/widget_generator.rb
  2. +2 −2 lib/generators/templates/widget.coffee
@@ -80,7 +80,6 @@ def create_stylesheet_file
end
def create_script_file
- puts "create_script_file"
if coffee?
template 'widget.coffee', "#{js_path}_widget.js.coffee"
else
@@ -98,6 +97,10 @@ def ns_name
ns << ".#{names.last}"
end
+ def simple_name
+ class_name.to_s.demodulize
+ end
+
def js_camelize str
str = str.to_s
str.camelize.sub(/^\w/, str[0].downcase)
@@ -1,7 +1,7 @@
# Define your coffeescript code for the <%= class_name %> widget
namespace "Widget.<%= ns_name %>"
- <%= class_name %>:
- class <%= class_name %>
+ <%= simple_name %>:
+ class <%= simple_name %>
constructor : (@widget_id = widget_id) ->
# add custom widget function here

0 comments on commit 9856a54

Please sign in to comment.