Skip to content
This repository has been archived by the owner on May 24, 2023. It is now read-only.

Commit

Permalink
Rename render methods to view.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnunemaker committed Feb 12, 2013
1 parent 3f9d775 commit 8e44971
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
16 changes: 7 additions & 9 deletions lib/flipper/ui/action.rb
Expand Up @@ -97,10 +97,8 @@ def run_other_action(action_class)
action_class.new(flipper, request).run
end

def render(name)
body = render_with_layout do
render_without_layout name
end
def view_response(name)
body = view_with_layout { view_without_layout name }

Rack::Response.new(body, @code, @headers)
end
Expand All @@ -117,17 +115,17 @@ def json_response(object, options = {})
end

# Private
def render_with_layout(&block)
render_template :layout, &block
def view_with_layout(&block)
view :layout, &block
end

# Private
def render_without_layout(name)
render_template name
def view_without_layout(name)
view name
end

# Private
def render_template(name)
def view(name)
path = views_path.join("#{name}.erb")
contents = path.read
compiled = Eruby.new(contents)
Expand Down
3 changes: 2 additions & 1 deletion lib/flipper/ui/actions/index.rb
Expand Up @@ -12,7 +12,8 @@ def get
@features = flipper.features.map { |feature|
Decorators::Feature.new(feature)
}
render :index

view_response :index
end
end
end
Expand Down

0 comments on commit 8e44971

Please sign in to comment.