Skip to content

Instantly share code, notes, and snippets.

@JamesHarrison
Created February 9, 2012 02:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JamesHarrison/1776579 to your computer and use it in GitHub Desktop.
Save JamesHarrison/1776579 to your computer and use it in GitHub Desktop.
# Load a scope from a parameter
@list_scope = Image.get_scope(params[:scope]) if params[:scope]
if @list_scope and @list_scope[:options] and @list_scope[:selector]
@images = Image.all
@images.selector = @list_scope[:selector]
@images.options = @list_scope[:options]
end
# You get the idea.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment