Permalink
Browse files

Oops need to update generators to point to shared dir

  • Loading branch information...
1 parent cb6f1ca commit 0f67346529d9fdc9317da86618cc7e79e03a4176 Mark Evans committed Feb 24, 2012
@@ -3,13 +3,13 @@ module Rails
module ViewHelpers
def egg_mustache_templates
- Dir[::Rails.root.join('app/assets/javascripts/templates/*.mustache')].map do |path|
+ Dir[::Rails.root.join('app/assets/javascripts/shared/templates/*.mustache')].map do |path|
egg_mustache_template(File.basename(path, '.mustache'))
end.join("\n").html_safe
end
def egg_mustache_template(path)
- content = ::Rails.root.join('app/assets/javascripts/templates', "#{path}.mustache").read.html_safe
+ content = ::Rails.root.join('app/assets/javascripts/shared/templates', "#{path}.mustache").read.html_safe
content_tag(:script, content, :type => "text/x-mustache-template", :id => "#{path}-template") +
javascript_tag("""
window.JST = window.JST || {}
@@ -5,7 +5,7 @@ class ModelGenerator < ::Rails::Generators::NamedBase
argument :name, :type => :string
def create_stuff
- template "model.coffee.erb", "app/assets/javascripts/models/#{model_name}.coffee"
+ template "model.coffee.erb", "app/assets/javascripts/shared/models/#{model_name}.coffee"
apps.each do |app|
add_handler(app) if yes?("Add a handler for app #{app.basename}?")
end
@@ -5,7 +5,7 @@ class PresenterGenerator < ::Rails::Generators::NamedBase
argument :name, :type => :string
def create_stuff
- template "presenter.coffee.erb", "app/assets/javascripts/presenters/#{presenter_name}.coffee"
+ template "presenter.coffee.erb", "app/assets/javascripts/shared/presenters/#{presenter_name}.coffee"
end
private
@@ -5,8 +5,8 @@ class ViewGenerator < ::Rails::Generators::NamedBase
argument :name, :type => :string
def create_stuff
- template "view.coffee.erb", "app/assets/javascripts/views/#{view_name}.coffee"
- copy_file "template.mustache", "app/assets/javascripts/templates/#{underscore_name}.mustache"
+ template "view.coffee.erb", "app/assets/javascripts/shared/views/#{view_name}.coffee"
+ copy_file "template.mustache", "app/assets/javascripts/shared/templates/#{underscore_name}.mustache"
if apps.length == 1
add_handler apps.first
else

0 comments on commit 0f67346

Please sign in to comment.