Commit 6fda67ed by liyijie

Use view_path= instead of view_path

parent a90f7016
class <%= controller_class_name %>Controller < SimpleController::BaseController
view_path '<%= view_class_path %>'
view_path = '<%= view_class_path %>'
<% if auth.present? %>acts_as_auth_action :<%= auth.downcase %><% end %>
private
......
......@@ -15,13 +15,17 @@ class SimpleController::BaseController < ::InheritedResources::Base
protected
def self.view_path path
@view_class_path = path
def self.view_path= path
@view_path = path
end
def self.view_path
@view_path
end
def view_path
self.class.instance_variable_get(:@view_class_path) ||
self.class.instance_variable_set(:@view_class_path, extract_view_path)
self.class.instance_variable_get(:@view_path) ||
self.class.instance_variable_set(:@view_path, extract_view_path)
end
def extract_view_path
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment