Sha256: a1c1d28efa3d99fbc498ecf65da89a24e0f15818ae5845f2a0a9e5d4c7c575f7

Contents?: true

Size: 812 Bytes

Versions: 70

Compression:

Stored size: 812 Bytes

Contents

require "bard/template/helper"

# Set up static controller
file "app/controllers/static_controller.rb", <<-END
class StaticController < ApplicationController
  def dispatch
    view_template_path = "/static/"+params[:path].join("/")
    begin
      render view_template_path, :layout => true
    rescue ActionView::MissingTemplate
      begin
        render view_template_path+"/index", :layout => true
      rescue ActionView::MissingTemplate
        raise ActiveRecord::RecordNotFound
      end
    end
  end
end
END

route "map.connect '*path', :controller => 'static', :action => 'dispatch'"
route "map.root :controller => 'static', :action => 'dispatch', :path => ['index']"  

file "app/views/static/index.html.haml", <<-END
%h1 #{project_name}
END

git :add => "."
git :commit => "-m'static controller.'"

Version data entries

70 entries across 70 versions & 1 rubygems

Version Path
bard-0.19.0 lib/bard/template/static_pages.rb
bard-0.18.0 lib/bard/template/static_pages.rb
bard-0.17.1 lib/bard/template/static_pages.rb
bard-0.17.0 lib/bard/template/static_pages.rb
bard-0.16.1 lib/bard/template/static_pages.rb
bard-0.16.0 lib/bard/template/static_pages.rb
bard-0.15.5 lib/bard/template/static_pages.rb
bard-0.15.4 lib/bard/template/static_pages.rb
bard-0.15.3 lib/bard/template/static_pages.rb
bard-0.15.2 lib/bard/template/static_pages.rb
bard-0.15.0 lib/bard/template/static_pages.rb
bard-0.14.2 lib/bard/template/static_pages.rb
bard-0.14.1 lib/bard/template/static_pages.rb
bard-0.14.0 lib/bard/template/static_pages.rb
bard-0.13.2 lib/bard/template/static_pages.rb
bard-0.13.1 lib/bard/template/static_pages.rb
bard-0.13.0 lib/bard/template/static_pages.rb
bard-0.12.0 lib/bard/template/static_pages.rb
bard-0.11.3 lib/bard/template/static_pages.rb
bard-0.11.2 lib/bard/template/static_pages.rb