Created
May 17, 2013 22:53
-
-
Save robyurkowski/5602477 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
module Admin | |
class UsersController < ::AuthenticatedController | |
load_and_authorize_resource | |
def index | |
users = User.untrashed | |
render_with :users => users | |
end | |
def trashed | |
rendering :index | |
users = User.trashed | |
render_with :users => users | |
end | |
end | |
end |
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 ApplicationController < ActionController::Base | |
protect_from_forgery | |
def render_with(locals = {}, render_options = {}) | |
@_template_to_render ||= caller[0][/`([^']*)'/, 1] | |
render @_template_to_render, {:locals => locals}.merge(render_options) | |
end | |
def rendering(template) | |
@_template_to_render = template | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment