Created
February 15, 2009 18:48
-
-
Save zilkey/64806 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Views::Layouts::Application < Erector::Widget | |
def render | |
div :class => "header" do | |
text "header" | |
end | |
div :class => "body" do | |
inner_content | |
end | |
div :class => "footer" do | |
text "footer" | |
end | |
end | |
end | |
class Views::Projects::Index < Views::Layouts::Application | |
def inner_content | |
text "inner content " | |
end | |
end | |
# this will work | |
class ProjectsController < ApplicationController | |
def index | |
render_widget(Views::Projects::Index) | |
end | |
end | |
# this will not work - throwing error | |
# | |
# undefined local variable or method `inner_content' for #<Views::Layouts::Application:0x3ad6f6c> | |
# | |
class ProjectsController < ApplicationController | |
def index | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment