Examples for Template Contexts in Rango
Created
December 1, 2009 15:34
-
-
Save botanicus/246372 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 Posts < Rango::Controller | |
def show | |
post = Post.get(params[:id]) | |
render "post.html", post: post | |
end | |
end |
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 Posts < Rango::Controller | |
self.context ||= Object.new | |
def show | |
# you can't use @post explicitly | |
post = Post.get(params[:id]) | |
render "post.html", post: post | |
end | |
end |
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 Posts < Rango::Controller | |
def show | |
@post = Post.get(params[:id]) | |
render "post.html" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment