Skip to content

Instantly share code, notes, and snippets.

@fd
Created July 30, 2010 12:09
Show Gist options
  • Save fd/500399 to your computer and use it in GitHub Desktop.
Save fd/500399 to your computer and use it in GitHub Desktop.
Embedding Dylan in Rails 3.x

Embedding Dylan in Rails 3.x

Embedding Dylan in Rails 3.x is easy:

  • Create file called app/dylan/blog.rb
  • Create a template app/views/blog/index.html.erb
  • Mount Blog in the router.
class Blog < Dylan
get '/' do
render 'blog/index.html.erb'
end
end
<h1>This is a blog!</h1>
My::Application.routes.draw do |map|
# ...
match '/blog/*', :to => Blog.new(:templates => Rails.root + 'app/views')
# ...
end
@judofyr
Copy link

judofyr commented Jul 30, 2010

Hm… Where can I find Dylan?

@fd
Copy link
Author

fd commented Jul 30, 2010

Well you can find it here: http://github.com/fd/dylan

The goal of Dylan is to provide a more atomic dispatcher/controller layer that forces
developers to deal with a single resource (a collection or member) at a time.
This could potentially solve the complicated problem of cache invalidation.

I'm still just experimenting but may be it will actually become a valid project.
If you want to look at some expamles got to: http://github.com/fd/dylan/tree/master/examples/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment