Created
January 9, 2009 00:23
-
-
Save tyler/44958 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PostsController | |
def show | |
... | |
respond_to do |format| | |
format.html | |
format.css do | |
render :string => post.css | |
end | |
end | |
end | |
def index | |
@posts = Post.find_dem_posts_yo | |
respond_to do |format| | |
format.html | |
format.css do | |
render :string => @posts.map(&:css).join("\n") | |
end | |
end | |
end | |
end | |
...meanwhile, in your layout... | |
<head> | |
<%= stylesheet_link_tag post_url(@post, :format => :css) %> | |
</head> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment