Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Rename render methods to view.

  • Loading branch information...
commit 8e44971af082e2bceeaeb57a2ca49c13104bdc91 1 parent 3f9d775
@jnunemaker authored
Showing with 9 additions and 10 deletions.
  1. +7 −9 lib/flipper/ui/action.rb
  2. +2 −1  lib/flipper/ui/actions/index.rb
View
16 lib/flipper/ui/action.rb
@@ -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
@@ -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)
View
3  lib/flipper/ui/actions/index.rb
@@ -12,7 +12,8 @@ def get
@features = flipper.features.map { |feature|
Decorators::Feature.new(feature)
}
- render :index
+
+ view_response :index
end
end
end

0 comments on commit 8e44971

Please sign in to comment.
Something went wrong with that request. Please try again.